X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FLTO%2FLTOModule.cpp;h=5083a59900a7dfb3d878571526a409c03821ab27;hb=f15492fd7292563049ace40be9a2e0048e64b8f0;hp=f4f3e630930199605d101e91b9e9d17b573b0da1;hpb=8fa6f94ebb85392a192ff4a621be919c33383e87;p=oota-llvm.git diff --git a/lib/LTO/LTOModule.cpp b/lib/LTO/LTOModule.cpp index f4f3e630930..5083a59900a 100644 --- a/lib/LTO/LTOModule.cpp +++ b/lib/LTO/LTOModule.cpp @@ -40,6 +40,7 @@ #include "llvm/Target/TargetLowering.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetRegisterInfo.h" +#include "llvm/Target/TargetSubtargetInfo.h" #include "llvm/Transforms/Utils/GlobalStatus.h" #include using namespace llvm; @@ -146,7 +147,7 @@ LTOModule *LTOModule::makeLTOModule(std::unique_ptr Buffer, TargetMachine *target = march->createTargetMachine(TripleStr, CPU, FeatureStr, options); M->materializeAllPermanently(true); - M->setDataLayout(target->getDataLayout()); + M->setDataLayout(target->getSubtargetImpl()->getDataLayout()); std::unique_ptr IRObj( new object::IRObjectFile(std::move(Buffer), std::move(M))); @@ -164,10 +165,11 @@ LTOModule *LTOModule::makeLTOModule(std::unique_ptr Buffer, } /// Create a MemoryBuffer from a memory range with an optional name. -MemoryBuffer *LTOModule::makeBuffer(const void *mem, size_t length, - StringRef name) { +std::unique_ptr +LTOModule::makeBuffer(const void *mem, size_t length, StringRef name) { const char *startPtr = (const char*)mem; - return MemoryBuffer::getMemBuffer(StringRef(startPtr, length), name, false); + return std::unique_ptr( + MemoryBuffer::getMemBuffer(StringRef(startPtr, length), name, false)); } /// objcClassNameFromExpression - Get string that the data pointer points to. @@ -574,8 +576,10 @@ void LTOModule::parseMetadata() { MDString *MDOption = cast(MDOptions->getOperand(ii)); StringRef Op = _linkeropt_strings. GetOrCreateValue(MDOption->getString()).getKey(); - StringRef DepLibName = _target->getTargetLowering()-> - getObjFileLowering().getDepLibFromLinkerOpt(Op); + StringRef DepLibName = _target->getSubtargetImpl() + ->getTargetLowering() + ->getObjFileLowering() + .getDepLibFromLinkerOpt(Op); if (!DepLibName.empty()) _deplibs.push_back(DepLibName.data()); else if (!Op.empty())