aboutsummaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/TargetSelect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ExecutionEngine/TargetSelect.cpp')
-rw-r--r--lib/ExecutionEngine/TargetSelect.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/ExecutionEngine/TargetSelect.cpp b/lib/ExecutionEngine/TargetSelect.cpp
index 42364f9b70f7..7cdd669028b8 100644
--- a/lib/ExecutionEngine/TargetSelect.cpp
+++ b/lib/ExecutionEngine/TargetSelect.cpp
@@ -26,11 +26,7 @@
using namespace llvm;
TargetMachine *EngineBuilder::selectTarget() {
- StringRef MArch = "";
- StringRef MCPU = "";
- SmallVector<std::string, 1> MAttrs;
- Triple TT(M->getTargetTriple());
-
+ Triple TT(LLVM_HOSTTRIPLE);
return selectTarget(TT, MArch, MCPU, MAttrs);
}
@@ -56,8 +52,9 @@ TargetMachine *EngineBuilder::selectTarget(const Triple &TargetTriple,
}
if (!TheTarget) {
- *ErrorStr = "No available targets are compatible with this -march, "
- "see -version for the available targets.\n";
+ if (ErrorStr)
+ *ErrorStr = "No available targets are compatible with this -march, "
+ "see -version for the available targets.\n";
return 0;
}