diff --git a/include/llvm/LTO/LTOCodeGenerator.h b/include/llvm/LTO/LTOCodeGenerator.h index bef6e9c6a72..b19b2325f73 100644 --- a/include/llvm/LTO/LTOCodeGenerator.h +++ b/include/llvm/LTO/LTOCodeGenerator.h @@ -135,7 +135,7 @@ private: typedef StringMap StringSet; LLVMContext &Context; - Linker Linker; + Linker IRLinker; TargetMachine *TargetMach; bool EmitDwarfDebugInfo; bool ScopeRestrictionsDone; diff --git a/lib/LTO/LTOCodeGenerator.cpp b/lib/LTO/LTOCodeGenerator.cpp index 105fb6900db..1dd0721493d 100644 --- a/lib/LTO/LTOCodeGenerator.cpp +++ b/lib/LTO/LTOCodeGenerator.cpp @@ -63,7 +63,7 @@ const char* LTOCodeGenerator::getVersionString() { } LTOCodeGenerator::LTOCodeGenerator() - : Context(getGlobalContext()), Linker(new Module("ld-temp.o", Context)), + : Context(getGlobalContext()), IRLinker(new Module("ld-temp.o", Context)), TargetMach(nullptr), EmitDwarfDebugInfo(false), ScopeRestrictionsDone(false), CodeModel(LTO_CODEGEN_PIC_MODEL_DEFAULT), NativeObjectFile(nullptr), DiagHandler(nullptr), DiagContext(nullptr) { @@ -76,7 +76,7 @@ LTOCodeGenerator::~LTOCodeGenerator() { TargetMach = nullptr; NativeObjectFile = nullptr; - Linker.deleteModule(); + IRLinker.deleteModule(); for (std::vector::iterator I = CodegenOptions.begin(), E = CodegenOptions.end(); @@ -114,7 +114,7 @@ void LTOCodeGenerator::initializeLTOPasses() { } bool LTOCodeGenerator::addModule(LTOModule* mod, std::string& errMsg) { - bool ret = Linker.linkInModule(mod->getLLVVMModule(), &errMsg); + bool ret = IRLinker.linkInModule(mod->getLLVVMModule(), &errMsg); const std::vector &undefs = mod->getAsmUndefinedRefs(); for (int i = 0, e = undefs.size(); i != e; ++i) @@ -186,7 +186,7 @@ bool LTOCodeGenerator::writeMergedModules(const char *path, } // write bitcode to it - WriteBitcodeToFile(Linker.getModule(), Out.os()); + WriteBitcodeToFile(IRLinker.getModule(), Out.os()); Out.os().close(); if (Out.os().has_error()) { @@ -273,7 +273,7 @@ bool LTOCodeGenerator::determineTarget(std::string &errMsg) { if (TargetMach) return true; - std::string TripleStr = Linker.getModule()->getTargetTriple(); + std::string TripleStr = IRLinker.getModule()->getTargetTriple(); if (TripleStr.empty()) TripleStr = sys::getDefaultTargetTriple(); llvm::Triple Triple(TripleStr); @@ -395,7 +395,7 @@ static void accumulateAndSortLibcalls(std::vector &Libcalls, void LTOCodeGenerator::applyScopeRestrictions() { if (ScopeRestrictionsDone) return; - Module *mergedModule = Linker.getModule(); + Module *mergedModule = IRLinker.getModule(); // Start off with a verification pass. PassManager passes; @@ -463,7 +463,7 @@ bool LTOCodeGenerator::generateObjectFile(raw_ostream &out, if (!this->determineTarget(errMsg)) return false; - Module *mergedModule = Linker.getModule(); + Module *mergedModule = IRLinker.getModule(); // Mark which symbols can not be internalized this->applyScopeRestrictions();