summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-exegesis/lib/LlvmState.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/LlvmState.cpp')
-rw-r--r--llvm/tools/llvm-exegesis/lib/LlvmState.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/LlvmState.cpp b/llvm/tools/llvm-exegesis/lib/LlvmState.cpp
index 9b30d78b0c9..9ff42ca71fd 100644
--- a/llvm/tools/llvm-exegesis/lib/LlvmState.cpp
+++ b/llvm/tools/llvm-exegesis/lib/LlvmState.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include "LlvmState.h"
+#include "Target.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/MC/MCCodeEmitter.h"
#include "llvm/MC/MCContext.h"
@@ -30,6 +31,10 @@ LLVMState::LLVMState(const std::string &Triple, const std::string &CpuName) {
TheTarget->createTargetMachine(Triple, CpuName, /*Features*/ "", Options,
llvm::Reloc::Model::Static)));
TheExegesisTarget = ExegesisTarget::lookup(TargetMachine->getTargetTriple());
+ if (!TheExegesisTarget) {
+ llvm::errs() << "no exegesis target for " << Triple << ", using default\n";
+ TheExegesisTarget = &ExegesisTarget::getDefault();
+ }
}
LLVMState::LLVMState()
OpenPOWER on IntegriCloud