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.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/LlvmState.cpp b/llvm/tools/llvm-exegesis/lib/LlvmState.cpp
index cb534f50998..e28685339e3 100644
--- a/llvm/tools/llvm-exegesis/lib/LlvmState.cpp
+++ b/llvm/tools/llvm-exegesis/lib/LlvmState.cpp
@@ -20,9 +20,8 @@
namespace exegesis {
-LLVMState::LLVMState()
- : TheTriple(llvm::sys::getProcessTriple()),
- CpuName(llvm::sys::getHostCPUName().str()) {
+LLVMState::LLVMState(const std::string &Triple, const std::string &CpuName)
+ : TheTriple(Triple), CpuName(CpuName) {
std::string Error;
TheTarget = llvm::TargetRegistry::lookupTarget(TheTriple, Error);
assert(TheTarget && "unknown target for host");
@@ -33,6 +32,10 @@ LLVMState::LLVMState()
AsmInfo.reset(TheTarget->createMCAsmInfo(*RegInfo, TheTriple));
}
+LLVMState::LLVMState()
+ : LLVMState(llvm::sys::getProcessTriple(),
+ llvm::sys::getHostCPUName().str()) {}
+
std::unique_ptr<llvm::LLVMTargetMachine>
LLVMState::createTargetMachine() const {
const llvm::TargetOptions Options;
OpenPOWER on IntegriCloud