summaryrefslogtreecommitdiffstats
path: root/llvm/lib/LTO/LTOCodeGenerator.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-08-21 22:57:17 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-08-21 22:57:17 +0000
commit44ee84eec5ffc9bed4daee3de971689ae2e31501 (patch)
treebf37b95c9290478ee05e715822de8f6144fe5b85 /llvm/lib/LTO/LTOCodeGenerator.cpp
parentbd8a0856e2f959d313f8a8888ca468f02e6e4173 (diff)
downloadbcm5719-llvm-44ee84eec5ffc9bed4daee3de971689ae2e31501.tar.gz
bcm5719-llvm-44ee84eec5ffc9bed4daee3de971689ae2e31501.zip
LTO: Change signature of LTOCodeGenerator::setCodePICModel() to take a Reloc::Model.
This allows us to remove a bunch of code in LTOCodeGenerator and llvm-lto and has the side effect of improving error handling in the libLTO C API. llvm-svn: 245756
Diffstat (limited to 'llvm/lib/LTO/LTOCodeGenerator.cpp')
-rw-r--r--llvm/lib/LTO/LTOCodeGenerator.cpp30
1 files changed, 0 insertions, 30 deletions
diff --git a/llvm/lib/LTO/LTOCodeGenerator.cpp b/llvm/lib/LTO/LTOCodeGenerator.cpp
index 6203000c2ec..efeac033850 100644
--- a/llvm/lib/LTO/LTOCodeGenerator.cpp
+++ b/llvm/lib/LTO/LTOCodeGenerator.cpp
@@ -164,18 +164,6 @@ void LTOCodeGenerator::setDebugInfo(lto_debug_model debug) {
llvm_unreachable("Unknown debug format!");
}
-void LTOCodeGenerator::setCodePICModel(lto_codegen_model model) {
- switch (model) {
- case LTO_CODEGEN_PIC_MODEL_STATIC:
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC:
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC:
- case LTO_CODEGEN_PIC_MODEL_DEFAULT:
- CodeModel = model;
- return;
- }
- llvm_unreachable("Unknown PIC model!");
-}
-
bool LTOCodeGenerator::writeMergedModules(const char *path,
std::string &errMsg) {
if (!determineTarget(errMsg))
@@ -300,24 +288,6 @@ bool LTOCodeGenerator::determineTarget(std::string &errMsg) {
if (!march)
return false;
- // The relocation model is actually a static member of TargetMachine and
- // needs to be set before the TargetMachine is instantiated.
- Reloc::Model RelocModel = Reloc::Default;
- switch (CodeModel) {
- case LTO_CODEGEN_PIC_MODEL_STATIC:
- RelocModel = Reloc::Static;
- break;
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC:
- RelocModel = Reloc::PIC_;
- break;
- case LTO_CODEGEN_PIC_MODEL_DYNAMIC_NO_PIC:
- RelocModel = Reloc::DynamicNoPIC;
- break;
- case LTO_CODEGEN_PIC_MODEL_DEFAULT:
- // RelocModel is already the default, so leave it that way.
- break;
- }
-
// Construct LTOModule, hand over ownership of module and target. Use MAttr as
// the default set of features.
SubtargetFeatures Features(MAttr);
OpenPOWER on IntegriCloud