Skip to content

Commit

Permalink
[MC] Disable default copy ctor and copy assignment operator for CodeV…
Browse files Browse the repository at this point in the history
…iewContext

class CodeViewContext 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: skan

Differential Revision: https://reviews.llvm.org/D151695
  • Loading branch information
yubingex007-a11y committed May 31, 2023
1 parent 7e99d31 commit d5001e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions llvm/include/llvm/MC/MCCodeView.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ class CodeViewContext {
CodeViewContext();
~CodeViewContext();

CodeViewContext &operator=(const CodeViewContext &other) = delete;
CodeViewContext(const CodeViewContext &other) = delete;

bool isValidFileNumber(unsigned FileNumber) const;
bool addFile(MCStreamer &OS, unsigned FileNumber, StringRef Filename,
ArrayRef<uint8_t> ChecksumBytes, uint8_t ChecksumKind);
Expand Down

0 comments on commit d5001e4

Please sign in to comment.