s/getSrc()/getSrcData()/g s/getDst()/getDstData()/g
authorBenjamin Segovia <segovia.benjamin@gmail.com>
Fri, 13 Apr 2012 10:07:00 +0000 (10:07 +0000)
committerKeith Packard <keithp@keithp.com>
Fri, 10 Aug 2012 23:16:20 +0000 (16:16 -0700)
backend/src/ir/instruction.cpp
backend/src/ir/instruction.hpp

index 16432c3..9739c6e 100644 (file)
@@ -738,10 +738,14 @@ namespace ir {
     enum { value = 1 };
   };
 
-  RegisterData Instruction::getDst(const Function &fn, uint32_t ID) const {
+  RegisterData Instruction::getDstData(uint32_t ID) const {
+    GBE_ASSERT(this->getParent() != NULL);
+    const Function &fn = this->getParent()->getParent();
     return fn.getRegisterData(this->getDstIndex(ID));
   }
-  RegisterData Instruction::getSrc(const Function &fn, uint32_t ID) const {
+  RegisterData Instruction::getSrcData(uint32_t ID) const {
+    GBE_ASSERT(this->getParent() != NULL);
+    const Function &fn = this->getParent()->getParent();
     return fn.getRegisterData(this->getSrcIndex(ID));
   }
 
index da7068f..70130e5 100644 (file)
@@ -92,9 +92,9 @@ namespace ir {
     /*! Get the register index of the given destination */
     Register getDstIndex(uint32_t ID = 0u) const;
     /*! Get the register of the given source */
-    RegisterData getDst(const Function &fn, uint32_t ID = 0u) const;
+    RegisterData getDstData(uint32_t ID = 0u) const;
     /*! Get the register of the given destination */
-    RegisterData getSrc(const Function &fn, uint32_t ID = 0u) const;
+    RegisterData getSrcData(uint32_t ID = 0u) const;
     /*! Get / set the previous instruction in the stream */
     Instruction *getPredecessor(void) { return predecessor; }
     const Instruction *getPredecessor(void) const { return predecessor; }
@@ -251,12 +251,12 @@ namespace ir {
     /*! Indicate if the branch is predicated */
     bool isPredicated(void) const;
     /*! Return the predicate register (if predicated) */
-    RegisterData getPredicate(const Function &fn) const {
+    RegisterData getPredicate(void) const {
       GBE_ASSERTM(this->isPredicated() == true, "Branch is not predicated");
-      return this->getSrc(fn, 0);
+      return this->getSrcData(0);
     }
     /*! Return the predicate register index (if predicated) */
-    Register getPredicateIndex(const Function &fn) const {
+    Register getPredicateIndex(void) const {
       GBE_ASSERTM(this->isPredicated() == true, "Branch is not predicated");
       return this->getSrcIndex(0);
     }