[Polly][PATCH 1/8] [Refactor] Remove const keyword from access instruction

Johannes Doerfert doerfert at cs.uni-saarland.de
Sun Aug 10 00:50:22 PDT 2014


---
 include/polly/ScopInfo.h  | 8 +++++---
 lib/Analysis/ScopInfo.cpp | 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/include/polly/ScopInfo.h b/include/polly/ScopInfo.h
index 7372dc2..bf8ecef 100644
--- a/include/polly/ScopInfo.h
+++ b/include/polly/ScopInfo.h
@@ -136,7 +136,8 @@ private:
   /// could allow us to handle the above example.
   ReductionType RedType = RT_NONE;
 
-  const Instruction *Inst;
+  /// @brief The access instruction of this memory access.
+  Instruction *Inst;
 
   /// Updated access relation read from JSCOP file.
   isl_map *newAccessRelation;
@@ -149,7 +150,7 @@ public:
   /// @param Access     The memory access.
   /// @param Statement  The statement that contains the access.
   /// @param SE         The ScalarEvolution analysis.
-  MemoryAccess(const IRAccess &Access, const Instruction *AccInst,
+  MemoryAccess(const IRAccess &Access, Instruction *AccInst,
                ScopStmt *Statement);
 
   ~MemoryAccess();
@@ -194,7 +195,8 @@ public:
 
   const std::string &getBaseName() const { return BaseName; }
 
-  const Instruction *getAccessInstruction() const { return Inst; }
+  /// @brief Return the access instruction of this memory access.
+  Instruction *getAccessInstruction() const { return Inst; }
 
   /// @brief Get the new access function imported from JSCOP file
   isl_map *getNewAccessRelation() const;
diff --git a/lib/Analysis/ScopInfo.cpp b/lib/Analysis/ScopInfo.cpp
index 1382c1d..963aa80 100644
--- a/lib/Analysis/ScopInfo.cpp
+++ b/lib/Analysis/ScopInfo.cpp
@@ -414,7 +414,7 @@ void MemoryAccess::assumeNoOutOfBound(const IRAccess &Access) {
   isl_space_free(Space);
 }
 
-MemoryAccess::MemoryAccess(const IRAccess &Access, const Instruction *AccInst,
+MemoryAccess::MemoryAccess(const IRAccess &Access, Instruction *AccInst,
                            ScopStmt *Statement)
     : Statement(Statement), Inst(AccInst), newAccessRelation(nullptr) {
 
-- 
2.0.4




More information about the llvm-commits mailing list