diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:41:05 +0000 |
commit | 01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch) | |
tree | 4def12e759965de927d963ac65840d663ef9d1ea /lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp | |
parent | f0f4822ed4b66e3579e92a89f368f8fb860e218e (diff) | |
download | src-vendor/llvm/llvm-release_39-r276489.tar.gz src-vendor/llvm/llvm-release_39-r276489.zip |
Vendor import of llvm release_39 branch r276489:vendor/llvm/llvm-release_39-r276489
Diffstat (limited to 'lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp')
-rw-r--r-- | lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp b/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp index 9113e4a46b96..dceaca791aab 100644 --- a/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp +++ b/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp @@ -15,7 +15,6 @@ #include "InstPrinter/SparcInstPrinter.h" #include "SparcMCAsmInfo.h" #include "SparcTargetStreamer.h" -#include "llvm/MC/MCCodeGenInfo.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/MC/MCRegisterInfo.h" #include "llvm/MC/MCSubtargetInfo.h" @@ -81,12 +80,8 @@ createSparcMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS) { // // All code models require that the text segment is smaller than 2GB. -static MCCodeGenInfo *createSparcMCCodeGenInfo(const Triple &TT, - Reloc::Model RM, - CodeModel::Model CM, - CodeGenOpt::Level OL) { - MCCodeGenInfo *X = new MCCodeGenInfo(); - +static void adjustCodeGenOpts(const Triple &TT, Reloc::Model RM, + CodeModel::Model &CM) { // The default 32-bit code model is abs32/pic32 and the default 32-bit // code model for JIT is abs32. switch (CM) { @@ -94,17 +89,10 @@ static MCCodeGenInfo *createSparcMCCodeGenInfo(const Triple &TT, case CodeModel::Default: case CodeModel::JITDefault: CM = CodeModel::Small; break; } - - X->initMCCodeGenInfo(RM, CM, OL); - return X; } -static MCCodeGenInfo *createSparcV9MCCodeGenInfo(const Triple &TT, - Reloc::Model RM, - CodeModel::Model CM, - CodeGenOpt::Level OL) { - MCCodeGenInfo *X = new MCCodeGenInfo(); - +static void adjustCodeGenOptsV9(const Triple &TT, Reloc::Model RM, + CodeModel::Model &CM) { // The default 64-bit code model is abs44/pic32 and the default 64-bit // code model for JIT is abs64. switch (CM) { @@ -116,9 +104,6 @@ static MCCodeGenInfo *createSparcV9MCCodeGenInfo(const Triple &TT, CM = CodeModel::Large; break; } - - X->initMCCodeGenInfo(RM, CM, OL); - return X; } static MCTargetStreamer * @@ -175,10 +160,10 @@ extern "C" void LLVMInitializeSparcTargetMC() { } // Register the MC codegen info. - TargetRegistry::RegisterMCCodeGenInfo(TheSparcTarget, - createSparcMCCodeGenInfo); - TargetRegistry::RegisterMCCodeGenInfo(TheSparcV9Target, - createSparcV9MCCodeGenInfo); - TargetRegistry::RegisterMCCodeGenInfo(TheSparcelTarget, - createSparcMCCodeGenInfo); + TargetRegistry::registerMCAdjustCodeGenOpts(TheSparcTarget, + adjustCodeGenOpts); + TargetRegistry::registerMCAdjustCodeGenOpts(TheSparcV9Target, + adjustCodeGenOptsV9); + TargetRegistry::registerMCAdjustCodeGenOpts(TheSparcelTarget, + adjustCodeGenOpts); } |