[PATCH] D17641: [Polly] [MemAccInst] Delete all the assignment operators, as they are not need.

Hongbin Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 03:09:05 PST 2016


etherzhhb created this revision.
etherzhhb added a reviewer: Meinersbur.
etherzhhb added a subscriber: Polly.
etherzhhb set the repository for this revision to rL LLVM.
etherzhhb added a project: Polly.

Allow changing the underlying instruction, especially changing the MemAccInst from non-null to null is very confusing and error-prone. But the good news, we never did that. So remove these unused operator to send a clear message that: Changing the underlying instruction is not encouraged.


Repository:
  rL LLVM

http://reviews.llvm.org/D17641

Files:
  include/polly/Support/ScopHelper.h

Index: include/polly/Support/ScopHelper.h
===================================================================
--- include/polly/Support/ScopHelper.h
+++ include/polly/Support/ScopHelper.h
@@ -65,7 +65,7 @@
 /// behaviour)
 class MemAccInst {
 private:
-  llvm::Instruction *I;
+  llvm::Instruction *const I;
 
 public:
   MemAccInst() : I(nullptr) {}
@@ -113,43 +113,6 @@
     return MemAccInst();
   }
 
-  MemAccInst &operator=(const MemAccInst &Inst) {
-    I = Inst.I;
-    return *this;
-  }
-  MemAccInst &operator=(llvm::LoadInst &LI) {
-    I = &LI;
-    return *this;
-  }
-  MemAccInst &operator=(llvm::LoadInst *LI) {
-    I = LI;
-    return *this;
-  }
-  MemAccInst &operator=(llvm::StoreInst &SI) {
-    I = &SI;
-    return *this;
-  }
-  MemAccInst &operator=(llvm::StoreInst *SI) {
-    I = SI;
-    return *this;
-  }
-  MemAccInst &operator=(llvm::MemIntrinsic &MI) {
-    I = &MI;
-    return *this;
-  }
-  MemAccInst &operator=(llvm::MemIntrinsic *MI) {
-    I = MI;
-    return *this;
-  }
-  MemAccInst &operator=(llvm::CallInst &CI) {
-    I = &CI;
-    return *this;
-  }
-  MemAccInst &operator=(llvm::CallInst *CI) {
-    I = CI;
-    return *this;
-  }
-
   llvm::Instruction *get() const {
     assert(I && "Unexpected nullptr!");
     return I;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17641.49170.patch
Type: text/x-patch
Size: 1277 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160226/d5ac6c9f/attachment.bin>


More information about the llvm-commits mailing list