diff options
Diffstat (limited to 'contrib/llvm/lib/LTO/LTOModule.cpp')
-rw-r--r-- | contrib/llvm/lib/LTO/LTOModule.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/contrib/llvm/lib/LTO/LTOModule.cpp b/contrib/llvm/lib/LTO/LTOModule.cpp index 8b4a2f4..5cdbca6 100644 --- a/contrib/llvm/lib/LTO/LTOModule.cpp +++ b/contrib/llvm/lib/LTO/LTOModule.cpp @@ -179,7 +179,8 @@ static Module *parseBitcodeFileImpl(MemoryBufferRef Buffer, std::unique_ptr<MemoryBuffer> LightweightBuf = MemoryBuffer::getMemBuffer(*MBOrErr, false); ErrorOr<Module *> M = getLazyBitcodeModule(std::move(LightweightBuf), Context, - DiagnosticHandler); + DiagnosticHandler, + true/*ShouldLazyLoadMetadata*/); if (!M) return nullptr; return *M; @@ -229,7 +230,7 @@ LTOModule *LTOModule::makeLTOModule(MemoryBufferRef Buffer, TargetMachine *target = march->createTargetMachine(TripleStr, CPU, FeatureStr, options); - M->setDataLayout(target->getSubtargetImpl()->getDataLayout()); + M->setDataLayout(*target->getDataLayout()); std::unique_ptr<object::IRObjectFile> IRObj( new object::IRObjectFile(Buffer, std::move(M))); @@ -266,7 +267,7 @@ LTOModule::objcClassNameFromExpression(const Constant *c, std::string &name) { Constant *cn = gvn->getInitializer(); if (ConstantDataArray *ca = dyn_cast<ConstantDataArray>(cn)) { if (ca->isCString()) { - name = ".objc_class_name_" + ca->getAsCString().str(); + name = (".objc_class_name_" + ca->getAsCString()).str(); return true; } } @@ -649,10 +650,8 @@ void LTOModule::parseMetadata() { // here. StringRef Op = _linkeropt_strings.insert(MDOption->getString()).first->first(); - StringRef DepLibName = _target->getSubtargetImpl() - ->getTargetLowering() - ->getObjFileLowering() - .getDepLibFromLinkerOpt(Op); + StringRef DepLibName = + _target->getObjFileLowering()->getDepLibFromLinkerOpt(Op); if (!DepLibName.empty()) _deplibs.push_back(DepLibName.data()); else if (!Op.empty()) |