summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp')
-rw-r--r--llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
index 3aa52a0d5b8..092591aad98 100644
--- a/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
+++ b/llvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
@@ -152,8 +152,13 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) {
MC.reset(new MCContext(MAI.get(), MRI.get(), MOFI.get()));
MOFI->InitMCObjectFileInfo(TheTriple, /*PIC*/ false, *MC);
+ MSTI.reset(TheTarget->createMCSubtargetInfo(TripleName, "", ""));
+ if (!MSTI)
+ return make_error<StringError>("no subtarget info for target " + TripleName,
+ inconvertibleErrorCode());
+
MCTargetOptions MCOptions = InitMCTargetOptionsFromFlags();
- MAB = TheTarget->createMCAsmBackend(*MRI, TripleName, "", MCOptions);
+ MAB = TheTarget->createMCAsmBackend(*MSTI, *MRI, MCOptions);
if (!MAB)
return make_error<StringError>("no asm backend for target " + TripleName,
inconvertibleErrorCode());
@@ -164,11 +169,6 @@ llvm::Error dwarfgen::Generator::init(Triple TheTriple, uint16_t V) {
TripleName,
inconvertibleErrorCode());
- MSTI.reset(TheTarget->createMCSubtargetInfo(TripleName, "", ""));
- if (!MSTI)
- return make_error<StringError>("no subtarget info for target " + TripleName,
- inconvertibleErrorCode());
-
MCE = TheTarget->createMCCodeEmitter(*MII, *MRI, *MC);
if (!MCE)
return make_error<StringError>("no code emitter for target " + TripleName,
OpenPOWER on IntegriCloud