diff options
Diffstat (limited to 'lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp')
-rw-r--r-- | lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp b/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp index 2115d4480eef0..e16ba9e153171 100644 --- a/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp +++ b/lib/Target/SystemZ/MCTargetDesc/SystemZMCTargetDesc.cpp @@ -10,7 +10,6 @@ #include "SystemZMCTargetDesc.h" #include "InstPrinter/SystemZInstPrinter.h" #include "SystemZMCAsmInfo.h" -#include "llvm/MC/MCCodeGenInfo.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCStreamer.h" @@ -159,17 +158,8 @@ createSystemZMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) { return createSystemZMCSubtargetInfoImpl(TT, CPU, FS); } -static MCCodeGenInfo *createSystemZMCCodeGenInfo(const Triple &TT, - Reloc::Model RM, - CodeModel::Model CM, - CodeGenOpt::Level OL) { - MCCodeGenInfo *X = new MCCodeGenInfo(); - - // Static code is suitable for use in a dynamic executable; there is no - // separate DynamicNoPIC model. - if (RM == Reloc::Default || RM == Reloc::DynamicNoPIC) - RM = Reloc::Static; - +static void adjustCodeGenOpts(const Triple &TT, Reloc::Model RM, + CodeModel::Model &CM) { // For SystemZ we define the models as follows: // // Small: BRASL can call any function and will use a stub if necessary. @@ -203,8 +193,6 @@ static MCCodeGenInfo *createSystemZMCCodeGenInfo(const Triple &TT, CM = CodeModel::Small; else if (CM == CodeModel::JITDefault) CM = RM == Reloc::PIC_ ? CodeModel::Small : CodeModel::Medium; - X->initMCCodeGenInfo(RM, CM, OL); - return X; } static MCInstPrinter *createSystemZMCInstPrinter(const Triple &T, @@ -220,9 +208,9 @@ extern "C" void LLVMInitializeSystemZTargetMC() { TargetRegistry::RegisterMCAsmInfo(TheSystemZTarget, createSystemZMCAsmInfo); - // Register the MCCodeGenInfo. - TargetRegistry::RegisterMCCodeGenInfo(TheSystemZTarget, - createSystemZMCCodeGenInfo); + // Register the adjustCodeGenOpts. + TargetRegistry::registerMCAdjustCodeGenOpts(TheSystemZTarget, + adjustCodeGenOpts); // Register the MCCodeEmitter. TargetRegistry::RegisterMCCodeEmitter(TheSystemZTarget, |