]> granicus.if.org Git - llvm/commitdiff
[llvm-exegesis] Fix r374158
authorClement Courbet <courbet@google.com>
Wed, 9 Oct 2019 12:37:56 +0000 (12:37 +0000)
committerClement Courbet <courbet@google.com>
Wed, 9 Oct 2019 12:37:56 +0000 (12:37 +0000)
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;

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374162 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-exegesis/lib/LlvmState.cpp
tools/llvm-exegesis/lib/LlvmState.h

index 2c9d63fdd76854119bf8de76dd7a161731dbabfb..5ca5de176fcdfbbd4a25a9c80a758592e76f4155 100644 (file)
@@ -27,10 +27,10 @@ LLVMState::LLVMState(const std::string &Triple, const std::string &CpuName,
   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 &CpuName)
 
 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;
 }
 
index ee6fbf3f4c5974f1b898f209529a3bcafac1bc25..e660a9f56b4c1f4f84c2b3603889351e1b4dbdad 100644 (file)
@@ -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;