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

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 08:33:41 PST 2016

Meinersbur added a comment.

I created these for the following reason:

As a general rule for 'pass-by-value' types, for every implicit copy-constructor, there should also also an operator=() for it. Otherwise, this works:

  StoreInst *SI = [...]
  MemAccInst x = SI;

but not this:

  StoreInst *SI = [...]
  MemAccInst x;
  x = SI;

If assigning a nullptr to a MemAccInst is confusing, then assigning nullptr to a StoreInst* (which it mimics) must be equally confusing.

The only reason I can think of to remove these is that we currently do not assign to a MemAccInst variable.

Comment at: include/polly/Support/ScopHelper.h:68
@@ -67,3 +67,3 @@
-  llvm::Instruction *I;
+  llvm::Instruction *const I;
The constness of the Instruction pointed to should be determined by the user of MemAccInst by declaring it const, e.g. `const MemAccInst`.



More information about the llvm-commits mailing list