[PATCH] D48125: [llvm-exegesis] Fix buildbot - power was using native target for X86.
Guillaume Chatelet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 13 07:12:10 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL334601: [llvm-exegesis] Fix buildbot - power was using native target for X86. (authored by gchatelet, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D48125
Files:
llvm/trunk/tools/llvm-exegesis/lib/LlvmState.cpp
llvm/trunk/tools/llvm-exegesis/lib/LlvmState.h
llvm/trunk/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
Index: llvm/trunk/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
===================================================================
--- llvm/trunk/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
+++ llvm/trunk/unittests/tools/llvm-exegesis/X86/SnippetGeneratorTest.cpp
@@ -23,7 +23,8 @@
class X86SnippetGeneratorTest : public ::testing::Test {
protected:
X86SnippetGeneratorTest()
- : MCInstrInfo(State.getInstrInfo()), MCRegisterInfo(State.getRegInfo()) {}
+ : State("x86_64-unknown-linux", "haswell"),
+ MCInstrInfo(State.getInstrInfo()), MCRegisterInfo(State.getRegInfo()) {}
static void SetUpTestCase() {
LLVMInitializeX86TargetInfo();
Index: llvm/trunk/tools/llvm-exegesis/lib/LlvmState.h
===================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/LlvmState.h
+++ llvm/trunk/tools/llvm-exegesis/lib/LlvmState.h
@@ -32,6 +32,9 @@
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; }
Index: llvm/trunk/tools/llvm-exegesis/lib/LlvmState.cpp
===================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/LlvmState.cpp
+++ llvm/trunk/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 @@
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48125.151157.patch
Type: text/x-patch
Size: 2245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180613/0ba25c38/attachment.bin>
More information about the llvm-commits
mailing list