diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2018-06-13 14:07:36 +0000 |
---|---|---|
committer | Guillaume Chatelet <gchatelet@google.com> | 2018-06-13 14:07:36 +0000 |
commit | f246e3e960cf7dfe587400cdeea352284c73a9f5 (patch) | |
tree | b21eb05b904764806575feeb930bbf265bfc5886 /tools/llvm-exegesis | |
parent | c855277f2aee0d987ab56df5cee385660d83ae03 (diff) |
[llvm-exegesis] Fix buildbot - power was using native target for X86.
Reviewers: courbet
Reviewed By: courbet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D48125
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-exegesis')
-rw-r--r-- | tools/llvm-exegesis/lib/LlvmState.cpp | 9 | ||||
-rw-r--r-- | tools/llvm-exegesis/lib/LlvmState.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/tools/llvm-exegesis/lib/LlvmState.cpp b/tools/llvm-exegesis/lib/LlvmState.cpp index cb534f50998..e28685339e3 100644 --- a/tools/llvm-exegesis/lib/LlvmState.cpp +++ b/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; diff --git a/tools/llvm-exegesis/lib/LlvmState.h b/tools/llvm-exegesis/lib/LlvmState.h index 6bde4f681c1..3c8a4a0a126 100644 --- a/tools/llvm-exegesis/lib/LlvmState.h +++ b/tools/llvm-exegesis/lib/LlvmState.h @@ -32,6 +32,9 @@ class LLVMState { public: LLVMState(); + LLVMState(const std::string &Triple, + const std::string &CpuName); // For tests. + llvm::StringRef getTriple() const { return TheTriple; } llvm::StringRef getCpuName() const { return CpuName; } llvm::StringRef getFeatures() const { return Features; } |