summaryrefslogtreecommitdiff
path: root/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-01-06 21:34:26 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-01-06 21:34:26 +0000
commitd215fd3b74b90f5dc1964610926fcc2a20f959aa (patch)
tree0c9f21e40eae033d6760008729f37d2103e2c654 /unittests/DebugInfo/DWARF/DwarfGenerator.cpp
parentb8a2042aa938069e862750553db0e4d82d25822c (diff)
Diffstat (limited to 'unittests/DebugInfo/DWARF/DwarfGenerator.cpp')
-rw-r--r--unittests/DebugInfo/DWARF/DwarfGenerator.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/unittests/DebugInfo/DWARF/DwarfGenerator.cpp b/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
index 3aa52a0d5b8f0..092591aad985e 100644
--- a/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
+++ b/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,