[llvm] r374162 - [llvm-exegesis] Fix r374158
Clement Courbet via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 05:37:56 PDT 2019
Author: courbet
Date: Wed Oct 9 05:37:56 2019
New Revision: 374162
URL: http://llvm.org/viewvc/llvm-project?rev=374162&view=rev
Log:
[llvm-exegesis] Fix r374158
Some bots complain about missing 'class':
LlvmState.h:70:40: error: declaration of ‘std::unique_ptr<const llvm::TargetMachine> llvm::exegesis::LLVMState::TargetMachine’ [-fpermissive]
std::unique_ptr<const TargetMachine> TargetMachine;
Modified:
llvm/trunk/tools/llvm-exegesis/lib/LlvmState.cpp
llvm/trunk/tools/llvm-exegesis/lib/LlvmState.h
Modified: llvm/trunk/tools/llvm-exegesis/lib/LlvmState.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/LlvmState.cpp?rev=374162&r1=374161&r2=374162&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/LlvmState.cpp (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/LlvmState.cpp Wed Oct 9 05:37:56 2019
@@ -27,10 +27,10 @@ LLVMState::LLVMState(const std::string &
const Target *const TheTarget = TargetRegistry::lookupTarget(Triple, Error);
assert(TheTarget && "unknown target for host");
const TargetOptions Options;
- TargetMachine.reset(
+ TheTargetMachine.reset(
static_cast<LLVMTargetMachine *>(TheTarget->createTargetMachine(
Triple, CpuName, Features, Options, Reloc::Model::Static)));
- TheExegesisTarget = ExegesisTarget::lookup(TargetMachine->getTargetTriple());
+ TheExegesisTarget = ExegesisTarget::lookup(TheTargetMachine->getTargetTriple());
if (!TheExegesisTarget) {
errs() << "no exegesis target for " << Triple << ", using default\n";
TheExegesisTarget = &ExegesisTarget::getDefault();
@@ -51,26 +51,26 @@ LLVMState::LLVMState(const std::string &
std::unique_ptr<LLVMTargetMachine> LLVMState::createTargetMachine() const {
return std::unique_ptr<LLVMTargetMachine>(static_cast<LLVMTargetMachine *>(
- TargetMachine->getTarget().createTargetMachine(
- TargetMachine->getTargetTriple().normalize(),
- TargetMachine->getTargetCPU(),
- TargetMachine->getTargetFeatureString(), TargetMachine->Options,
+ TheTargetMachine->getTarget().createTargetMachine(
+ TheTargetMachine->getTargetTriple().normalize(),
+ TheTargetMachine->getTargetCPU(),
+ TheTargetMachine->getTargetFeatureString(), TheTargetMachine->Options,
Reloc::Model::Static)));
}
bool LLVMState::canAssemble(const MCInst &Inst) const {
MCObjectFileInfo ObjectFileInfo;
- MCContext Context(TargetMachine->getMCAsmInfo(),
- TargetMachine->getMCRegisterInfo(), &ObjectFileInfo);
+ MCContext Context(TheTargetMachine->getMCAsmInfo(),
+ TheTargetMachine->getMCRegisterInfo(), &ObjectFileInfo);
std::unique_ptr<const MCCodeEmitter> CodeEmitter(
- TargetMachine->getTarget().createMCCodeEmitter(
- *TargetMachine->getMCInstrInfo(), *TargetMachine->getMCRegisterInfo(),
+ TheTargetMachine->getTarget().createMCCodeEmitter(
+ *TheTargetMachine->getMCInstrInfo(), *TheTargetMachine->getMCRegisterInfo(),
Context));
SmallVector<char, 16> Tmp;
raw_svector_ostream OS(Tmp);
SmallVector<MCFixup, 4> Fixups;
CodeEmitter->encodeInstruction(Inst, OS, Fixups,
- *TargetMachine->getMCSubtargetInfo());
+ *TheTargetMachine->getMCSubtargetInfo());
return Tmp.size() > 0;
}
Modified: llvm/trunk/tools/llvm-exegesis/lib/LlvmState.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/LlvmState.h?rev=374162&r1=374161&r2=374162&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/LlvmState.h (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/LlvmState.h Wed Oct 9 05:37:56 2019
@@ -42,7 +42,7 @@ public:
const std::string &CpuName,
const std::string &Features = ""); // For tests.
- const TargetMachine &getTargetMachine() const { return *TargetMachine; }
+ const TargetMachine &getTargetMachine() const { return *TheTargetMachine; }
std::unique_ptr<LLVMTargetMachine> createTargetMachine() const;
const ExegesisTarget &getExegesisTarget() const { return *TheExegesisTarget; }
@@ -51,13 +51,13 @@ public:
// For convenience:
const MCInstrInfo &getInstrInfo() const {
- return *TargetMachine->getMCInstrInfo();
+ return *TheTargetMachine->getMCInstrInfo();
}
const MCRegisterInfo &getRegInfo() const {
- return *TargetMachine->getMCRegisterInfo();
+ return *TheTargetMachine->getMCRegisterInfo();
}
const MCSubtargetInfo &getSubtargetInfo() const {
- return *TargetMachine->getMCSubtargetInfo();
+ return *TheTargetMachine->getMCSubtargetInfo();
}
const RegisterAliasingTrackerCache &getRATC() const { return *RATC; }
@@ -67,7 +67,7 @@ public:
private:
const ExegesisTarget *TheExegesisTarget;
- std::unique_ptr<const TargetMachine> TargetMachine;
+ std::unique_ptr<const TargetMachine> TheTargetMachine;
std::unique_ptr<const RegisterAliasingTrackerCache> RATC;
std::unique_ptr<const InstructionsCache> IC;
const PfmCountersInfo *PfmCounters;
More information about the llvm-commits
mailing list