| OLD | NEW |
| 1 //===-- X86MCTargetDesc.cpp - X86 Target Descriptions -----------*- C++ -*-===// | 1 //===-- X86MCTargetDesc.cpp - X86 Target Descriptions -----------*- C++ -*-===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This file provides X86 specific target descriptions. | 10 // This file provides X86 specific target descriptions. |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 | 113 |
| 114 unsigned X86_MC::getDwarfRegFlavour(StringRef TT, bool isEH) { | 114 unsigned X86_MC::getDwarfRegFlavour(StringRef TT, bool isEH) { |
| 115 Triple TheTriple(TT); | 115 Triple TheTriple(TT); |
| 116 if (TheTriple.getArch() == Triple::x86_64) | 116 if (TheTriple.getArch() == Triple::x86_64) |
| 117 return DWARFFlavour::X86_64; | 117 return DWARFFlavour::X86_64; |
| 118 | 118 |
| 119 if (TheTriple.isOSDarwin()) | 119 if (TheTriple.isOSDarwin()) |
| 120 return isEH ? DWARFFlavour::X86_32_DarwinEH : DWARFFlavour::X86_32_Generic; | 120 return isEH ? DWARFFlavour::X86_32_DarwinEH : DWARFFlavour::X86_32_Generic; |
| 121 if (TheTriple.getOS() == Triple::MinGW32 || | 121 if (TheTriple.isOSMinGW32() || TheTriple.isOSCygwin()) |
| 122 TheTriple.getOS() == Triple::Cygwin) | |
| 123 // Unsupported by now, just quick fallback | 122 // Unsupported by now, just quick fallback |
| 124 return DWARFFlavour::X86_32_Generic; | 123 return DWARFFlavour::X86_32_Generic; |
| 125 return DWARFFlavour::X86_32_Generic; | 124 return DWARFFlavour::X86_32_Generic; |
| 126 } | 125 } |
| 127 | 126 |
| 128 /// getX86RegNum - This function maps LLVM register identifiers to their X86 | 127 /// getX86RegNum - This function maps LLVM register identifiers to their X86 |
| 129 /// specific numbering, which is used in various places encoding instructions. | 128 /// specific numbering, which is used in various places encoding instructions. |
| 130 unsigned X86_MC::getX86RegNum(unsigned RegNo) { | 129 unsigned X86_MC::getX86RegNum(unsigned RegNo) { |
| 131 switch(RegNo) { | 130 switch(RegNo) { |
| 132 case X86::RAX: case X86::EAX: case X86::AX: case X86::AL: return N86::EAX; | 131 case X86::RAX: case X86::EAX: case X86::AX: case X86::AL: return N86::EAX; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 X86_MC::getDwarfRegFlavour(TT, true)); | 281 X86_MC::getDwarfRegFlavour(TT, true)); |
| 283 X86_MC::InitLLVM2SEHRegisterMapping(X); | 282 X86_MC::InitLLVM2SEHRegisterMapping(X); |
| 284 return X; | 283 return X; |
| 285 } | 284 } |
| 286 | 285 |
| 287 static MCAsmInfo *createX86MCAsmInfo(const Target &T, StringRef TT) { | 286 static MCAsmInfo *createX86MCAsmInfo(const Target &T, StringRef TT) { |
| 288 Triple TheTriple(TT); | 287 Triple TheTriple(TT); |
| 289 bool is64Bit = TheTriple.getArch() == Triple::x86_64; | 288 bool is64Bit = TheTriple.getArch() == Triple::x86_64; |
| 290 | 289 |
| 291 MCAsmInfo *MAI; | 290 MCAsmInfo *MAI; |
| 292 if (TheTriple.isOSDarwin() || TheTriple.getEnvironment() == Triple::MachO) { | 291 if (TheTriple.isOSDarwin() || TheTriple.isEnvironmentMachO()) { |
| 293 if (is64Bit) | 292 if (is64Bit) |
| 294 MAI = new X86_64MCAsmInfoDarwin(TheTriple); | 293 MAI = new X86_64MCAsmInfoDarwin(TheTriple); |
| 295 else | 294 else |
| 296 MAI = new X86MCAsmInfoDarwin(TheTriple); | 295 MAI = new X86MCAsmInfoDarwin(TheTriple); |
| 297 } else if (TheTriple.isOSWindows()) { | 296 } else if (TheTriple.isOSWindows()) { |
| 298 MAI = new X86MCAsmInfoCOFF(TheTriple); | 297 MAI = new X86MCAsmInfoCOFF(TheTriple); |
| 299 } else { | 298 } else { |
| 300 MAI = new X86ELFMCAsmInfo(TheTriple); | 299 MAI = new X86ELFMCAsmInfo(TheTriple); |
| 301 } | 300 } |
| 302 | 301 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 366 } |
| 368 | 367 |
| 369 static MCStreamer *createMCStreamer(const Target &T, StringRef TT, | 368 static MCStreamer *createMCStreamer(const Target &T, StringRef TT, |
| 370 MCContext &Ctx, MCAsmBackend &MAB, | 369 MCContext &Ctx, MCAsmBackend &MAB, |
| 371 raw_ostream &_OS, | 370 raw_ostream &_OS, |
| 372 MCCodeEmitter *_Emitter, | 371 MCCodeEmitter *_Emitter, |
| 373 bool RelaxAll, | 372 bool RelaxAll, |
| 374 bool NoExecStack) { | 373 bool NoExecStack) { |
| 375 Triple TheTriple(TT); | 374 Triple TheTriple(TT); |
| 376 | 375 |
| 377 if (TheTriple.isOSDarwin() || TheTriple.getEnvironment() == Triple::MachO) | 376 if (TheTriple.isOSDarwin() || TheTriple.isEnvironmentMachO()) |
| 378 return createMachOStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll); | 377 return createMachOStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll); |
| 379 | 378 |
| 380 if (TheTriple.isOSWindows()) | 379 if (TheTriple.isOSWindows()) |
| 381 return createWinCOFFStreamer(Ctx, MAB, *_Emitter, _OS, RelaxAll); | 380 return createWinCOFFStreamer(Ctx, MAB, *_Emitter, _OS, RelaxAll); |
| 382 | 381 |
| 383 return createELFStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll, NoExecStack); | 382 return createELFStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll, NoExecStack); |
| 384 } | 383 } |
| 385 | 384 |
| 386 static MCInstPrinter *createX86MCInstPrinter(const Target &T, | 385 static MCInstPrinter *createX86MCInstPrinter(const Target &T, |
| 387 unsigned SyntaxVariant, | 386 unsigned SyntaxVariant, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 createMCStreamer); | 433 createMCStreamer); |
| 435 TargetRegistry::RegisterMCObjectStreamer(TheX86_64Target, | 434 TargetRegistry::RegisterMCObjectStreamer(TheX86_64Target, |
| 436 createMCStreamer); | 435 createMCStreamer); |
| 437 | 436 |
| 438 // Register the MCInstPrinter. | 437 // Register the MCInstPrinter. |
| 439 TargetRegistry::RegisterMCInstPrinter(TheX86_32Target, | 438 TargetRegistry::RegisterMCInstPrinter(TheX86_32Target, |
| 440 createX86MCInstPrinter); | 439 createX86MCInstPrinter); |
| 441 TargetRegistry::RegisterMCInstPrinter(TheX86_64Target, | 440 TargetRegistry::RegisterMCInstPrinter(TheX86_64Target, |
| 442 createX86MCInstPrinter); | 441 createX86MCInstPrinter); |
| 443 } | 442 } |
| OLD | NEW |