This is an archive of the discontinued LLVM Phabricator instance.

Move constructor for IntervalMap.
Needs ReviewPublic

Authored by sfuniak on Nov 4 2021, 9:21 PM.

Details

Reviewers
stoklund
Summary

IntervalMap has a user-defined destructor but no user-defined copy constructor. The (compiler-generated) implicitly-declared copy constructor is wrong, because it performs a trivial copy, which is problematic when the IntervalMap contains more than N intervals. This copy constructor is invoked in some places that assume that IntervalMap can be copied, or at least moved, e.g. when generating the MLIR PDL bytecode. The solution is to define a move constructor that will be used instead of the implicitly-declared copy constructor.

Diff Detail

Event Timeline

sfuniak created this revision.Nov 4 2021, 9:21 PM
sfuniak requested review of this revision.Nov 4 2021, 9:21 PM
sfuniak updated this revision to Diff 384955.Nov 4 2021, 9:22 PM

Ran clang-format.