summaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
index ff48a938cbd4..afe3b671547d 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldChecker.cpp
@@ -756,59 +756,56 @@ private:
Expected<TargetInfo> getTargetInfo(const Triple &TT, const StringRef &CPU,
const SubtargetFeatures &TF) const {
-
- auto TripleName = TT.str();
std::string ErrorStr;
- const Target *TheTarget =
- TargetRegistry::lookupTarget(TripleName, ErrorStr);
+ const Target *TheTarget = TargetRegistry::lookupTarget(TT, ErrorStr);
if (!TheTarget)
- return make_error<StringError>("Error accessing target '" + TripleName +
+ return make_error<StringError>("Error accessing target '" + TT.str() +
"': " + ErrorStr,
inconvertibleErrorCode());
std::unique_ptr<MCSubtargetInfo> STI(
- TheTarget->createMCSubtargetInfo(TripleName, CPU, TF.getString()));
+ TheTarget->createMCSubtargetInfo(TT, CPU, TF.getString()));
if (!STI)
return make_error<StringError>("Unable to create subtarget for " +
- TripleName,
+ TT.str(),
inconvertibleErrorCode());
- std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TripleName));
+ std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TT));
if (!MRI)
return make_error<StringError>("Unable to create target register info "
"for " +
- TripleName,
+ TT.str(),
inconvertibleErrorCode());
MCTargetOptions MCOptions;
std::unique_ptr<MCAsmInfo> MAI(
- TheTarget->createMCAsmInfo(*MRI, TripleName, MCOptions));
+ TheTarget->createMCAsmInfo(*MRI, TT, MCOptions));
if (!MAI)
return make_error<StringError>("Unable to create target asm info " +
- TripleName,
+ TT.str(),
inconvertibleErrorCode());
- auto Ctx = std::make_unique<MCContext>(Triple(TripleName), MAI.get(),
+ auto Ctx = std::make_unique<MCContext>(Triple(TT.str()), MAI.get(),
MRI.get(), STI.get());
std::unique_ptr<MCDisassembler> Disassembler(
TheTarget->createMCDisassembler(*STI, *Ctx));
if (!Disassembler)
return make_error<StringError>("Unable to create disassembler for " +
- TripleName,
+ TT.str(),
inconvertibleErrorCode());
std::unique_ptr<MCInstrInfo> MII(TheTarget->createMCInstrInfo());
if (!MII)
return make_error<StringError>("Unable to create instruction info for" +
- TripleName,
+ TT.str(),
inconvertibleErrorCode());
- std::unique_ptr<MCInstPrinter> InstPrinter(TheTarget->createMCInstPrinter(
- Triple(TripleName), 0, *MAI, *MII, *MRI));
+ std::unique_ptr<MCInstPrinter> InstPrinter(
+ TheTarget->createMCInstPrinter(TT, 0, *MAI, *MII, *MRI));
if (!InstPrinter)
return make_error<StringError>(
- "Unable to create instruction printer for" + TripleName,
+ "Unable to create instruction printer for" + TT.str(),
inconvertibleErrorCode());
return TargetInfo({TheTarget, std::move(STI), std::move(MRI),