Fix variable names and comment style. NFC.
[oota-llvm.git] / include / llvm / MC / MCInstrAnalysis.h
index 464768313b93adf6bb245b2014e79a54bccc738b..e921f768ac45ff1500593ed828a32499ed8a55d0 100644 (file)
@@ -12,6 +12,9 @@
 //
 //===----------------------------------------------------------------------===//
 
+#ifndef LLVM_MC_MCINSTRANALYSIS_H
+#define LLVM_MC_MCINSTRANALYSIS_H
+
 #include "llvm/MC/MCInst.h"
 #include "llvm/MC/MCInstrDesc.h"
 #include "llvm/MC/MCInstrInfo.h"
@@ -23,8 +26,9 @@ protected:
   friend class Target;
   const MCInstrInfo *Info;
 
-  MCInstrAnalysis(const MCInstrInfo *Info) : Info(Info) {}
 public:
+  MCInstrAnalysis(const MCInstrInfo *Info) : Info(Info) {}
+
   virtual ~MCInstrAnalysis() {}
 
   virtual bool isBranch(const MCInst &Inst) const {
@@ -32,7 +36,7 @@ public:
   }
 
   virtual bool isConditionalBranch(const MCInst &Inst) const {
-    return Info->get(Inst.getOpcode()).isBranch();
+    return Info->get(Inst.getOpcode()).isConditionalBranch();
   }
 
   virtual bool isUnconditionalBranch(const MCInst &Inst) const {
@@ -51,10 +55,17 @@ public:
     return Info->get(Inst.getOpcode()).isReturn();
   }
 
+  virtual bool isTerminator(const MCInst &Inst) const {
+    return Info->get(Inst.getOpcode()).isTerminator();
+  }
+
   /// evaluateBranch - Given a branch instruction try to get the address the
-  /// branch targets. Otherwise return -1.
-  virtual uint64_t
-  evaluateBranch(const MCInst &Inst, uint64_t Addr, uint64_t Size) const;
+  /// branch targets. Return true on success, and the address in Target.
+  virtual bool
+  evaluateBranch(const MCInst &Inst, uint64_t Addr, uint64_t Size,
+                 uint64_t &Target) const;
 };
 
-}
+} // End llvm namespace
+
+#endif