comparison lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp @ 120:1172e4bd9c6f

update 4.0.0
author mir3636
date Fri, 25 Nov 2016 19:14:25 +0900
parents afa8332a0e37
children c2174574ed3a
comparison
equal deleted inserted replaced
101:34baf5011add 120:1172e4bd9c6f
12 //===----------------------------------------------------------------------===// 12 //===----------------------------------------------------------------------===//
13 13
14 #include "NVPTXMCTargetDesc.h" 14 #include "NVPTXMCTargetDesc.h"
15 #include "InstPrinter/NVPTXInstPrinter.h" 15 #include "InstPrinter/NVPTXInstPrinter.h"
16 #include "NVPTXMCAsmInfo.h" 16 #include "NVPTXMCAsmInfo.h"
17 #include "llvm/MC/MCCodeGenInfo.h"
18 #include "llvm/MC/MCInstrInfo.h" 17 #include "llvm/MC/MCInstrInfo.h"
19 #include "llvm/MC/MCRegisterInfo.h" 18 #include "llvm/MC/MCRegisterInfo.h"
20 #include "llvm/MC/MCSubtargetInfo.h" 19 #include "llvm/MC/MCSubtargetInfo.h"
21 #include "llvm/Support/TargetRegistry.h" 20 #include "llvm/Support/TargetRegistry.h"
22 21
47 static MCSubtargetInfo * 46 static MCSubtargetInfo *
48 createNVPTXMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) { 47 createNVPTXMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) {
49 return createNVPTXMCSubtargetInfoImpl(TT, CPU, FS); 48 return createNVPTXMCSubtargetInfoImpl(TT, CPU, FS);
50 } 49 }
51 50
52 static MCCodeGenInfo *createNVPTXMCCodeGenInfo(const Triple &TT,
53 Reloc::Model RM,
54 CodeModel::Model CM,
55 CodeGenOpt::Level OL) {
56 MCCodeGenInfo *X = new MCCodeGenInfo();
57
58 // The default relocation model is used regardless of what the client has
59 // specified, as it is the only relocation model currently supported.
60 X->initMCCodeGenInfo(Reloc::Default, CM, OL);
61 return X;
62 }
63
64 static MCInstPrinter *createNVPTXMCInstPrinter(const Triple &T, 51 static MCInstPrinter *createNVPTXMCInstPrinter(const Triple &T,
65 unsigned SyntaxVariant, 52 unsigned SyntaxVariant,
66 const MCAsmInfo &MAI, 53 const MCAsmInfo &MAI,
67 const MCInstrInfo &MII, 54 const MCInstrInfo &MII,
68 const MCRegisterInfo &MRI) { 55 const MCRegisterInfo &MRI) {
71 return nullptr; 58 return nullptr;
72 } 59 }
73 60
74 // Force static initialization. 61 // Force static initialization.
75 extern "C" void LLVMInitializeNVPTXTargetMC() { 62 extern "C" void LLVMInitializeNVPTXTargetMC() {
76 for (Target *T : {&TheNVPTXTarget32, &TheNVPTXTarget64}) { 63 for (Target *T : {&getTheNVPTXTarget32(), &getTheNVPTXTarget64()}) {
77 // Register the MC asm info. 64 // Register the MC asm info.
78 RegisterMCAsmInfo<NVPTXMCAsmInfo> X(*T); 65 RegisterMCAsmInfo<NVPTXMCAsmInfo> X(*T);
79
80 // Register the MC codegen info.
81 TargetRegistry::RegisterMCCodeGenInfo(*T, createNVPTXMCCodeGenInfo);
82 66
83 // Register the MC instruction info. 67 // Register the MC instruction info.
84 TargetRegistry::RegisterMCInstrInfo(*T, createNVPTXMCInstrInfo); 68 TargetRegistry::RegisterMCInstrInfo(*T, createNVPTXMCInstrInfo);
85 69
86 // Register the MC register info. 70 // Register the MC register info.