Skip to content

Commit

Permalink
[CodeGen] Disable default copy ctor and copy assignment operator for …
Browse files Browse the repository at this point in the history
…class Array

class Array manages resources such as dynamically allocated memory, it's generally a good practice to either implement a custom copy constructor or disable the default one.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D152231
  • Loading branch information
yubingex007-a11y committed Jun 7, 2023
1 parent 9340596 commit 466678b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions llvm/include/llvm/CodeGen/LiveIntervalUnion.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ class LiveIntervalUnion {

public:
Array() = default;
Array &operator=(const Array &other) = delete;
Array(const Array &other) = delete;
~Array() { clear(); }

// Initialize the array to have Size entries.
Expand Down

0 comments on commit 466678b

Please sign in to comment.