summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Object/IRObjectFile.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2015-06-16 12:18:07 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2015-06-16 12:18:07 +0000
commit8d8b13dc19d5f031a04ba1393be70e7be37dd561 (patch)
tree444dd2301f6ea931e073c689b701bfc864e9464a /llvm/lib/Object/IRObjectFile.cpp
parent674825c6a0265c30f1d550128d44628d61150d25 (diff)
downloadbcm5719-llvm-8d8b13dc19d5f031a04ba1393be70e7be37dd561.tar.gz
bcm5719-llvm-8d8b13dc19d5f031a04ba1393be70e7be37dd561.zip
Recommit r239721: Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.
Summary: This affects other tools so the previous C++ API has been retained as a deprecated function for the moment. Clang has been updated with a trivial patch (not covered by the pre-commit review) to avoid breaking -Werror builds. Other in-tree tools will be fixed with similar patches. This continues the patch series to eliminate StringRef forms of GNU triples from the internals of LLVM that began in r239036. The first time this was committed it accidentally fixed an inconsistency in triples in llvm-mc and this caused a failure. This inconsistency was fixed in r239808. Reviewers: rengolin Reviewed By: rengolin Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10366 llvm-svn: 239812
Diffstat (limited to 'llvm/lib/Object/IRObjectFile.cpp')
-rw-r--r--llvm/lib/Object/IRObjectFile.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Object/IRObjectFile.cpp b/llvm/lib/Object/IRObjectFile.cpp
index b3d5db85ed5..36eb88cd115 100644
--- a/llvm/lib/Object/IRObjectFile.cpp
+++ b/llvm/lib/Object/IRObjectFile.cpp
@@ -45,22 +45,22 @@ IRObjectFile::IRObjectFile(MemoryBufferRef Object, std::unique_ptr<Module> Mod)
if (InlineAsm.empty())
return;
- StringRef Triple = M->getTargetTriple();
+ Triple TT(M->getTargetTriple());
std::string Err;
- const Target *T = TargetRegistry::lookupTarget(Triple, Err);
+ const Target *T = TargetRegistry::lookupTarget(TT.str(), Err);
if (!T)
return;
- std::unique_ptr<MCRegisterInfo> MRI(T->createMCRegInfo(Triple));
+ std::unique_ptr<MCRegisterInfo> MRI(T->createMCRegInfo(TT.str()));
if (!MRI)
return;
- std::unique_ptr<MCAsmInfo> MAI(T->createMCAsmInfo(*MRI, Triple));
+ std::unique_ptr<MCAsmInfo> MAI(T->createMCAsmInfo(*MRI, TT.str()));
if (!MAI)
return;
std::unique_ptr<MCSubtargetInfo> STI(
- T->createMCSubtargetInfo(Triple, "", ""));
+ T->createMCSubtargetInfo(TT.str(), "", ""));
if (!STI)
return;
@@ -70,7 +70,7 @@ IRObjectFile::IRObjectFile(MemoryBufferRef Object, std::unique_ptr<Module> Mod)
MCObjectFileInfo MOFI;
MCContext MCCtx(MAI.get(), MRI.get(), &MOFI);
- MOFI.InitMCObjectFileInfo(Triple, Reloc::Default, CodeModel::Default, MCCtx);
+ MOFI.InitMCObjectFileInfo(TT, Reloc::Default, CodeModel::Default, MCCtx);
std::unique_ptr<RecordStreamer> Streamer(new RecordStreamer(MCCtx));
T->createNullTargetStreamer(*Streamer);
OpenPOWER on IntegriCloud