[PatternRewriter] Disable copy/assign operators.

We had a [bad bug](69655864ee) over in CIRCT
caused by accidentally passing around PatternRewriter
by value.  There is no reason to support copy/assignment
of the pattern rewriter, so disable it.

Differential Revision: https://reviews.llvm.org/D107232
This commit is contained in:
Chris Lattner 2021-07-31 15:11:44 -07:00
parent 1e801439be
commit 07548b8324
1 changed files with 3 additions and 0 deletions

View File

@ -836,6 +836,9 @@ protected:
}
private:
void operator=(const RewriterBase &) = delete;
RewriterBase(const RewriterBase &) = delete;
/// 'op' and 'newOp' are known to have the same number of results, replace the
/// uses of op with uses of newOp.
void replaceOpWithResultsOfAnotherOp(Operation *op, Operation *newOp);