From: Bing1 Yu Date: Wed, 31 May 2023 02:34:55 +0000 (+0800) Subject: [MC] Disable default copy ctor and copy assignment operator for CodeViewContext X-Git-Tag: upstream/17.0.6~6717 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5001e4f0daa19d41da8715e511acaa125cef0a4;p=platform%2Fupstream%2Fllvm.git [MC] Disable default copy ctor and copy assignment operator for CodeViewContext 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 --- diff --git a/llvm/include/llvm/MC/MCCodeView.h b/llvm/include/llvm/MC/MCCodeView.h index 3d15c40..3e997b1 100644 --- a/llvm/include/llvm/MC/MCCodeView.h +++ b/llvm/include/llvm/MC/MCCodeView.h @@ -146,6 +146,9 @@ public: 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 ChecksumBytes, uint8_t ChecksumKind);