From 9f9ce61972871efcf794bdc6125835c2c32cd863 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Mon, 17 Sep 2012 07:16:40 +0000 Subject: [PATCH] Mark unimplemented copy constructors and copy assignment operators as LLVM_DELETED_FUNCTION. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164017 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/BasicBlock.h | 4 ++-- include/llvm/Bitcode/BitstreamReader.h | 6 +++--- include/llvm/Constant.h | 4 ++-- include/llvm/DIBuilder.h | 4 ++-- include/llvm/Function.h | 6 +++--- include/llvm/GlobalAlias.h | 4 ++-- include/llvm/GlobalValue.h | 2 +- include/llvm/InlineAsm.h | 4 ++-- include/llvm/IntrinsicInst.h | 6 +++--- include/llvm/LLVMContext.h | 7 ++++--- include/llvm/Metadata.h | 8 ++++---- include/llvm/Object/Binary.h | 4 ++-- include/llvm/Object/ObjectFile.h | 4 ++-- include/llvm/Pass.h | 5 +++-- include/llvm/PassSupport.h | 4 ++-- include/llvm/Transforms/Utils/SSAUpdater.h | 4 ++-- 16 files changed, 39 insertions(+), 37 deletions(-) diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h index d2aa1673d92..9ab4a74e5a5 100644 --- a/include/llvm/BasicBlock.h +++ b/include/llvm/BasicBlock.h @@ -79,8 +79,8 @@ private: void setParent(Function *parent); friend class SymbolTableListTraits; - BasicBlock(const BasicBlock &); // Do not implement - void operator=(const BasicBlock &); // Do not implement + BasicBlock(const BasicBlock &) LLVM_DELETED_FUNCTION; + void operator=(const BasicBlock &) LLVM_DELETED_FUNCTION; /// BasicBlock ctor - If the function parameter is specified, the basic block /// is automatically inserted at either the end of the function (if diff --git a/include/llvm/Bitcode/BitstreamReader.h b/include/llvm/Bitcode/BitstreamReader.h index 65868294403..3daef789d61 100644 --- a/include/llvm/Bitcode/BitstreamReader.h +++ b/include/llvm/Bitcode/BitstreamReader.h @@ -47,9 +47,9 @@ private: /// block/record name information in the BlockInfo block. Only llvm-bcanalyzer /// uses this. bool IgnoreBlockInfoNames; - - BitstreamReader(const BitstreamReader&); // DO NOT IMPLEMENT - void operator=(const BitstreamReader&); // DO NOT IMPLEMENT + + BitstreamReader(const BitstreamReader&) LLVM_DELETED_FUNCTION; + void operator=(const BitstreamReader&) LLVM_DELETED_FUNCTION; public: BitstreamReader() : IgnoreBlockInfoNames(true) { } diff --git a/include/llvm/Constant.h b/include/llvm/Constant.h index e0e516d55c9..7464dce3303 100644 --- a/include/llvm/Constant.h +++ b/include/llvm/Constant.h @@ -39,8 +39,8 @@ namespace llvm { /// don't have to worry about the lifetime of the objects. /// @brief LLVM Constant Representation class Constant : public User { - void operator=(const Constant &); // Do not implement - Constant(const Constant &); // Do not implement + void operator=(const Constant &) LLVM_DELETED_FUNCTION; + Constant(const Constant &) LLVM_DELETED_FUNCTION; virtual void anchor(); protected: diff --git a/include/llvm/DIBuilder.h b/include/llvm/DIBuilder.h index 2610ce104ff..80880094d22 100644 --- a/include/llvm/DIBuilder.h +++ b/include/llvm/DIBuilder.h @@ -63,8 +63,8 @@ namespace llvm { SmallVector AllSubprograms; SmallVector AllGVs; - DIBuilder(const DIBuilder &); // DO NOT IMPLEMENT - void operator=(const DIBuilder &); // DO NOT IMPLEMENT + DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION; + void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION; public: explicit DIBuilder(Module &M); diff --git a/include/llvm/Function.h b/include/llvm/Function.h index fdd90d1d8fa..fbd2594a452 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -109,9 +109,9 @@ private: BuildLazyArguments(); } void BuildLazyArguments() const; - - Function(const Function&); // DO NOT IMPLEMENT - void operator=(const Function&); // DO NOT IMPLEMENT + + Function(const Function&) LLVM_DELETED_FUNCTION; + void operator=(const Function&) LLVM_DELETED_FUNCTION; /// Function ctor - If the (optional) Module argument is specified, the /// function is automatically inserted into the end of the function list for diff --git a/include/llvm/GlobalAlias.h b/include/llvm/GlobalAlias.h index 164d976588d..a97ecd30c9d 100644 --- a/include/llvm/GlobalAlias.h +++ b/include/llvm/GlobalAlias.h @@ -28,8 +28,8 @@ template class GlobalAlias : public GlobalValue, public ilist_node { friend class SymbolTableListTraits; - void operator=(const GlobalAlias &); // Do not implement - GlobalAlias(const GlobalAlias &); // Do not implement + void operator=(const GlobalAlias &) LLVM_DELETED_FUNCTION; + GlobalAlias(const GlobalAlias &) LLVM_DELETED_FUNCTION; void setParent(Module *parent); diff --git a/include/llvm/GlobalValue.h b/include/llvm/GlobalValue.h index 391b8305cd7..58d02576c17 100644 --- a/include/llvm/GlobalValue.h +++ b/include/llvm/GlobalValue.h @@ -26,7 +26,7 @@ class PointerType; class Module; class GlobalValue : public Constant { - GlobalValue(const GlobalValue &); // do not implement + GlobalValue(const GlobalValue &) LLVM_DELETED_FUNCTION; public: /// @brief An enumeration for the kinds of linkage for global values. enum LinkageTypes { diff --git a/include/llvm/InlineAsm.h b/include/llvm/InlineAsm.h index a0aecfd8e47..58c1e84e53f 100644 --- a/include/llvm/InlineAsm.h +++ b/include/llvm/InlineAsm.h @@ -44,8 +44,8 @@ private: friend class ConstantUniqueMap; - InlineAsm(const InlineAsm &); // do not implement - void operator=(const InlineAsm&); // do not implement + InlineAsm(const InlineAsm &) LLVM_DELETED_FUNCTION; + void operator=(const InlineAsm&) LLVM_DELETED_FUNCTION; std::string AsmString, Constraints; bool HasSideEffects; diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h index 1cebdd2ee64..e9bf0f6759b 100644 --- a/include/llvm/IntrinsicInst.h +++ b/include/llvm/IntrinsicInst.h @@ -34,9 +34,9 @@ namespace llvm { /// functions. This allows the standard isa/dyncast/cast functionality to /// work with calls to intrinsic functions. class IntrinsicInst : public CallInst { - IntrinsicInst(); // DO NOT IMPLEMENT - IntrinsicInst(const IntrinsicInst&); // DO NOT IMPLEMENT - void operator=(const IntrinsicInst&); // DO NOT IMPLEMENT + IntrinsicInst() LLVM_DELETED_FUNCTION; + IntrinsicInst(const IntrinsicInst&) LLVM_DELETED_FUNCTION; + void operator=(const IntrinsicInst&) LLVM_DELETED_FUNCTION; public: /// getIntrinsicID - Return the intrinsic ID of this intrinsic. /// diff --git a/include/llvm/LLVMContext.h b/include/llvm/LLVMContext.h index 302f5915361..5903e2e55e1 100644 --- a/include/llvm/LLVMContext.h +++ b/include/llvm/LLVMContext.h @@ -15,6 +15,8 @@ #ifndef LLVM_LLVMCONTEXT_H #define LLVM_LLVMCONTEXT_H +#include "llvm/Support/Compiler.h" + namespace llvm { class LLVMContextImpl; @@ -88,9 +90,8 @@ public: void emitError(const Twine &ErrorStr); private: - // DO NOT IMPLEMENT - LLVMContext(LLVMContext&); - void operator=(LLVMContext&); + LLVMContext(LLVMContext&) LLVM_DELETED_FUNCTION; + void operator=(LLVMContext&) LLVM_DELETED_FUNCTION; /// addModule - Register a module as being instantiated in this context. If /// the context is deleted, the module will be deleted as well. diff --git a/include/llvm/Metadata.h b/include/llvm/Metadata.h index b40549bed6b..d0e65246233 100644 --- a/include/llvm/Metadata.h +++ b/include/llvm/Metadata.h @@ -37,7 +37,7 @@ template /// MDString is always unnamed. class MDString : public Value { virtual void anchor(); - MDString(const MDString &); // DO NOT IMPLEMENT + MDString(const MDString &) LLVM_DELETED_FUNCTION; explicit MDString(LLVMContext &C); public: @@ -71,8 +71,8 @@ class MDNodeOperand; //===----------------------------------------------------------------------===// /// MDNode - a tuple of other values. class MDNode : public Value, public FoldingSetNode { - MDNode(const MDNode &); // DO NOT IMPLEMENT - void operator=(const MDNode &); // DO NOT IMPLEMENT + MDNode(const MDNode &) LLVM_DELETED_FUNCTION; + void operator=(const MDNode &) LLVM_DELETED_FUNCTION; friend class MDNodeOperand; friend class LLVMContextImpl; friend struct FoldingSetTrait; @@ -195,7 +195,7 @@ class NamedMDNode : public ilist_node { friend struct ilist_traits; friend class LLVMContextImpl; friend class Module; - NamedMDNode(const NamedMDNode &); // DO NOT IMPLEMENT + NamedMDNode(const NamedMDNode &) LLVM_DELETED_FUNCTION; std::string Name; Module *Parent; diff --git a/include/llvm/Object/Binary.h b/include/llvm/Object/Binary.h index befe812a369..baed81827d0 100644 --- a/include/llvm/Object/Binary.h +++ b/include/llvm/Object/Binary.h @@ -26,8 +26,8 @@ namespace object { class Binary { private: - Binary(); // = delete - Binary(const Binary &other); // = delete + Binary() LLVM_DELETED_FUNCTION; + Binary(const Binary &other) LLVM_DELETED_FUNCTION; unsigned int TypeID; diff --git a/include/llvm/Object/ObjectFile.h b/include/llvm/Object/ObjectFile.h index 2ec656b0124..da4cef22665 100644 --- a/include/llvm/Object/ObjectFile.h +++ b/include/llvm/Object/ObjectFile.h @@ -266,8 +266,8 @@ const uint64_t UnknownAddressOrSize = ~0ULL; /// figure out which type to create. class ObjectFile : public Binary { virtual void anchor(); - ObjectFile(); // = delete - ObjectFile(const ObjectFile &other); // = delete + ObjectFile() LLVM_DELETED_FUNCTION; + ObjectFile(const ObjectFile &other) LLVM_DELETED_FUNCTION; protected: ObjectFile(unsigned int Type, MemoryBuffer *source, error_code &ec); diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h index 888537daa42..cd651db1f1c 100644 --- a/include/llvm/Pass.h +++ b/include/llvm/Pass.h @@ -29,6 +29,7 @@ #ifndef LLVM_PASS_H #define LLVM_PASS_H +#include "llvm/Support/Compiler.h" #include namespace llvm { @@ -82,8 +83,8 @@ class Pass { AnalysisResolver *Resolver; // Used to resolve analysis const void *PassID; PassKind Kind; - void operator=(const Pass&); // DO NOT IMPLEMENT - Pass(const Pass &); // DO NOT IMPLEMENT + void operator=(const Pass&) LLVM_DELETED_FUNCTION; + Pass(const Pass &) LLVM_DELETED_FUNCTION; public: explicit Pass(PassKind K, char &pid) : Resolver(0), PassID(&pid), Kind(K) { } diff --git a/include/llvm/PassSupport.h b/include/llvm/PassSupport.h index c50c2cc184e..c6ad44f5f4e 100644 --- a/include/llvm/PassSupport.h +++ b/include/llvm/PassSupport.h @@ -126,8 +126,8 @@ public: } private: - void operator=(const PassInfo &); // do not implement - PassInfo(const PassInfo &); // do not implement + void operator=(const PassInfo &) LLVM_DELETED_FUNCTION; + PassInfo(const PassInfo &) LLVM_DELETED_FUNCTION; }; #define CALL_ONCE_INITIALIZATION(function) \ diff --git a/include/llvm/Transforms/Utils/SSAUpdater.h b/include/llvm/Transforms/Utils/SSAUpdater.h index 4c821491b21..db65a47e972 100644 --- a/include/llvm/Transforms/Utils/SSAUpdater.h +++ b/include/llvm/Transforms/Utils/SSAUpdater.h @@ -109,8 +109,8 @@ public: private: Value *GetValueAtEndOfBlockInternal(BasicBlock *BB); - void operator=(const SSAUpdater&); // DO NOT IMPLEMENT - SSAUpdater(const SSAUpdater&); // DO NOT IMPLEMENT + void operator=(const SSAUpdater&) LLVM_DELETED_FUNCTION; + SSAUpdater(const SSAUpdater&) LLVM_DELETED_FUNCTION; }; /// LoadAndStorePromoter - This little helper class provides a convenient way to -- 2.34.1