From be2fa7ebf01259b63dc52fe46c8d101c18e72269 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Tue, 18 Sep 2012 04:52:05 +0000 Subject: [PATCH] Mark unimplemented copy constructors and copy assignment operators with LLVM_DELETED_FUNCTION. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164102 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/Decl.h | 4 ++-- include/clang/AST/DeclTemplate.h | 4 ++-- include/clang/AST/DeclarationName.h | 4 ++-- include/clang/AST/NestedNameSpecifier.h | 3 +-- include/clang/AST/UnresolvedSet.h | 2 +- include/clang/Basic/IdentifierTable.h | 4 ++-- include/clang/Basic/SourceManager.h | 6 +++--- include/clang/Lex/HeaderSearch.h | 7 +++---- include/clang/Sema/AttributeList.h | 8 ++++---- include/clang/Sema/Overload.h | 6 +++--- include/clang/Sema/Sema.h | 4 ++-- include/clang/Sema/Template.h | 5 +++-- .../StaticAnalyzer/Core/BugReporter/PathDiagnostic.h | 7 +++---- .../StaticAnalyzer/Core/PathSensitive/ProgramState.h | 2 +- 14 files changed, 32 insertions(+), 34 deletions(-) diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 4d0cde8a43..48a0816593 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -578,8 +578,8 @@ struct QualifierInfo { private: // Copy constructor and copy assignment are disabled. - QualifierInfo(const QualifierInfo&); - QualifierInfo& operator=(const QualifierInfo&); + QualifierInfo(const QualifierInfo&) LLVM_DELETED_FUNCTION; + QualifierInfo& operator=(const QualifierInfo&) LLVM_DELETED_FUNCTION; }; /// \brief Represents a ValueDecl that came out of a declarator. diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h index 3cff5b07c4..0daa60b220 100644 --- a/include/clang/AST/DeclTemplate.h +++ b/include/clang/AST/DeclTemplate.h @@ -149,8 +149,8 @@ class TemplateArgumentList { /// argument list. unsigned NumArguments; - TemplateArgumentList(const TemplateArgumentList &Other); // DO NOT IMPL - void operator=(const TemplateArgumentList &Other); // DO NOT IMPL + TemplateArgumentList(const TemplateArgumentList &Other) LLVM_DELETED_FUNCTION; + void operator=(const TemplateArgumentList &Other) LLVM_DELETED_FUNCTION; TemplateArgumentList(const TemplateArgument *Args, unsigned NumArgs, bool Owned) diff --git a/include/clang/AST/DeclarationName.h b/include/clang/AST/DeclarationName.h index 6146525406..d991c73612 100644 --- a/include/clang/AST/DeclarationName.h +++ b/include/clang/AST/DeclarationName.h @@ -334,8 +334,8 @@ class DeclarationNameTable { CXXOperatorIdName *CXXOperatorNames; // Operator names void *CXXLiteralOperatorNames; // Actually a CXXOperatorIdName* - DeclarationNameTable(const DeclarationNameTable&); // NONCOPYABLE - DeclarationNameTable& operator=(const DeclarationNameTable&); // NONCOPYABLE + DeclarationNameTable(const DeclarationNameTable&) LLVM_DELETED_FUNCTION; + void operator=(const DeclarationNameTable&) LLVM_DELETED_FUNCTION; public: DeclarationNameTable(const ASTContext &C); diff --git a/include/clang/AST/NestedNameSpecifier.h b/include/clang/AST/NestedNameSpecifier.h index a5aec1fdda..bf9e1cbc76 100644 --- a/include/clang/AST/NestedNameSpecifier.h +++ b/include/clang/AST/NestedNameSpecifier.h @@ -97,8 +97,7 @@ private: Specifier(Other.Specifier) { } - NestedNameSpecifier &operator=(const NestedNameSpecifier &); // do not - // implement + void operator=(const NestedNameSpecifier &) LLVM_DELETED_FUNCTION; /// \brief Either find or insert the given nested name specifier /// mockup in the given context. diff --git a/include/clang/AST/UnresolvedSet.h b/include/clang/AST/UnresolvedSet.h index 0918dc44aa..9f11ee5fe3 100644 --- a/include/clang/AST/UnresolvedSet.h +++ b/include/clang/AST/UnresolvedSet.h @@ -94,7 +94,7 @@ class UnresolvedSetImpl { private: template friend class UnresolvedSet; UnresolvedSetImpl() {} - UnresolvedSetImpl(const UnresolvedSetImpl &) {} + UnresolvedSetImpl(const UnresolvedSetImpl &) LLVM_DELETED_FUNCTION; public: // We don't currently support assignment through this iterator, so we might diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index d77c870ec5..e0f4510f26 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -75,8 +75,8 @@ class IdentifierInfo { void *FETokenInfo; // Managed by the language front-end. llvm::StringMapEntry *Entry; - IdentifierInfo(const IdentifierInfo&); // NONCOPYABLE. - void operator=(const IdentifierInfo&); // NONASSIGNABLE. + IdentifierInfo(const IdentifierInfo&) LLVM_DELETED_FUNCTION; + void operator=(const IdentifierInfo&) LLVM_DELETED_FUNCTION; friend class IdentifierTable; diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 32268d789d..ed19535a62 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -221,7 +221,7 @@ namespace SrcMgr { private: // Disable assignments. - ContentCache &operator=(const ContentCache& RHS); + ContentCache &operator=(const ContentCache& RHS) LLVM_DELETED_FUNCTION; }; /// \brief Information about a FileID, basically just the logical file @@ -647,8 +647,8 @@ class SourceManager : public RefCountedBase { mutable llvm::DenseMap MacroArgsCacheMap; // SourceManager doesn't support copy construction. - explicit SourceManager(const SourceManager&); - void operator=(const SourceManager&); + explicit SourceManager(const SourceManager&) LLVM_DELETED_FUNCTION; + void operator=(const SourceManager&) LLVM_DELETED_FUNCTION; public: SourceManager(DiagnosticsEngine &Diag, FileManager &FileMgr, bool UserFilesAreVolatile = false); diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h index 8e9491fdc3..2b5ebc2636 100644 --- a/include/clang/Lex/HeaderSearch.h +++ b/include/clang/Lex/HeaderSearch.h @@ -207,10 +207,9 @@ class HeaderSearch { unsigned NumFrameworkLookups, NumSubFrameworkLookups; // HeaderSearch doesn't support default or copy construction. - explicit HeaderSearch(); - explicit HeaderSearch(const HeaderSearch&); - void operator=(const HeaderSearch&); - + HeaderSearch(const HeaderSearch&) LLVM_DELETED_FUNCTION; + void operator=(const HeaderSearch&) LLVM_DELETED_FUNCTION; + friend class DirectoryLookup; public: diff --git a/include/clang/Sema/AttributeList.h b/include/clang/Sema/AttributeList.h index bf358862b0..2e8b0c03f7 100644 --- a/include/clang/Sema/AttributeList.h +++ b/include/clang/Sema/AttributeList.h @@ -140,10 +140,10 @@ private: return *reinterpret_cast(this + 1); } - AttributeList(const AttributeList &); // DO NOT IMPLEMENT - void operator=(const AttributeList &); // DO NOT IMPLEMENT - void operator delete(void *); // DO NOT IMPLEMENT - ~AttributeList(); // DO NOT IMPLEMENT + AttributeList(const AttributeList &) LLVM_DELETED_FUNCTION; + void operator=(const AttributeList &) LLVM_DELETED_FUNCTION; + void operator delete(void *) LLVM_DELETED_FUNCTION; + ~AttributeList() LLVM_DELETED_FUNCTION; size_t allocated_size() const; diff --git a/include/clang/Sema/Overload.h b/include/clang/Sema/Overload.h index d2fc285c9e..85ef77af93 100644 --- a/include/clang/Sema/Overload.h +++ b/include/clang/Sema/Overload.h @@ -748,9 +748,9 @@ namespace clang { unsigned NumInlineSequences; char InlineSpace[16 * sizeof(ImplicitConversionSequence)]; - OverloadCandidateSet(const OverloadCandidateSet &); - OverloadCandidateSet &operator=(const OverloadCandidateSet &); - + OverloadCandidateSet(const OverloadCandidateSet &) LLVM_DELETED_FUNCTION; + void operator=(const OverloadCandidateSet &) LLVM_DELETED_FUNCTION; + public: OverloadCandidateSet(SourceLocation Loc) : Loc(Loc), NumInlineSequences(0){} ~OverloadCandidateSet() { clear(); } diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 2cd4688ce5..9a8eb310af 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -5717,10 +5717,10 @@ public: bool CheckInstantiationDepth(SourceLocation PointOfInstantiation, SourceRange InstantiationRange); - InstantiatingTemplate(const InstantiatingTemplate&); // not implemented + InstantiatingTemplate(const InstantiatingTemplate&) LLVM_DELETED_FUNCTION; InstantiatingTemplate& - operator=(const InstantiatingTemplate&); // not implemented + operator=(const InstantiatingTemplate&) LLVM_DELETED_FUNCTION; }; void PrintInstantiationStack(); diff --git a/include/clang/Sema/Template.h b/include/clang/Sema/Template.h index 273374dfd8..bbccd25967 100644 --- a/include/clang/Sema/Template.h +++ b/include/clang/Sema/Template.h @@ -239,8 +239,9 @@ namespace clang { unsigned NumArgsInPartiallySubstitutedPack; // This class is non-copyable - LocalInstantiationScope(const LocalInstantiationScope &); - LocalInstantiationScope &operator=(const LocalInstantiationScope &); + LocalInstantiationScope( + const LocalInstantiationScope &) LLVM_DELETED_FUNCTION; + void operator=(const LocalInstantiationScope &) LLVM_DELETED_FUNCTION; public: LocalInstantiationScope(Sema &SemaRef, bool CombineWithOuterScope = false) diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h index 9d3b85e10d..43b39bf8f9 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h @@ -322,10 +322,9 @@ private: const DisplayHint Hint; std::vector ranges; - // Do not implement: - PathDiagnosticPiece(); - PathDiagnosticPiece(const PathDiagnosticPiece &P); - PathDiagnosticPiece& operator=(const PathDiagnosticPiece &P); + PathDiagnosticPiece() LLVM_DELETED_FUNCTION; + PathDiagnosticPiece(const PathDiagnosticPiece &P) LLVM_DELETED_FUNCTION; + void operator=(const PathDiagnosticPiece &P) LLVM_DELETED_FUNCTION; protected: PathDiagnosticPiece(StringRef s, Kind k, DisplayHint hint = Below); diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h index f23f4046a7..acb88a62f2 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h @@ -75,7 +75,7 @@ public: typedef llvm::ImmutableMap GenericDataMap; private: - void operator=(const ProgramState& R) const; // Do not implement. + void operator=(const ProgramState& R) LLVM_DELETED_FUNCTION; friend class ProgramStateManager; friend class ExplodedGraph; -- 2.40.0