ScopStmt: Provide a function to allow users look up the corresponding
authorHongbin Zheng <etherzhhb@gmail.com>
Wed, 25 Apr 2012 09:34:33 +0000 (09:34 +0000)
committerHongbin Zheng <etherzhhb@gmail.com>
Wed, 25 Apr 2012 09:34:33 +0000 (09:34 +0000)
  memory access of a particular instruction, the function will return
  null if no such memory access.

llvm-svn: 155544

polly/include/polly/ScopInfo.h

index 3d7ff72..4eb1ece 100755 (executable)
@@ -321,6 +321,12 @@ public:
     return *InstructionToAccess[Inst];
   }
 
+  MemoryAccess *lookupAccessFor(const Instruction *Inst) const {
+    std::map<const Instruction*, MemoryAccess*>::const_iterator at
+      = InstructionToAccess.find(Inst);
+    return at == InstructionToAccess.end() ? NULL : at->second;
+  }
+
   void setBasicBlock(BasicBlock *Block) { BB = Block; }
 
   typedef MemoryAccessVec::iterator memacc_iterator;