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
This commit is contained in:
Craig Topper 2012-09-17 07:16:40 +00:00
parent 001d3dc976
commit 9f9ce61972
16 changed files with 39 additions and 37 deletions

View File

@ -79,8 +79,8 @@ private:
void setParent(Function *parent); void setParent(Function *parent);
friend class SymbolTableListTraits<BasicBlock, Function>; friend class SymbolTableListTraits<BasicBlock, Function>;
BasicBlock(const BasicBlock &); // Do not implement BasicBlock(const BasicBlock &) LLVM_DELETED_FUNCTION;
void operator=(const BasicBlock &); // Do not implement void operator=(const BasicBlock &) LLVM_DELETED_FUNCTION;
/// BasicBlock ctor - If the function parameter is specified, the basic block /// BasicBlock ctor - If the function parameter is specified, the basic block
/// is automatically inserted at either the end of the function (if /// is automatically inserted at either the end of the function (if

View File

@ -48,8 +48,8 @@ private:
/// uses this. /// uses this.
bool IgnoreBlockInfoNames; bool IgnoreBlockInfoNames;
BitstreamReader(const BitstreamReader&); // DO NOT IMPLEMENT BitstreamReader(const BitstreamReader&) LLVM_DELETED_FUNCTION;
void operator=(const BitstreamReader&); // DO NOT IMPLEMENT void operator=(const BitstreamReader&) LLVM_DELETED_FUNCTION;
public: public:
BitstreamReader() : IgnoreBlockInfoNames(true) { BitstreamReader() : IgnoreBlockInfoNames(true) {
} }

View File

@ -39,8 +39,8 @@ namespace llvm {
/// don't have to worry about the lifetime of the objects. /// don't have to worry about the lifetime of the objects.
/// @brief LLVM Constant Representation /// @brief LLVM Constant Representation
class Constant : public User { class Constant : public User {
void operator=(const Constant &); // Do not implement void operator=(const Constant &) LLVM_DELETED_FUNCTION;
Constant(const Constant &); // Do not implement Constant(const Constant &) LLVM_DELETED_FUNCTION;
virtual void anchor(); virtual void anchor();
protected: protected:

View File

@ -63,8 +63,8 @@ namespace llvm {
SmallVector<Value *, 4> AllSubprograms; SmallVector<Value *, 4> AllSubprograms;
SmallVector<Value *, 4> AllGVs; SmallVector<Value *, 4> AllGVs;
DIBuilder(const DIBuilder &); // DO NOT IMPLEMENT DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION;
void operator=(const DIBuilder &); // DO NOT IMPLEMENT void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION;
public: public:
explicit DIBuilder(Module &M); explicit DIBuilder(Module &M);

View File

@ -110,8 +110,8 @@ private:
} }
void BuildLazyArguments() const; void BuildLazyArguments() const;
Function(const Function&); // DO NOT IMPLEMENT Function(const Function&) LLVM_DELETED_FUNCTION;
void operator=(const Function&); // DO NOT IMPLEMENT void operator=(const Function&) LLVM_DELETED_FUNCTION;
/// Function ctor - If the (optional) Module argument is specified, the /// Function ctor - If the (optional) Module argument is specified, the
/// function is automatically inserted into the end of the function list for /// function is automatically inserted into the end of the function list for

View File

@ -28,8 +28,8 @@ template<typename ValueSubClass, typename ItemParentClass>
class GlobalAlias : public GlobalValue, public ilist_node<GlobalAlias> { class GlobalAlias : public GlobalValue, public ilist_node<GlobalAlias> {
friend class SymbolTableListTraits<GlobalAlias, Module>; friend class SymbolTableListTraits<GlobalAlias, Module>;
void operator=(const GlobalAlias &); // Do not implement void operator=(const GlobalAlias &) LLVM_DELETED_FUNCTION;
GlobalAlias(const GlobalAlias &); // Do not implement GlobalAlias(const GlobalAlias &) LLVM_DELETED_FUNCTION;
void setParent(Module *parent); void setParent(Module *parent);

View File

@ -26,7 +26,7 @@ class PointerType;
class Module; class Module;
class GlobalValue : public Constant { class GlobalValue : public Constant {
GlobalValue(const GlobalValue &); // do not implement GlobalValue(const GlobalValue &) LLVM_DELETED_FUNCTION;
public: public:
/// @brief An enumeration for the kinds of linkage for global values. /// @brief An enumeration for the kinds of linkage for global values.
enum LinkageTypes { enum LinkageTypes {

View File

@ -44,8 +44,8 @@ private:
friend class ConstantUniqueMap<InlineAsmKeyType, const InlineAsmKeyType&, friend class ConstantUniqueMap<InlineAsmKeyType, const InlineAsmKeyType&,
PointerType, InlineAsm, false>; PointerType, InlineAsm, false>;
InlineAsm(const InlineAsm &); // do not implement InlineAsm(const InlineAsm &) LLVM_DELETED_FUNCTION;
void operator=(const InlineAsm&); // do not implement void operator=(const InlineAsm&) LLVM_DELETED_FUNCTION;
std::string AsmString, Constraints; std::string AsmString, Constraints;
bool HasSideEffects; bool HasSideEffects;

View File

@ -34,9 +34,9 @@ namespace llvm {
/// functions. This allows the standard isa/dyncast/cast functionality to /// functions. This allows the standard isa/dyncast/cast functionality to
/// work with calls to intrinsic functions. /// work with calls to intrinsic functions.
class IntrinsicInst : public CallInst { class IntrinsicInst : public CallInst {
IntrinsicInst(); // DO NOT IMPLEMENT IntrinsicInst() LLVM_DELETED_FUNCTION;
IntrinsicInst(const IntrinsicInst&); // DO NOT IMPLEMENT IntrinsicInst(const IntrinsicInst&) LLVM_DELETED_FUNCTION;
void operator=(const IntrinsicInst&); // DO NOT IMPLEMENT void operator=(const IntrinsicInst&) LLVM_DELETED_FUNCTION;
public: public:
/// getIntrinsicID - Return the intrinsic ID of this intrinsic. /// getIntrinsicID - Return the intrinsic ID of this intrinsic.
/// ///

View File

@ -15,6 +15,8 @@
#ifndef LLVM_LLVMCONTEXT_H #ifndef LLVM_LLVMCONTEXT_H
#define LLVM_LLVMCONTEXT_H #define LLVM_LLVMCONTEXT_H
#include "llvm/Support/Compiler.h"
namespace llvm { namespace llvm {
class LLVMContextImpl; class LLVMContextImpl;
@ -88,9 +90,8 @@ public:
void emitError(const Twine &ErrorStr); void emitError(const Twine &ErrorStr);
private: private:
// DO NOT IMPLEMENT LLVMContext(LLVMContext&) LLVM_DELETED_FUNCTION;
LLVMContext(LLVMContext&); void operator=(LLVMContext&) LLVM_DELETED_FUNCTION;
void operator=(LLVMContext&);
/// addModule - Register a module as being instantiated in this context. If /// addModule - Register a module as being instantiated in this context. If
/// the context is deleted, the module will be deleted as well. /// the context is deleted, the module will be deleted as well.

View File

@ -37,7 +37,7 @@ template<typename ValueSubClass, typename ItemParentClass>
/// MDString is always unnamed. /// MDString is always unnamed.
class MDString : public Value { class MDString : public Value {
virtual void anchor(); virtual void anchor();
MDString(const MDString &); // DO NOT IMPLEMENT MDString(const MDString &) LLVM_DELETED_FUNCTION;
explicit MDString(LLVMContext &C); explicit MDString(LLVMContext &C);
public: public:
@ -71,8 +71,8 @@ class MDNodeOperand;
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// MDNode - a tuple of other values. /// MDNode - a tuple of other values.
class MDNode : public Value, public FoldingSetNode { class MDNode : public Value, public FoldingSetNode {
MDNode(const MDNode &); // DO NOT IMPLEMENT MDNode(const MDNode &) LLVM_DELETED_FUNCTION;
void operator=(const MDNode &); // DO NOT IMPLEMENT void operator=(const MDNode &) LLVM_DELETED_FUNCTION;
friend class MDNodeOperand; friend class MDNodeOperand;
friend class LLVMContextImpl; friend class LLVMContextImpl;
friend struct FoldingSetTrait<MDNode>; friend struct FoldingSetTrait<MDNode>;
@ -195,7 +195,7 @@ class NamedMDNode : public ilist_node<NamedMDNode> {
friend struct ilist_traits<NamedMDNode>; friend struct ilist_traits<NamedMDNode>;
friend class LLVMContextImpl; friend class LLVMContextImpl;
friend class Module; friend class Module;
NamedMDNode(const NamedMDNode &); // DO NOT IMPLEMENT NamedMDNode(const NamedMDNode &) LLVM_DELETED_FUNCTION;
std::string Name; std::string Name;
Module *Parent; Module *Parent;

View File

@ -26,8 +26,8 @@ namespace object {
class Binary { class Binary {
private: private:
Binary(); // = delete Binary() LLVM_DELETED_FUNCTION;
Binary(const Binary &other); // = delete Binary(const Binary &other) LLVM_DELETED_FUNCTION;
unsigned int TypeID; unsigned int TypeID;

View File

@ -266,8 +266,8 @@ const uint64_t UnknownAddressOrSize = ~0ULL;
/// figure out which type to create. /// figure out which type to create.
class ObjectFile : public Binary { class ObjectFile : public Binary {
virtual void anchor(); virtual void anchor();
ObjectFile(); // = delete ObjectFile() LLVM_DELETED_FUNCTION;
ObjectFile(const ObjectFile &other); // = delete ObjectFile(const ObjectFile &other) LLVM_DELETED_FUNCTION;
protected: protected:
ObjectFile(unsigned int Type, MemoryBuffer *source, error_code &ec); ObjectFile(unsigned int Type, MemoryBuffer *source, error_code &ec);

View File

@ -29,6 +29,7 @@
#ifndef LLVM_PASS_H #ifndef LLVM_PASS_H
#define LLVM_PASS_H #define LLVM_PASS_H
#include "llvm/Support/Compiler.h"
#include <string> #include <string>
namespace llvm { namespace llvm {
@ -82,8 +83,8 @@ class Pass {
AnalysisResolver *Resolver; // Used to resolve analysis AnalysisResolver *Resolver; // Used to resolve analysis
const void *PassID; const void *PassID;
PassKind Kind; PassKind Kind;
void operator=(const Pass&); // DO NOT IMPLEMENT void operator=(const Pass&) LLVM_DELETED_FUNCTION;
Pass(const Pass &); // DO NOT IMPLEMENT Pass(const Pass &) LLVM_DELETED_FUNCTION;
public: public:
explicit Pass(PassKind K, char &pid) : Resolver(0), PassID(&pid), Kind(K) { } explicit Pass(PassKind K, char &pid) : Resolver(0), PassID(&pid), Kind(K) { }

View File

@ -126,8 +126,8 @@ public:
} }
private: private:
void operator=(const PassInfo &); // do not implement void operator=(const PassInfo &) LLVM_DELETED_FUNCTION;
PassInfo(const PassInfo &); // do not implement PassInfo(const PassInfo &) LLVM_DELETED_FUNCTION;
}; };
#define CALL_ONCE_INITIALIZATION(function) \ #define CALL_ONCE_INITIALIZATION(function) \

View File

@ -109,8 +109,8 @@ public:
private: private:
Value *GetValueAtEndOfBlockInternal(BasicBlock *BB); Value *GetValueAtEndOfBlockInternal(BasicBlock *BB);
void operator=(const SSAUpdater&); // DO NOT IMPLEMENT void operator=(const SSAUpdater&) LLVM_DELETED_FUNCTION;
SSAUpdater(const SSAUpdater&); // DO NOT IMPLEMENT SSAUpdater(const SSAUpdater&) LLVM_DELETED_FUNCTION;
}; };
/// LoadAndStorePromoter - This little helper class provides a convenient way to /// LoadAndStorePromoter - This little helper class provides a convenient way to