From: Angel Garcia Gomez Date: Tue, 20 Oct 2015 12:52:55 +0000 (+0000) Subject: Apply modernize-use-default to clang. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e83bf34da93785210fe557b00803b6b91caa48b5;p=clang Apply modernize-use-default to clang. Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@250822 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ASTConsumer.h b/include/clang/AST/ASTConsumer.h index b2730e4622..02669e9bd1 100644 --- a/include/clang/AST/ASTConsumer.h +++ b/include/clang/AST/ASTConsumer.h @@ -43,7 +43,7 @@ class ASTConsumer { public: ASTConsumer() : SemaConsumer(false) { } - virtual ~ASTConsumer() {} + virtual ~ASTConsumer() = default; /// Initialize - This is called to initialize the consumer, providing the /// ASTContext. diff --git a/include/clang/AST/CanonicalType.h b/include/clang/AST/CanonicalType.h index b25800bfed..6e0f88ee7d 100644 --- a/include/clang/AST/CanonicalType.h +++ b/include/clang/AST/CanonicalType.h @@ -333,7 +333,7 @@ template class CanProxy : public CanProxyAdaptor { public: /// \brief Build a NULL proxy. - CanProxy() { } + CanProxy() = default; /// \brief Build a proxy to the given canonical type. CanProxy(CanQual Stored) { this->Stored = Stored; } @@ -389,7 +389,7 @@ struct CanTypeIterator CanQualType, typename std::iterator_traits::difference_type, CanProxy, CanQualType> { - CanTypeIterator() {} + CanTypeIterator() = default; explicit CanTypeIterator(InputIterator Iter) : CanTypeIterator::iterator_adaptor_base(std::move(Iter)) {} diff --git a/include/clang/AST/DeclFriend.h b/include/clang/AST/DeclFriend.h index 12b93b408a..5bd6da8797 100644 --- a/include/clang/AST/DeclFriend.h +++ b/include/clang/AST/DeclFriend.h @@ -180,7 +180,7 @@ class CXXRecordDecl::friend_iterator { friend class CXXRecordDecl; explicit friend_iterator(FriendDecl *Ptr) : Ptr(Ptr) {} public: - friend_iterator() {} + friend_iterator() = default; typedef FriendDecl *value_type; typedef FriendDecl *reference; diff --git a/include/clang/AST/DeclTemplate.h b/include/clang/AST/DeclTemplate.h index bd38ac8823..3c6ef81442 100644 --- a/include/clang/AST/DeclTemplate.h +++ b/include/clang/AST/DeclTemplate.h @@ -664,7 +664,7 @@ protected: typename std::iterator_traits::iterator>::iterator_category, DeclType *, ptrdiff_t, DeclType *, DeclType *> { - SpecIterator() {} + SpecIterator() = default; explicit SpecIterator( typename llvm::FoldingSetVector::iterator SetIter) : SpecIterator::iterator_adaptor_base(std::move(SetIter)) {} diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index cc1fc0ae18..2e5de8768f 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -337,7 +337,7 @@ public: {} public: - Classification() {} + Classification() = default; Kinds getKind() const { return static_cast(Kind); } ModifiableType getModifiable() const { @@ -4076,7 +4076,7 @@ public: friend class DesignatedInitExpr; public: - Designator() {} + Designator() = default; /// @brief Initializes a field designator. Designator(const IdentifierInfo *FieldName, SourceLocation DotLoc, diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index e8493f1933..45d852ae0e 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -2278,7 +2278,7 @@ public: : Expr(ArrayTypeTraitExprClass, Empty), ATT(0), Value(false), QueriedType() { } - virtual ~ArrayTypeTraitExpr() { } + virtual ~ArrayTypeTraitExpr() = default; SourceLocation getLocStart() const LLVM_READONLY { return Loc; } SourceLocation getLocEnd() const LLVM_READONLY { return RParen; } diff --git a/include/clang/AST/Mangle.h b/include/clang/AST/Mangle.h index 7b725b65ca..29d79592e5 100644 --- a/include/clang/AST/Mangle.h +++ b/include/clang/AST/Mangle.h @@ -64,7 +64,7 @@ public: ManglerKind Kind) : Context(Context), Diags(Diags), Kind(Kind) {} - virtual ~MangleContext() { } + virtual ~MangleContext() = default; ASTContext &getASTContext() const { return Context; } diff --git a/include/clang/AST/MangleNumberingContext.h b/include/clang/AST/MangleNumberingContext.h index 7a818557fd..fd15e1a98b 100644 --- a/include/clang/AST/MangleNumberingContext.h +++ b/include/clang/AST/MangleNumberingContext.h @@ -32,7 +32,7 @@ class VarDecl; /// literals within a particular context. class MangleNumberingContext : public RefCountedBase { public: - virtual ~MangleNumberingContext() {} + virtual ~MangleNumberingContext() = default; /// \brief Retrieve the mangling number of a new lambda expression with the /// given call operator within this context. diff --git a/include/clang/AST/Redeclarable.h b/include/clang/AST/Redeclarable.h index 92046d582b..fd397bec0a 100644 --- a/include/clang/AST/Redeclarable.h +++ b/include/clang/AST/Redeclarable.h @@ -248,7 +248,7 @@ Decl *getPrimaryMergedDecl(Decl *D); template class Mergeable { public: - Mergeable() {} + Mergeable() = default; /// \brief Return the first declaration of this declaration or itself if this /// is the only declaration. diff --git a/include/clang/AST/StmtIterator.h b/include/clang/AST/StmtIterator.h index 81f8ad4344..ced6ac8316 100644 --- a/include/clang/AST/StmtIterator.h +++ b/include/clang/AST/StmtIterator.h @@ -81,7 +81,7 @@ class StmtIteratorImpl : public StmtIteratorBase, protected: StmtIteratorImpl(const StmtIteratorBase& RHS) : StmtIteratorBase(RHS) {} public: - StmtIteratorImpl() {} + StmtIteratorImpl() = default; StmtIteratorImpl(Stmt **s) : StmtIteratorBase(s) {} StmtIteratorImpl(Decl **dgi, Decl **dge) : StmtIteratorBase(dgi, dge) {} StmtIteratorImpl(const VariableArrayType *t) : StmtIteratorBase(t) {} diff --git a/include/clang/AST/UnresolvedSet.h b/include/clang/AST/UnresolvedSet.h index 26ee1cf71c..af2f30fe34 100644 --- a/include/clang/AST/UnresolvedSet.h +++ b/include/clang/AST/UnresolvedSet.h @@ -59,7 +59,7 @@ class UnresolvedSetImpl { // UnresolvedSet. private: template friend class UnresolvedSet; - UnresolvedSetImpl() {} + UnresolvedSetImpl() = default; UnresolvedSetImpl(const UnresolvedSetImpl &) {} public: diff --git a/include/clang/AST/VTableBuilder.h b/include/clang/AST/VTableBuilder.h index 481fd11d6a..385a817303 100644 --- a/include/clang/AST/VTableBuilder.h +++ b/include/clang/AST/VTableBuilder.h @@ -298,7 +298,7 @@ public: bool isMicrosoft() const { return IsMicrosoftABI; } - virtual ~VTableContextBase() {} + virtual ~VTableContextBase() = default; protected: typedef llvm::DenseMap ThunksMapTy; diff --git a/include/clang/ASTMatchers/ASTMatchersInternal.h b/include/clang/ASTMatchers/ASTMatchersInternal.h index 8e1abc6f77..e703319f61 100644 --- a/include/clang/ASTMatchers/ASTMatchersInternal.h +++ b/include/clang/ASTMatchers/ASTMatchersInternal.h @@ -131,7 +131,7 @@ public: /// BoundNodesTree. class Visitor { public: - virtual ~Visitor() {} + virtual ~Visitor() = default; /// \brief Called multiple times during a single call to VisitMatches(...). /// @@ -209,7 +209,7 @@ public: template class MatcherInterface : public DynMatcherInterface { public: - ~MatcherInterface() override {} + ~MatcherInterface() override = default; /// \brief Returns true if 'Node' can be matched. /// @@ -798,7 +798,7 @@ public: AMM_ParentOnly }; - virtual ~ASTMatchFinder() {} + virtual ~ASTMatchFinder() = default; /// \brief Returns true if the given class is directly or indirectly derived /// from a base type matching \c base. @@ -1376,7 +1376,7 @@ class VariadicDynCastAllOfMatcher BindableMatcher, Matcher, makeDynCastAllOfComposite > { public: - VariadicDynCastAllOfMatcher() {} + VariadicDynCastAllOfMatcher() = default; }; /// \brief A \c VariadicAllOfMatcher object is a variadic functor that takes @@ -1394,7 +1394,7 @@ class VariadicAllOfMatcher : public llvm::VariadicFunction< BindableMatcher, Matcher, makeAllOfComposite > { public: - VariadicAllOfMatcher() {} + VariadicAllOfMatcher() = default; }; /// \brief Matches nodes of type \c TLoc for which the inner @@ -1515,7 +1515,7 @@ public: struct Func : public llvm::VariadicFunction, &Self::create> { - Func() {} + Func() = default; }; private: diff --git a/include/clang/Analysis/Analyses/FormatString.h b/include/clang/Analysis/Analyses/FormatString.h index 4471311a33..fbcc8a5fbf 100644 --- a/include/clang/Analysis/Analyses/FormatString.h +++ b/include/clang/Analysis/Analyses/FormatString.h @@ -606,7 +606,7 @@ enum PositionContext { FieldWidthPos = 0, PrecisionPos = 1 }; class FormatStringHandler { public: - FormatStringHandler() {} + FormatStringHandler() = default; virtual ~FormatStringHandler(); virtual void HandleNullChar(const char *nullCharacter) {} diff --git a/include/clang/Analysis/Analyses/LiveVariables.h b/include/clang/Analysis/Analyses/LiveVariables.h index e17f73a61f..c6c0ece13b 100644 --- a/include/clang/Analysis/Analyses/LiveVariables.h +++ b/include/clang/Analysis/Analyses/LiveVariables.h @@ -53,7 +53,7 @@ public: class Observer { virtual void anchor(); public: - virtual ~Observer() {} + virtual ~Observer() = default; /// A callback invoked right before invoking the /// liveness transfer function on the given statement. diff --git a/include/clang/Analysis/Analyses/ReachableCode.h b/include/clang/Analysis/Analyses/ReachableCode.h index 4c523bfc8b..a388cc9fec 100644 --- a/include/clang/Analysis/Analyses/ReachableCode.h +++ b/include/clang/Analysis/Analyses/ReachableCode.h @@ -48,7 +48,7 @@ enum UnreachableKind { class Callback { virtual void anchor(); public: - virtual ~Callback() {} + virtual ~Callback() = default; virtual void HandleUnreachable(UnreachableKind UK, SourceLocation L, SourceRange ConditionVal, diff --git a/include/clang/Analysis/Analyses/ThreadSafetyTraverse.h b/include/clang/Analysis/Analyses/ThreadSafetyTraverse.h index 705fe910d0..5bf0ea496b 100644 --- a/include/clang/Analysis/Analyses/ThreadSafetyTraverse.h +++ b/include/clang/Analysis/Analyses/ThreadSafetyTraverse.h @@ -176,7 +176,7 @@ template class VisitReducer : public Traversal, public VisitReducerBase { public: - VisitReducer() {} + VisitReducer() = default; public: R_SExpr reduceNull() { return true; } diff --git a/include/clang/Analysis/Analyses/UninitializedValues.h b/include/clang/Analysis/Analyses/UninitializedValues.h index 53ff20c235..18ed02dd2e 100644 --- a/include/clang/Analysis/Analyses/UninitializedValues.h +++ b/include/clang/Analysis/Analyses/UninitializedValues.h @@ -99,7 +99,7 @@ public: class UninitVariablesHandler { public: - UninitVariablesHandler() {} + UninitVariablesHandler() = default; virtual ~UninitVariablesHandler(); /// Called when the uninitialized variable is used at the given expression. diff --git a/include/clang/Analysis/AnalysisContext.h b/include/clang/Analysis/AnalysisContext.h index 931190e43a..124ec3dda5 100644 --- a/include/clang/Analysis/AnalysisContext.h +++ b/include/clang/Analysis/AnalysisContext.h @@ -44,7 +44,7 @@ namespace idx { class TranslationUnit; } /// to AnalysisDeclContext. class ManagedAnalysis { protected: - ManagedAnalysis() {} + ManagedAnalysis() = default; public: virtual ~ManagedAnalysis(); @@ -289,7 +289,7 @@ class StackFrameContext : public LocationContext { Block(blk), Index(idx) {} public: - ~StackFrameContext() override {} + ~StackFrameContext() override = default; const Stmt *getCallSite() const { return CallSite; } @@ -324,7 +324,7 @@ class ScopeContext : public LocationContext { : LocationContext(Scope, ctx, parent), Enter(s) {} public: - ~ScopeContext() override {} + ~ScopeContext() override = default; void Profile(llvm::FoldingSetNodeID &ID) override; @@ -352,7 +352,7 @@ class BlockInvocationContext : public LocationContext { : LocationContext(Block, ctx, parent), BD(bd), ContextData(contextData) {} public: - ~BlockInvocationContext() override {} + ~BlockInvocationContext() override = default; const BlockDecl *getBlockDecl() const { return BD; } diff --git a/include/clang/Analysis/CFG.h b/include/clang/Analysis/CFG.h index 293990c88e..58e26604dc 100644 --- a/include/clang/Analysis/CFG.h +++ b/include/clang/Analysis/CFG.h @@ -704,11 +704,11 @@ public: /// operator error is found when building the CFG. class CFGCallback { public: - CFGCallback() {} + CFGCallback() = default; virtual void compareAlwaysTrue(const BinaryOperator *B, bool isAlwaysTrue) {} virtual void compareBitwiseEquality(const BinaryOperator *B, bool isAlwaysTrue) {} - virtual ~CFGCallback() {} + virtual ~CFGCallback() = default; }; /// CFG - Represents a source-level, intra-procedural CFG that represents the diff --git a/include/clang/Basic/FileSystemStatCache.h b/include/clang/Basic/FileSystemStatCache.h index cad9189348..430851df67 100644 --- a/include/clang/Basic/FileSystemStatCache.h +++ b/include/clang/Basic/FileSystemStatCache.h @@ -51,7 +51,7 @@ protected: std::unique_ptr NextStatCache; public: - virtual ~FileSystemStatCache() {} + virtual ~FileSystemStatCache() = default; enum LookupResult { CacheExists, ///< We know the file exists and its cached stat data. diff --git a/include/clang/Basic/IdentifierTable.h b/include/clang/Basic/IdentifierTable.h index d672314f56..b0812ccd90 100644 --- a/include/clang/Basic/IdentifierTable.h +++ b/include/clang/Basic/IdentifierTable.h @@ -385,7 +385,7 @@ private: void operator=(const IdentifierIterator &) = delete; protected: - IdentifierIterator() { } + IdentifierIterator() = default; public: virtual ~IdentifierIterator(); diff --git a/include/clang/Driver/Job.h b/include/clang/Driver/Job.h index 263356f396..d1fd6e3465 100644 --- a/include/clang/Driver/Job.h +++ b/include/clang/Driver/Job.h @@ -88,7 +88,7 @@ public: // FIXME: This really shouldn't be copyable, but is currently copied in some // error handling in Driver::generateCompilationDiagnostics. Command(const Command &) = default; - virtual ~Command() {} + virtual ~Command() = default; virtual void Print(llvm::raw_ostream &OS, const char *Terminator, bool Quote, CrashReportInfo *CrashInfo = nullptr) const; diff --git a/include/clang/Edit/EditsReceiver.h b/include/clang/Edit/EditsReceiver.h index 600ac28ea9..1b63d0ee86 100644 --- a/include/clang/Edit/EditsReceiver.h +++ b/include/clang/Edit/EditsReceiver.h @@ -20,7 +20,7 @@ namespace edit { class EditsReceiver { public: - virtual ~EditsReceiver() { } + virtual ~EditsReceiver() = default; virtual void insert(SourceLocation loc, StringRef text) = 0; virtual void replace(CharSourceRange range, StringRef text) = 0; diff --git a/include/clang/Frontend/SerializedDiagnosticReader.h b/include/clang/Frontend/SerializedDiagnosticReader.h index 3db362bf34..5c0a06f4c1 100644 --- a/include/clang/Frontend/SerializedDiagnosticReader.h +++ b/include/clang/Frontend/SerializedDiagnosticReader.h @@ -58,8 +58,8 @@ struct Location { /// the various constructs that are found in serialized diagnostics. class SerializedDiagnosticReader { public: - SerializedDiagnosticReader() {} - virtual ~SerializedDiagnosticReader() {} + SerializedDiagnosticReader() = default; + virtual ~SerializedDiagnosticReader() = default; /// \brief Read the diagnostics in \c File std::error_code readDiagnostics(StringRef File); diff --git a/include/clang/Frontend/VerifyDiagnosticConsumer.h b/include/clang/Frontend/VerifyDiagnosticConsumer.h index 475f07f9dc..493dac3b11 100644 --- a/include/clang/Frontend/VerifyDiagnosticConsumer.h +++ b/include/clang/Frontend/VerifyDiagnosticConsumer.h @@ -161,7 +161,7 @@ public: unsigned Min, Max; bool MatchAnyLine; - virtual ~Directive() { } + virtual ~Directive() = default; // Returns true if directive text is valid. // Otherwise returns false and populates E. diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h index 155943e545..3320843243 100644 --- a/include/clang/Lex/ModuleMap.h +++ b/include/clang/Lex/ModuleMap.h @@ -40,7 +40,7 @@ class ModuleMapParser; /// reads module map files. class ModuleMapCallbacks { public: - virtual ~ModuleMapCallbacks() {} + virtual ~ModuleMapCallbacks() = default; /// \brief Called when a module map file has been read. /// diff --git a/include/clang/Lex/PTHLexer.h b/include/clang/Lex/PTHLexer.h index 904be792b2..e2e2306c0e 100644 --- a/include/clang/Lex/PTHLexer.h +++ b/include/clang/Lex/PTHLexer.h @@ -64,7 +64,7 @@ protected: PTHLexer(Preprocessor& pp, FileID FID, const unsigned char *D, const unsigned char* ppcond, PTHManager &PM); public: - ~PTHLexer() override {} + ~PTHLexer() override = default; /// Lex - Return the next token. bool Lex(Token &Tok); diff --git a/include/clang/Lex/PreprocessorLexer.h b/include/clang/Lex/PreprocessorLexer.h index 6d6cf05a96..dfc7768f62 100644 --- a/include/clang/Lex/PreprocessorLexer.h +++ b/include/clang/Lex/PreprocessorLexer.h @@ -81,7 +81,7 @@ protected: ParsingFilename(false), LexingRawMode(false) {} - virtual ~PreprocessorLexer() {} + virtual ~PreprocessorLexer() = default; virtual void IndirectLex(Token& Result) = 0; diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index cce5405a1e..09d6a4b850 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -1313,7 +1313,7 @@ public: TypeDiagnoser(bool Suppressed = false) : Suppressed(Suppressed) { } virtual void diagnose(Sema &S, SourceLocation Loc, QualType T) = 0; - virtual ~TypeDiagnoser() {} + virtual ~TypeDiagnoser() = default; }; static int getPrintable(int I) { return I; } @@ -2297,7 +2297,7 @@ public: virtual SemaDiagnosticBuilder diagnoseConversion( Sema &S, SourceLocation Loc, QualType T, QualType ConvTy) = 0; - virtual ~ContextualImplicitConverter() {} + virtual ~ContextualImplicitConverter() = default; }; class ICEConvertDiagnoser : public ContextualImplicitConverter { @@ -8597,7 +8597,7 @@ public: virtual void diagnoseNotICE(Sema &S, SourceLocation Loc, SourceRange SR) =0; virtual void diagnoseFold(Sema &S, SourceLocation Loc, SourceRange SR); - virtual ~VerifyICEDiagnoser() { } + virtual ~VerifyICEDiagnoser() = default; }; /// VerifyIntegerConstantExpression - Verifies that an expression is an ICE, diff --git a/include/clang/Sema/TypoCorrection.h b/include/clang/Sema/TypoCorrection.h index 958aab0fce..6c8a2852df 100644 --- a/include/clang/Sema/TypoCorrection.h +++ b/include/clang/Sema/TypoCorrection.h @@ -255,7 +255,7 @@ public: IsObjCIvarLookup(false), IsAddressOfOperand(false), Typo(Typo), TypoNNS(TypoNNS) {} - virtual ~CorrectionCandidateCallback() {} + virtual ~CorrectionCandidateCallback() = default; /// \brief Simple predicate used by the default RankCandidate to /// determine whether to return an edit distance of 0 or InvalidDistance. diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h index 57c73fd6ec..b8133bfd12 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h @@ -57,7 +57,7 @@ public: class NodeResolver { virtual void anchor(); public: - virtual ~NodeResolver() {} + virtual ~NodeResolver() = default; virtual const ExplodedNode* getOriginalNode(const ExplodedNode *N) = 0; }; @@ -529,7 +529,7 @@ class BugReporterContext { public: BugReporterContext(GRBugReporter& br) : BR(br) {} - virtual ~BugReporterContext() {} + virtual ~BugReporterContext() = default; GRBugReporter& getBugReporter() { return BR; } diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h b/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h index 16226e94df..60f91de6df 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h @@ -42,7 +42,7 @@ public: BugType(const CheckerBase *checker, StringRef name, StringRef cat) : Check(checker->getCheckName()), Name(name), Category(cat), SuppressonSink(false) {} - virtual ~BugType() {} + virtual ~BugType() = default; // FIXME: Should these be made strings as well? StringRef getName() const { return Name; } diff --git a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h index 35421f9455..ad083f7122 100644 --- a/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h +++ b/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h @@ -481,7 +481,7 @@ private: public: StackHintGeneratorForSymbol(SymbolRef S, StringRef M) : Sym(S), Msg(M) {} - ~StackHintGeneratorForSymbol() override {} + ~StackHintGeneratorForSymbol() override = default; /// \brief Search the call expression for the symbol Sym and dispatch the /// 'getMessageForX()' methods to construct a specific message. diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h index cf888b5040..7fe8e3d3db 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h @@ -168,7 +168,7 @@ protected: RegionAndSymbolInvalidationTraits *ETraits) const {} public: - virtual ~CallEvent() {} + virtual ~CallEvent() = default; /// \brief Returns the kind of call this is. virtual Kind getKind() const = 0; diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h index d5822e2244..368fdee4be 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h @@ -254,7 +254,7 @@ public: assert(hasNoSinksInFrontier()); } - virtual ~NodeBuilder() {} + virtual ~NodeBuilder() = default; /// \brief Generates a node in the ExplodedGraph. ExplodedNode *generateNode(const ProgramPoint &PP, diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h b/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h index a68d3410a8..9ae9aaf6de 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h @@ -68,7 +68,7 @@ public: ArrayIndexTy(context.IntTy), ArrayIndexWidth(context.getTypeSize(ArrayIndexTy)) {} - virtual ~SValBuilder() {} + virtual ~SValBuilder() = default; bool haveSameType(const SymExpr *Sym1, const SymExpr *Sym2) { return haveSameType(Sym1->getType(), Sym2->getType()); diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h b/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h index a03b6306a0..b29e5f7047 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h @@ -49,7 +49,7 @@ protected: StoreManager(ProgramStateManager &stateMgr); public: - virtual ~StoreManager() {} + virtual ~StoreManager() = default; /// Return the value bound to specified location in a given state. /// \param[in] store The analysis state. diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h b/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h index 741ba0e2f2..fa3f200ba8 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h @@ -43,7 +43,7 @@ class MemRegion; class SubEngine { virtual void anchor(); public: - virtual ~SubEngine() {} + virtual ~SubEngine() = default; virtual ProgramStateRef getInitialState(const LocationContext *InitLoc) = 0; diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h b/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h index 05de02db59..cfb7edec8e 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h @@ -57,7 +57,7 @@ protected: SymExpr(Kind k) : K(k) {} public: - virtual ~SymExpr() {} + virtual ~SymExpr() = default; Kind getKind() const { return K; } @@ -109,7 +109,7 @@ protected: SymbolData(Kind k, SymbolID sym) : SymExpr(k), Sym(sym) {} public: - ~SymbolData() override {} + ~SymbolData() override = default; SymbolID getSymbolID() const { return Sym; } diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h b/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h index d39b5017d3..d46efd4ef0 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h @@ -37,7 +37,7 @@ template<> struct ProgramStateTrait class TaintManager { - TaintManager() {} + TaintManager() = default; }; } diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h b/include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h index 4f1a60e675..24d4503f37 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h @@ -82,7 +82,7 @@ public: class Visitor { public: - Visitor() {} + Visitor() = default; virtual ~Visitor(); virtual bool visit(const WorkListUnit &U) = 0; }; diff --git a/include/clang/Tooling/FileMatchTrie.h b/include/clang/Tooling/FileMatchTrie.h index 745c164506..d7a6a379c2 100644 --- a/include/clang/Tooling/FileMatchTrie.h +++ b/include/clang/Tooling/FileMatchTrie.h @@ -25,7 +25,7 @@ namespace clang { namespace tooling { struct PathComparator { - virtual ~PathComparator() {} + virtual ~PathComparator() = default; virtual bool equivalent(StringRef FileA, StringRef FileB) const = 0; }; class FileMatchTrieNode; diff --git a/include/clang/Tooling/Tooling.h b/include/clang/Tooling/Tooling.h index b7a9b25acd..ada1f526b5 100644 --- a/include/clang/Tooling/Tooling.h +++ b/include/clang/Tooling/Tooling.h @@ -110,7 +110,7 @@ std::unique_ptr newFrontendActionFactory(); /// newFrontendActionFactory. class SourceFileCallbacks { public: - virtual ~SourceFileCallbacks() {} + virtual ~SourceFileCallbacks() = default; /// \brief Called before a source file is processed by a FrontEndAction. /// \see clang::FrontendAction::BeginSourceFileAction diff --git a/lib/ARCMigrate/ARCMT.cpp b/lib/ARCMigrate/ARCMT.cpp index 7eb01fb93d..c9239ded2b 100644 --- a/lib/ARCMigrate/ARCMT.cpp +++ b/lib/ARCMigrate/ARCMT.cpp @@ -498,7 +498,7 @@ public: } // end anonymous namespace. /// \brief Anchor for VTable. -MigrationProcess::RewriteListener::~RewriteListener() { } +MigrationProcess::RewriteListener::~RewriteListener() = default; MigrationProcess::MigrationProcess( const CompilerInvocation &CI, diff --git a/lib/ARCMigrate/TransformActions.cpp b/lib/ARCMigrate/TransformActions.cpp index c628b54ed4..e7eb821691 100644 --- a/lib/ARCMigrate/TransformActions.cpp +++ b/lib/ARCMigrate/TransformActions.cpp @@ -594,7 +594,7 @@ SourceLocation TransformActionsImpl::getLocForEndOfToken(SourceLocation loc, return PP.getLocForEndOfToken(loc); } -TransformActions::RewriteReceiver::~RewriteReceiver() { } +TransformActions::RewriteReceiver::~RewriteReceiver() = default; TransformActions::TransformActions(DiagnosticsEngine &diag, CapturedDiagList &capturedDiags, diff --git a/lib/ARCMigrate/Transforms.cpp b/lib/ARCMigrate/Transforms.cpp index 56d3af7233..2bdaf19ebc 100644 --- a/lib/ARCMigrate/Transforms.cpp +++ b/lib/ARCMigrate/Transforms.cpp @@ -27,7 +27,7 @@ using namespace clang; using namespace arcmt; using namespace trans; -ASTTraverser::~ASTTraverser() { } +ASTTraverser::~ASTTraverser() = default; bool MigrationPass::CFBridgingFunctionsDefined() { if (!EnableCFBridgeFns.hasValue()) diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 848158877a..1f1e00a812 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -7914,7 +7914,7 @@ QualType ASTContext::getCorrespondingUnsignedType(QualType T) const { } } -ASTMutationListener::~ASTMutationListener() { } +ASTMutationListener::~ASTMutationListener() = default; void ASTMutationListener::DeducedReturnType(const FunctionDecl *FD, QualType ReturnType) {} @@ -8502,7 +8502,7 @@ MangleContext *ASTContext::createMangleContext() { llvm_unreachable("Unsupported ABI"); } -CXXABI::~CXXABI() {} +CXXABI::~CXXABI() = default; size_t ASTContext::getSideTableAllocatedMemory() const { return ASTRecordLayouts.getMemorySize() + diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index 6816dd11d9..fded9444a5 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -5344,7 +5344,7 @@ ASTImporter::ASTImporter(ASTContext &ToContext, FileManager &ToFileManager, = ToContext.getTranslationUnitDecl(); } -ASTImporter::~ASTImporter() { } +ASTImporter::~ASTImporter() = default; QualType ASTImporter::Import(QualType FromT) { if (FromT.isNull()) diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 406dff6899..ff92630a26 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -236,7 +236,7 @@ void PrettyStackTraceDecl::print(raw_ostream &OS) const { //===----------------------------------------------------------------------===// // Out-of-line virtual method providing a home for Decl. -Decl::~Decl() { } +Decl::~Decl() = default; void Decl::setDeclContext(DeclContext *DC) { DeclCtx = DC; @@ -836,7 +836,7 @@ bool DeclContext::classof(const Decl *D) { } } -DeclContext::~DeclContext() { } +DeclContext::~DeclContext() = default; /// \brief Find the parent context of this context that will be /// used for unqualified name lookup. diff --git a/lib/AST/ExternalASTSource.cpp b/lib/AST/ExternalASTSource.cpp index e3de8c5fef..c42a8b4fcd 100644 --- a/lib/AST/ExternalASTSource.cpp +++ b/lib/AST/ExternalASTSource.cpp @@ -21,7 +21,7 @@ using namespace clang; -ExternalASTSource::~ExternalASTSource() { } +ExternalASTSource::~ExternalASTSource() = default; llvm::Optional ExternalASTSource::getSourceDescriptor(unsigned ID) { diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index bf155f5680..21c2959f64 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -2338,4 +2338,4 @@ void Stmt::printPretty(raw_ostream &OS, //===----------------------------------------------------------------------===// // Implement virtual destructor. -PrinterHelper::~PrinterHelper() {} +PrinterHelper::~PrinterHelper() = default; diff --git a/lib/AST/VTableBuilder.cpp b/lib/AST/VTableBuilder.cpp index 6829da5bb1..747a1bda36 100644 --- a/lib/AST/VTableBuilder.cpp +++ b/lib/AST/VTableBuilder.cpp @@ -2229,7 +2229,7 @@ VTableLayout::VTableLayout(uint64_t NumVTableComponents, }); } -VTableLayout::~VTableLayout() { } +VTableLayout::~VTableLayout() = default; ItaniumVTableContext::ItaniumVTableContext(ASTContext &Context) : VTableContextBase(/*MS=*/false) {} diff --git a/lib/ASTMatchers/ASTMatchFinder.cpp b/lib/ASTMatchers/ASTMatchFinder.cpp index 8807b13c5e..f4cf5ef20f 100644 --- a/lib/ASTMatchers/ASTMatchFinder.cpp +++ b/lib/ASTMatchers/ASTMatchFinder.cpp @@ -902,13 +902,13 @@ MatchFinder::MatchResult::MatchResult(const BoundNodes &Nodes, : Nodes(Nodes), Context(Context), SourceManager(&Context->getSourceManager()) {} -MatchFinder::MatchCallback::~MatchCallback() {} -MatchFinder::ParsingDoneTestCallback::~ParsingDoneTestCallback() {} +MatchFinder::MatchCallback::~MatchCallback() = default; +MatchFinder::ParsingDoneTestCallback::~ParsingDoneTestCallback() = default; MatchFinder::MatchFinder(MatchFinderOptions Options) : Options(std::move(Options)), ParsingDone(nullptr) {} -MatchFinder::~MatchFinder() {} +MatchFinder::~MatchFinder() = default; void MatchFinder::addMatcher(const DeclarationMatcher &NodeMatch, MatchCallback *Action) { diff --git a/lib/ASTMatchers/Dynamic/Marshallers.h b/lib/ASTMatchers/Dynamic/Marshallers.h index 64d6b7814a..0d6fbf916c 100644 --- a/lib/ASTMatchers/Dynamic/Marshallers.h +++ b/lib/ASTMatchers/Dynamic/Marshallers.h @@ -103,7 +103,7 @@ public: /// arguments, and various other methods for type introspection. class MatcherDescriptor { public: - virtual ~MatcherDescriptor() {} + virtual ~MatcherDescriptor() = default; virtual VariantMatcher create(SourceRange NameRange, ArrayRef Args, Diagnostics *Error) const = 0; @@ -491,7 +491,7 @@ public: OverloadedMatcherDescriptor(ArrayRef Callbacks) : Overloads(Callbacks.begin(), Callbacks.end()) {} - ~OverloadedMatcherDescriptor() override {} + ~OverloadedMatcherDescriptor() override = default; VariantMatcher create(SourceRange NameRange, ArrayRef Args, diff --git a/lib/ASTMatchers/Dynamic/Parser.cpp b/lib/ASTMatchers/Dynamic/Parser.cpp index cf9dab6dc7..ca4a12716d 100644 --- a/lib/ASTMatchers/Dynamic/Parser.cpp +++ b/lib/ASTMatchers/Dynamic/Parser.cpp @@ -257,7 +257,7 @@ private: const char *CodeCompletionLocation; }; -Parser::Sema::~Sema() {} +Parser::Sema::~Sema() = default; std::vector Parser::Sema::getAcceptedCompletionTypes( llvm::ArrayRef> Context) { @@ -526,7 +526,7 @@ Parser::Parser(CodeTokenizer *Tokenizer, Sema *S, : Tokenizer(Tokenizer), S(S ? S : &*DefaultRegistrySema), NamedValues(NamedValues), Error(Error) {} -Parser::RegistrySema::~RegistrySema() {} +Parser::RegistrySema::~RegistrySema() = default; llvm::Optional Parser::RegistrySema::lookupMatcherCtor(StringRef MatcherName) { diff --git a/lib/ASTMatchers/Dynamic/VariantValue.cpp b/lib/ASTMatchers/Dynamic/VariantValue.cpp index 8f3c70c1a8..d73fb7b623 100644 --- a/lib/ASTMatchers/Dynamic/VariantValue.cpp +++ b/lib/ASTMatchers/Dynamic/VariantValue.cpp @@ -75,7 +75,7 @@ VariantMatcher::MatcherOps::constructVariadicOperator( return DynTypedMatcher::constructVariadic(Op, NodeKind, DynMatchers); } -VariantMatcher::Payload::~Payload() {} +VariantMatcher::Payload::~Payload() = default; class VariantMatcher::SinglePayload : public VariantMatcher::Payload { public: @@ -113,7 +113,7 @@ public: PolymorphicPayload(std::vector MatchersIn) : Matchers(std::move(MatchersIn)) {} - ~PolymorphicPayload() override {} + ~PolymorphicPayload() override = default; llvm::Optional getSingleMatcher() const override { if (Matchers.size() != 1) diff --git a/lib/Analysis/AnalysisDeclContext.cpp b/lib/Analysis/AnalysisDeclContext.cpp index d7fb7e95d7..a54710181d 100644 --- a/lib/Analysis/AnalysisDeclContext.cpp +++ b/lib/Analysis/AnalysisDeclContext.cpp @@ -551,7 +551,7 @@ ManagedAnalysis *&AnalysisDeclContext::getAnalysisImpl(const void *tag) { // Cleanup. //===----------------------------------------------------------------------===// -ManagedAnalysis::~ManagedAnalysis() {} +ManagedAnalysis::~ManagedAnalysis() = default; AnalysisDeclContext::~AnalysisDeclContext() { delete forcedBlkExprs; @@ -568,7 +568,7 @@ AnalysisDeclContextManager::~AnalysisDeclContextManager() { llvm::DeleteContainerSeconds(Contexts); } -LocationContext::~LocationContext() {} +LocationContext::~LocationContext() = default; LocationContextManager::~LocationContextManager() { clear(); diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 6cb63f2b17..63201c4595 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -4010,7 +4010,7 @@ public: } } - ~StmtPrinterHelper() override {} + ~StmtPrinterHelper() override = default; const LangOptions &getLangOpts() const { return LangOpts; } void setBlockID(signed i) { currentBlock = i; } diff --git a/lib/Analysis/CodeInjector.cpp b/lib/Analysis/CodeInjector.cpp index 76bf364444..3ac94f9bc0 100644 --- a/lib/Analysis/CodeInjector.cpp +++ b/lib/Analysis/CodeInjector.cpp @@ -11,5 +11,5 @@ using namespace clang; -CodeInjector::CodeInjector() {} -CodeInjector::~CodeInjector() {} +CodeInjector::CodeInjector() = default; +CodeInjector::~CodeInjector() = default; diff --git a/lib/Analysis/Consumed.cpp b/lib/Analysis/Consumed.cpp index 9df23923b0..11429fff45 100644 --- a/lib/Analysis/Consumed.cpp +++ b/lib/Analysis/Consumed.cpp @@ -52,7 +52,7 @@ using namespace clang; using namespace consumed; // Key method definition -ConsumedWarningsHandlerBase::~ConsumedWarningsHandlerBase() {} +ConsumedWarningsHandlerBase::~ConsumedWarningsHandlerBase() = default; static SourceLocation getFirstStmtLoc(const CFGBlock *Block) { // Find the source location of the first statement in the block, if the block diff --git a/lib/Analysis/FormatString.cpp b/lib/Analysis/FormatString.cpp index 0948bc0b08..f8bbafd549 100644 --- a/lib/Analysis/FormatString.cpp +++ b/lib/Analysis/FormatString.cpp @@ -26,7 +26,7 @@ using clang::analyze_format_string::ConversionSpecifier; using namespace clang; // Key function to FormatStringHandler. -FormatStringHandler::~FormatStringHandler() {} +FormatStringHandler::~FormatStringHandler() = default; //===----------------------------------------------------------------------===// // Functions for parsing format strings components in both printf and diff --git a/lib/Analysis/ProgramPoint.cpp b/lib/Analysis/ProgramPoint.cpp index 26b59bb71d..787e5bbca7 100644 --- a/lib/Analysis/ProgramPoint.cpp +++ b/lib/Analysis/ProgramPoint.cpp @@ -16,7 +16,7 @@ using namespace clang; -ProgramPointTag::~ProgramPointTag() {} +ProgramPointTag::~ProgramPointTag() = default; ProgramPoint ProgramPoint::getProgramPoint(const Stmt *S, ProgramPoint::Kind K, const LocationContext *LC, diff --git a/lib/Analysis/ThreadSafety.cpp b/lib/Analysis/ThreadSafety.cpp index bce5175ece..407b7f0e0d 100644 --- a/lib/Analysis/ThreadSafety.cpp +++ b/lib/Analysis/ThreadSafety.cpp @@ -48,7 +48,7 @@ using namespace clang; using namespace threadSafety; // Key method definition -ThreadSafetyHandler::~ThreadSafetyHandler() {} +ThreadSafetyHandler::~ThreadSafetyHandler() = default; namespace { class TILPrinter : @@ -107,7 +107,7 @@ public: : CapabilityExpr(CE), LKind(LK), AcquireLoc(Loc), Asserted(Asrt), Declared(Declrd) {} - virtual ~FactEntry() {} + virtual ~FactEntry() = default; LockKind kind() const { return LKind; } SourceLocation loc() const { return AcquireLoc; } diff --git a/lib/Analysis/UninitializedValues.cpp b/lib/Analysis/UninitializedValues.cpp index f2f791957a..2ee94d5e8e 100644 --- a/lib/Analysis/UninitializedValues.cpp +++ b/lib/Analysis/UninitializedValues.cpp @@ -837,7 +837,7 @@ struct PruneBlocksHandler : public UninitVariablesHandler { : hadUse(numBlocks, false), hadAnyUse(false), currentBlock(0) {} - ~PruneBlocksHandler() override {} + ~PruneBlocksHandler() override = default; /// Records if a CFGBlock had a potential use of an uninitialized variable. llvm::BitVector hadUse; @@ -922,4 +922,4 @@ void clang::runUninitializedVariablesAnalysis( } } -UninitVariablesHandler::~UninitVariablesHandler() {} +UninitVariablesHandler::~UninitVariablesHandler() = default; diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 0caa876a57..8c15f25b5b 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -393,7 +393,7 @@ bool DiagnosticsEngine::EmitCurrentDiagnostic(bool Force) { } -DiagnosticConsumer::~DiagnosticConsumer() {} +DiagnosticConsumer::~DiagnosticConsumer() = default; void DiagnosticConsumer::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) { @@ -981,7 +981,7 @@ bool DiagnosticConsumer::IncludeInDiagnosticCounts() const { return true; } void IgnoringDiagConsumer::anchor() { } -ForwardingDiagnosticConsumer::~ForwardingDiagnosticConsumer() {} +ForwardingDiagnosticConsumer::~ForwardingDiagnosticConsumer() = default; void ForwardingDiagnosticConsumer::HandleDiagnostic( DiagnosticsEngine::Level DiagLevel, diff --git a/lib/Basic/FileManager.cpp b/lib/Basic/FileManager.cpp index 21e6ea3ab4..c04ebda130 100644 --- a/lib/Basic/FileManager.cpp +++ b/lib/Basic/FileManager.cpp @@ -605,5 +605,5 @@ void FileManager::PrintStats() const { } // Virtual destructors for abstract base classes that need live in Basic. -PCHContainerWriter::~PCHContainerWriter() {} -PCHContainerReader::~PCHContainerReader() {} +PCHContainerWriter::~PCHContainerWriter() = default; +PCHContainerReader::~PCHContainerReader() = default; diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index 199815aa89..c60789d816 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -53,9 +53,9 @@ IdentifierInfo::IdentifierInfo() { // IdentifierTable Implementation //===----------------------------------------------------------------------===// -IdentifierIterator::~IdentifierIterator() { } +IdentifierIterator::~IdentifierIterator() = default; -IdentifierInfoLookup::~IdentifierInfoLookup() {} +IdentifierInfoLookup::~IdentifierInfoLookup() = default; namespace { /// \brief A simple identifier lookup iterator that represents an diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index 536ae7ff5c..100f6e88f1 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -2204,7 +2204,7 @@ LLVM_DUMP_METHOD void SourceManager::dump() const { } } -ExternalSLocEntrySource::~ExternalSLocEntrySource() { } +ExternalSLocEntrySource::~ExternalSLocEntrySource() = default; /// Return the amount of memory used by memory buffers, breaking down /// by heap-backed versus mmap'ed memory. diff --git a/lib/Basic/TargetInfo.cpp b/lib/Basic/TargetInfo.cpp index 21368f8b11..6cde57d865 100644 --- a/lib/Basic/TargetInfo.cpp +++ b/lib/Basic/TargetInfo.cpp @@ -100,7 +100,7 @@ TargetInfo::TargetInfo(const llvm::Triple &T) : TargetOpts(), Triple(T) { } // Out of line virtual dtor for TargetInfo. -TargetInfo::~TargetInfo() {} +TargetInfo::~TargetInfo() = default; /// getTypeName - Return the user string for the specified integer type enum. /// For example, SignedShort -> "short". diff --git a/lib/Basic/VirtualFileSystem.cpp b/lib/Basic/VirtualFileSystem.cpp index a20132b3de..540116f6c5 100644 --- a/lib/Basic/VirtualFileSystem.cpp +++ b/lib/Basic/VirtualFileSystem.cpp @@ -84,9 +84,9 @@ bool Status::exists() const { return isStatusKnown() && Type != file_type::file_not_found; } -File::~File() {} +File::~File() = default; -FileSystem::~FileSystem() {} +FileSystem::~FileSystem() = default; ErrorOr> FileSystem::getBufferForFile(const llvm::Twine &Name, int64_t FileSize, @@ -315,7 +315,7 @@ OverlayFileSystem::setCurrentWorkingDirectory(const Twine &Path) { return std::error_code(); } -clang::vfs::detail::DirIterImpl::~DirIterImpl() { } +clang::vfs::detail::DirIterImpl::~DirIterImpl() = default; namespace { class OverlayFSDirIterImpl : public clang::vfs::detail::DirIterImpl { @@ -398,7 +398,7 @@ class InMemoryNode { public: InMemoryNode(Status Stat, InMemoryNodeKind Kind) : Stat(std::move(Stat)), Kind(Kind) {} - virtual ~InMemoryNode() {} + virtual ~InMemoryNode() = default; const Status &getStatus() const { return Stat; } InMemoryNodeKind getKind() const { return Kind; } virtual std::string toString(unsigned Indent) const = 0; @@ -482,7 +482,7 @@ InMemoryFileSystem::InMemoryFileSystem(bool UseNormalizedPaths) llvm::sys::fs::perms::all_all))), UseNormalizedPaths(UseNormalizedPaths) {} -InMemoryFileSystem::~InMemoryFileSystem() {} +InMemoryFileSystem::~InMemoryFileSystem() = default; std::string InMemoryFileSystem::toString() const { return Root->toString(/*Indent=*/0); diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp index cfb09e72c7..b09532bbad 100644 --- a/lib/CodeGen/CGBlocks.cpp +++ b/lib/CodeGen/CGBlocks.cpp @@ -40,7 +40,7 @@ CGBlockInfo::CGBlockInfo(const BlockDecl *block, StringRef name) } // Anchor the vtable to this translation unit. -BlockByrefHelpers::~BlockByrefHelpers() {} +BlockByrefHelpers::~BlockByrefHelpers() = default; /// Build the given block as a global block. static llvm::Constant *buildGlobalBlock(CodeGenModule &CGM, diff --git a/lib/CodeGen/CGCUDARuntime.cpp b/lib/CodeGen/CGCUDARuntime.cpp index 014a5dbd46..bd8b034c81 100644 --- a/lib/CodeGen/CGCUDARuntime.cpp +++ b/lib/CodeGen/CGCUDARuntime.cpp @@ -22,7 +22,7 @@ using namespace clang; using namespace CodeGen; -CGCUDARuntime::~CGCUDARuntime() {} +CGCUDARuntime::~CGCUDARuntime() = default; RValue CGCUDARuntime::EmitCUDAKernelCallExpr(CodeGenFunction &CGF, const CUDAKernelCallExpr *E, diff --git a/lib/CodeGen/CGCXXABI.cpp b/lib/CodeGen/CGCXXABI.cpp index 51f1b0730b..5455000f21 100644 --- a/lib/CodeGen/CGCXXABI.cpp +++ b/lib/CodeGen/CGCXXABI.cpp @@ -18,7 +18,7 @@ using namespace clang; using namespace CodeGen; -CGCXXABI::~CGCXXABI() { } +CGCXXABI::~CGCXXABI() = default; void CGCXXABI::ErrorUnsupportedABI(CodeGenFunction &CGF, StringRef S) { DiagnosticsEngine &Diags = CGF.CGM.getDiags(); diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index bb7fdca667..2b8e44ba72 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -584,7 +584,7 @@ struct TypeExpansion { const TypeExpansionKind Kind; TypeExpansion(TypeExpansionKind K) : Kind(K) {} - virtual ~TypeExpansion() {} + virtual ~TypeExpansion() = default; }; struct ConstantArrayExpansion : TypeExpansion { diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index c4b5b43b71..12ea96755c 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -3058,4 +3058,4 @@ CodeGenFunction::EmitBlockCopyAndAutorelease(llvm::Value *Block, QualType Ty) { } -CGObjCRuntime::~CGObjCRuntime() {} +CGObjCRuntime::~CGObjCRuntime() = default; diff --git a/lib/CodeGen/CGOpenCLRuntime.cpp b/lib/CodeGen/CGOpenCLRuntime.cpp index 8af39ceecd..808406a97c 100644 --- a/lib/CodeGen/CGOpenCLRuntime.cpp +++ b/lib/CodeGen/CGOpenCLRuntime.cpp @@ -22,7 +22,7 @@ using namespace clang; using namespace CodeGen; -CGOpenCLRuntime::~CGOpenCLRuntime() {} +CGOpenCLRuntime::~CGOpenCLRuntime() = default; void CGOpenCLRuntime::EmitWorkGroupLocalVarDecl(CodeGenFunction &CGF, const VarDecl &D) { diff --git a/lib/CodeGen/CGOpenMPRuntime.h b/lib/CodeGen/CGOpenMPRuntime.h index dc4238cda6..947f2cf7a9 100644 --- a/lib/CodeGen/CGOpenMPRuntime.h +++ b/lib/CodeGen/CGOpenMPRuntime.h @@ -369,7 +369,7 @@ private: public: explicit CGOpenMPRuntime(CodeGenModule &CGM); - virtual ~CGOpenMPRuntime() {} + virtual ~CGOpenMPRuntime() = default; virtual void clear(); /// \brief Emits outlined function for the specified OpenMP parallel directive diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index 8801c3b3f2..9fbfcf424a 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -1801,7 +1801,7 @@ Address CodeGenFunction::EmitFieldAnnotations(const FieldDecl *D, return Address(V, Addr.getAlignment()); } -CodeGenFunction::CGCapturedStmtInfo::~CGCapturedStmtInfo() { } +CodeGenFunction::CGCapturedStmtInfo::~CGCapturedStmtInfo() = default; CodeGenFunction::SanitizerScope::SanitizerScope(CodeGenFunction *CGF) : CGF(CGF) { diff --git a/lib/CodeGen/CodeGenTBAA.cpp b/lib/CodeGen/CodeGenTBAA.cpp index c3c925cde2..ee232ce773 100644 --- a/lib/CodeGen/CodeGenTBAA.cpp +++ b/lib/CodeGen/CodeGenTBAA.cpp @@ -36,8 +36,7 @@ CodeGenTBAA::CodeGenTBAA(ASTContext &Ctx, llvm::LLVMContext& VMContext, MDHelper(VMContext), Root(nullptr), Char(nullptr) { } -CodeGenTBAA::~CodeGenTBAA() { -} +CodeGenTBAA::~CodeGenTBAA() = default; llvm::MDNode *CodeGenTBAA::getRoot() { // Define the root of the tree. This identifies the tree, so that diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index f76fad16cc..aa54b0a4d4 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -66,7 +66,7 @@ Address ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, return Address::invalid(); } -ABIInfo::~ABIInfo() {} +ABIInfo::~ABIInfo() = default; static CGCXXABI::RecordArgABI getRecordArgABI(const RecordType *RT, CGCXXABI &CXXABI) { diff --git a/lib/Driver/Tool.cpp b/lib/Driver/Tool.cpp index 7142e822f1..6ae3506e65 100644 --- a/lib/Driver/Tool.cpp +++ b/lib/Driver/Tool.cpp @@ -19,5 +19,4 @@ Tool::Tool(const char *_Name, const char *_ShortName, const ToolChain &TC, ResponseSupport(_ResponseSupport), ResponseEncoding(_ResponseEncoding), ResponseFlag(_ResponseFlag) {} -Tool::~Tool() { -} +Tool::~Tool() = default; diff --git a/lib/Driver/ToolChain.cpp b/lib/Driver/ToolChain.cpp index 65d4f4f4e0..e4611d21b6 100644 --- a/lib/Driver/ToolChain.cpp +++ b/lib/Driver/ToolChain.cpp @@ -72,8 +72,7 @@ ToolChain::ToolChain(const Driver &D, const llvm::Triple &T, << A->getValue() << A->getAsString(Args); } -ToolChain::~ToolChain() { -} +ToolChain::~ToolChain() = default; vfs::FileSystem &ToolChain::getVFS() const { return getDriver().getVFS(); } diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 6438ea7606..0687699e4a 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -156,9 +156,9 @@ StringRef MachO::getMachOArchName(const ArgList &Args) const { } } -Darwin::~Darwin() {} +Darwin::~Darwin() = default; -MachO::~MachO() {} +MachO::~MachO() = default; std::string MachO::ComputeEffectiveClangTriple(const ArgList &Args, types::ID InputType) const { @@ -2102,7 +2102,7 @@ Generic_GCC::Generic_GCC(const Driver &D, const llvm::Triple &Triple, getProgramPaths().push_back(getDriver().Dir); } -Generic_GCC::~Generic_GCC() {} +Generic_GCC::~Generic_GCC() = default; Tool *Generic_GCC::getTool(Action::ActionClass AC) const { switch (AC) { @@ -2339,7 +2339,7 @@ HexagonToolChain::HexagonToolChain(const Driver &D, const llvm::Triple &Triple, GetTargetCPU(Args), InstalledDir, LibPaths); } -HexagonToolChain::~HexagonToolChain() {} +HexagonToolChain::~HexagonToolChain() = default; Tool *HexagonToolChain::buildAssembler() const { return new tools::hexagon::Assembler(*this); @@ -2642,7 +2642,7 @@ TCEToolChain::TCEToolChain(const Driver &D, const llvm::Triple &Triple, getProgramPaths().push_back(Path); } -TCEToolChain::~TCEToolChain() {} +TCEToolChain::~TCEToolChain() = default; bool TCEToolChain::IsMathErrnoDefault() const { return true; } @@ -3987,7 +3987,7 @@ MyriadToolChain::MyriadToolChain(const Driver &D, const llvm::Triple &Triple, } } -MyriadToolChain::~MyriadToolChain() {} +MyriadToolChain::~MyriadToolChain() = default; void MyriadToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs, ArgStringList &CC1Args) const { diff --git a/lib/Format/BreakableToken.h b/lib/Format/BreakableToken.h index eb1f9fda30..506d979f2d 100644 --- a/lib/Format/BreakableToken.h +++ b/lib/Format/BreakableToken.h @@ -36,7 +36,7 @@ public: /// \brief Contains starting character index and length of split. typedef std::pair Split; - virtual ~BreakableToken() {} + virtual ~BreakableToken() = default; /// \brief Returns the number of lines in this token in the original code. virtual unsigned getLineCount() const = 0; diff --git a/lib/Format/FormatToken.cpp b/lib/Format/FormatToken.cpp index b293cf25c3..fec48605b0 100644 --- a/lib/Format/FormatToken.cpp +++ b/lib/Format/FormatToken.cpp @@ -67,7 +67,7 @@ bool FormatToken::isSimpleTypeSpecifier() const { } } -TokenRole::~TokenRole() {} +TokenRole::~TokenRole() = default; void TokenRole::precomputeFormattingInfos(const FormatToken *Token) {} diff --git a/lib/Format/UnwrappedLineFormatter.cpp b/lib/Format/UnwrappedLineFormatter.cpp index 6d9b1da49b..100aedcd99 100644 --- a/lib/Format/UnwrappedLineFormatter.cpp +++ b/lib/Format/UnwrappedLineFormatter.cpp @@ -477,7 +477,7 @@ public: UnwrappedLineFormatter *BlockFormatter) : Indenter(Indenter), Whitespaces(Whitespaces), Style(Style), BlockFormatter(BlockFormatter) {} - virtual ~LineFormatter() {} + virtual ~LineFormatter() = default; /// \brief Formats an \c AnnotatedLine and returns the penalty. /// diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp index 634dbe9708..2956f841e7 100644 --- a/lib/Format/UnwrappedLineParser.cpp +++ b/lib/Format/UnwrappedLineParser.cpp @@ -25,7 +25,7 @@ namespace format { class FormatTokenSource { public: - virtual ~FormatTokenSource() {} + virtual ~FormatTokenSource() = default; virtual FormatToken *getNextToken() = 0; virtual unsigned getPosition() = 0; diff --git a/lib/Format/UnwrappedLineParser.h b/lib/Format/UnwrappedLineParser.h index c2fa029576..88c0dc5cb7 100644 --- a/lib/Format/UnwrappedLineParser.h +++ b/lib/Format/UnwrappedLineParser.h @@ -51,7 +51,7 @@ struct UnwrappedLine { class UnwrappedLineConsumer { public: - virtual ~UnwrappedLineConsumer() {} + virtual ~UnwrappedLineConsumer() = default; virtual void consumeUnwrappedLine(const UnwrappedLine &Line) = 0; virtual void finishRun() = 0; }; diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp index d3d7185ea3..1696e36418 100644 --- a/lib/Frontend/ASTUnit.cpp +++ b/lib/Frontend/ASTUnit.cpp @@ -2841,7 +2841,7 @@ void ASTUnit::ConcurrencyState::finish() { #else // NDEBUG ASTUnit::ConcurrencyState::ConcurrencyState() { Mutex = nullptr; } -ASTUnit::ConcurrencyState::~ConcurrencyState() {} +ASTUnit::ConcurrencyState::~ConcurrencyState() = default; void ASTUnit::ConcurrencyState::start() {} void ASTUnit::ConcurrencyState::finish() {} diff --git a/lib/Frontend/CacheTokens.cpp b/lib/Frontend/CacheTokens.cpp index 7d2a09cd7c..9f64185555 100644 --- a/lib/Frontend/CacheTokens.cpp +++ b/lib/Frontend/CacheTokens.cpp @@ -47,7 +47,7 @@ class PTHEntry { Offset TokenData, PPCondData; public: - PTHEntry() {} + PTHEntry() = default; PTHEntry(Offset td, Offset ppcd) : TokenData(td), PPCondData(ppcd) {} @@ -547,7 +547,7 @@ class StatListener : public FileSystemStatCache { PTHMap &PM; public: StatListener(PTHMap &pm) : PM(pm) {} - ~StatListener() override {} + ~StatListener() override = default; LookupResult getStat(const char *Path, FileData &Data, bool isFile, std::unique_ptr *F, diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 6e234112d7..b5ac59990f 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -59,7 +59,7 @@ CompilerInvocationBase::CompilerInvocationBase(const CompilerInvocationBase &X) HeaderSearchOpts(new HeaderSearchOptions(X.getHeaderSearchOpts())), PreprocessorOpts(new PreprocessorOptions(X.getPreprocessorOpts())) {} -CompilerInvocationBase::~CompilerInvocationBase() {} +CompilerInvocationBase::~CompilerInvocationBase() = default; //===----------------------------------------------------------------------===// // Deserialization (from args) diff --git a/lib/Frontend/DependencyFile.cpp b/lib/Frontend/DependencyFile.cpp index 93d4a80346..15ddb702cb 100644 --- a/lib/Frontend/DependencyFile.cpp +++ b/lib/Frontend/DependencyFile.cpp @@ -137,7 +137,7 @@ bool DependencyCollector::sawDependency(StringRef Filename, bool FromModule, (needSystemDependencies() || !IsSystem); } -DependencyCollector::~DependencyCollector() { } +DependencyCollector::~DependencyCollector() = default; void DependencyCollector::attachToPreprocessor(Preprocessor &PP) { PP.addPPCallbacks( llvm::make_unique(*this, PP.getSourceManager())); diff --git a/lib/Frontend/DiagnosticRenderer.cpp b/lib/Frontend/DiagnosticRenderer.cpp index 6ef9a89d86..b8d4124f17 100644 --- a/lib/Frontend/DiagnosticRenderer.cpp +++ b/lib/Frontend/DiagnosticRenderer.cpp @@ -69,7 +69,7 @@ DiagnosticRenderer::DiagnosticRenderer(const LangOptions &LangOpts, DiagnosticOptions *DiagOpts) : LangOpts(LangOpts), DiagOpts(DiagOpts), LastLevel() {} -DiagnosticRenderer::~DiagnosticRenderer() {} +DiagnosticRenderer::~DiagnosticRenderer() = default; namespace { @@ -577,7 +577,7 @@ void DiagnosticRenderer::emitMacroExpansions(SourceLocation Loc, emitSingleMacroExpansion(*I, Level, Ranges, SM); } -DiagnosticNoteRenderer::~DiagnosticNoteRenderer() {} +DiagnosticNoteRenderer::~DiagnosticNoteRenderer() = default; void DiagnosticNoteRenderer::emitIncludeLocation(SourceLocation Loc, PresumedLoc PLoc, diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index ecef92e0a7..3c6c7d5a44 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -126,7 +126,7 @@ public: FrontendAction::FrontendAction() : Instance(nullptr) {} -FrontendAction::~FrontendAction() {} +FrontendAction::~FrontendAction() = default; void FrontendAction::setCurrentInput(const FrontendInputFile &CurrentInput, std::unique_ptr AST) { diff --git a/lib/Frontend/MultiplexConsumer.cpp b/lib/Frontend/MultiplexConsumer.cpp index 91ee100f63..226e33da45 100644 --- a/lib/Frontend/MultiplexConsumer.cpp +++ b/lib/Frontend/MultiplexConsumer.cpp @@ -262,7 +262,7 @@ MultiplexConsumer::MultiplexConsumer( } } -MultiplexConsumer::~MultiplexConsumer() {} +MultiplexConsumer::~MultiplexConsumer() = default; void MultiplexConsumer::Initialize(ASTContext &Context) { for (auto &Consumer : Consumers) diff --git a/lib/Frontend/Rewrite/FixItRewriter.cpp b/lib/Frontend/Rewrite/FixItRewriter.cpp index dc787ac955..8daf2ce41b 100644 --- a/lib/Frontend/Rewrite/FixItRewriter.cpp +++ b/lib/Frontend/Rewrite/FixItRewriter.cpp @@ -200,4 +200,4 @@ void FixItRewriter::Diag(SourceLocation Loc, unsigned DiagID) { Diags.setClient(this, false); } -FixItOptions::~FixItOptions() {} +FixItOptions::~FixItOptions() = default; diff --git a/lib/Frontend/Rewrite/FrontendActions.cpp b/lib/Frontend/Rewrite/FrontendActions.cpp index 8cf8adf37e..d3a22ce9ad 100644 --- a/lib/Frontend/Rewrite/FrontendActions.cpp +++ b/lib/Frontend/Rewrite/FrontendActions.cpp @@ -38,7 +38,7 @@ HTMLPrintAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { } FixItAction::FixItAction() {} -FixItAction::~FixItAction() {} +FixItAction::~FixItAction() = default; std::unique_ptr FixItAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { diff --git a/lib/Frontend/Rewrite/RewriteModernObjC.cpp b/lib/Frontend/Rewrite/RewriteModernObjC.cpp index 2902ba78c4..3523783b5c 100644 --- a/lib/Frontend/Rewrite/RewriteModernObjC.cpp +++ b/lib/Frontend/Rewrite/RewriteModernObjC.cpp @@ -244,7 +244,7 @@ namespace { DiagnosticsEngine &D, const LangOptions &LOpts, bool silenceMacroWarn, bool LineInfo); - ~RewriteModernObjC() override {} + ~RewriteModernObjC() override = default; void HandleTranslationUnit(ASTContext &C) override; diff --git a/lib/Frontend/Rewrite/RewriteObjC.cpp b/lib/Frontend/Rewrite/RewriteObjC.cpp index 204820b304..9d9be2cbc3 100644 --- a/lib/Frontend/Rewrite/RewriteObjC.cpp +++ b/lib/Frontend/Rewrite/RewriteObjC.cpp @@ -193,7 +193,7 @@ namespace { DiagnosticsEngine &D, const LangOptions &LOpts, bool silenceMacroWarn); - ~RewriteObjC() override {} + ~RewriteObjC() override = default; void HandleTranslationUnit(ASTContext &C) override; @@ -512,7 +512,7 @@ namespace { D, LOpts, silenceMacroWarn) {} - ~RewriteObjCFragileABI() override {} + ~RewriteObjCFragileABI() override = default; void Initialize(ASTContext &context) override; // Rewriting metadata diff --git a/lib/Frontend/SerializedDiagnosticPrinter.cpp b/lib/Frontend/SerializedDiagnosticPrinter.cpp index 1bf10d2769..1cf886ce7b 100644 --- a/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/lib/Frontend/SerializedDiagnosticPrinter.cpp @@ -62,7 +62,7 @@ public: DiagnosticOptions *DiagOpts) : DiagnosticNoteRenderer(LangOpts, DiagOpts), Writer(Writer) {} - ~SDiagsRenderer() override {} + ~SDiagsRenderer() override = default; protected: void emitDiagnosticMessage(SourceLocation Loc, @@ -159,7 +159,7 @@ public: EmitPreamble(); } - ~SDiagsWriter() override {} + ~SDiagsWriter() override = default; void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) override; diff --git a/lib/Frontend/TextDiagnostic.cpp b/lib/Frontend/TextDiagnostic.cpp index d4e156d445..938fe58ea8 100644 --- a/lib/Frontend/TextDiagnostic.cpp +++ b/lib/Frontend/TextDiagnostic.cpp @@ -669,7 +669,7 @@ TextDiagnostic::TextDiagnostic(raw_ostream &OS, DiagnosticOptions *DiagOpts) : DiagnosticRenderer(LangOpts, DiagOpts), OS(OS) {} -TextDiagnostic::~TextDiagnostic() {} +TextDiagnostic::~TextDiagnostic() = default; void TextDiagnostic::emitDiagnosticMessage(SourceLocation Loc, diff --git a/lib/Index/CommentToXML.cpp b/lib/Index/CommentToXML.cpp index 15f1696cbe..df103db1de 100644 --- a/lib/Index/CommentToXML.cpp +++ b/lib/Index/CommentToXML.cpp @@ -1128,7 +1128,7 @@ void CommentASTToXMLConverter::appendToResultWithCDATAEscaping(StringRef S) { } CommentToXMLConverter::CommentToXMLConverter() : FormatInMemoryUniqueId(0) {} -CommentToXMLConverter::~CommentToXMLConverter() {} +CommentToXMLConverter::~CommentToXMLConverter() = default; void CommentToXMLConverter::convertCommentToHTML(const FullComment *FC, SmallVectorImpl &HTML, diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp index 469d782deb..79564ca2d5 100644 --- a/lib/Lex/HeaderSearch.cpp +++ b/lib/Lex/HeaderSearch.cpp @@ -50,7 +50,7 @@ HeaderFileInfo::getControllingMacro(ExternalPreprocessorSource *External) { return ControllingMacro; } -ExternalHeaderFileInfoSource::~ExternalHeaderFileInfoSource() {} +ExternalHeaderFileInfoSource::~ExternalHeaderFileInfoSource() = default; HeaderSearch::HeaderSearch(IntrusiveRefCntPtr HSOpts, SourceManager &SourceMgr, DiagnosticsEngine &Diags, diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp index c231e18eec..8f5171880a 100644 --- a/lib/Lex/PPLexerChange.cpp +++ b/lib/Lex/PPLexerChange.cpp @@ -24,7 +24,7 @@ #include "llvm/Support/Path.h" using namespace clang; -PPCallbacks::~PPCallbacks() {} +PPCallbacks::~PPCallbacks() = default; //===----------------------------------------------------------------------===// // Miscellaneous Methods. diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp index 5f63d35c5b..f1a625a882 100644 --- a/lib/Lex/PTHLexer.cpp +++ b/lib/Lex/PTHLexer.cpp @@ -424,8 +424,7 @@ PTHManager::PTHManager( StringIdLookup(std::move(stringIdLookup)), NumIds(numIds), PP(nullptr), SpellingBase(spellingBase), OriginalSourceFile(originalSourceFile) {} -PTHManager::~PTHManager() { -} +PTHManager::~PTHManager() = default; static void InvalidPTH(DiagnosticsEngine &Diags, const char *Msg) { Diags.Report(Diags.getCustomDiagID(DiagnosticsEngine::Error, "%0")) << Msg; diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index 3134790ccb..1f158cf5e3 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -31,8 +31,7 @@ using namespace clang; #include "llvm/Support/raw_ostream.h" // Out-of-line destructor to provide a home for the class. -PragmaHandler::~PragmaHandler() { -} +PragmaHandler::~PragmaHandler() = default; //===----------------------------------------------------------------------===// // EmptyPragmaHandler Implementation. diff --git a/lib/Lex/PreprocessingRecord.cpp b/lib/Lex/PreprocessingRecord.cpp index 32e6de69f0..d01dfca8b6 100644 --- a/lib/Lex/PreprocessingRecord.cpp +++ b/lib/Lex/PreprocessingRecord.cpp @@ -19,7 +19,7 @@ using namespace clang; -ExternalPreprocessingRecordSource::~ExternalPreprocessingRecordSource() { } +ExternalPreprocessingRecordSource::~ExternalPreprocessingRecordSource() = default; InclusionDirective::InclusionDirective(PreprocessingRecord &PPRec, diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 869890b46c..7b1f78a510 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -53,7 +53,7 @@ using namespace clang; //===----------------------------------------------------------------------===// -ExternalPreprocessorSource::~ExternalPreprocessorSource() { } +ExternalPreprocessorSource::~ExternalPreprocessorSource() = default; Preprocessor::Preprocessor(IntrusiveRefCntPtr PPOpts, DiagnosticsEngine &diags, LangOptions &opts, @@ -897,11 +897,11 @@ bool Preprocessor::HandleComment(Token &result, SourceRange Comment) { return true; } -ModuleLoader::~ModuleLoader() { } +ModuleLoader::~ModuleLoader() = default; -CommentHandler::~CommentHandler() { } +CommentHandler::~CommentHandler() = default; -CodeCompletionHandler::~CodeCompletionHandler() { } +CodeCompletionHandler::~CodeCompletionHandler() = default; void Preprocessor::createPreprocessingRecord() { if (Record) diff --git a/lib/Parse/ParseCXXInlineMethods.cpp b/lib/Parse/ParseCXXInlineMethods.cpp index ab1f97d31a..82fef5ace4 100644 --- a/lib/Parse/ParseCXXInlineMethods.cpp +++ b/lib/Parse/ParseCXXInlineMethods.cpp @@ -222,7 +222,7 @@ void Parser::ParseCXXNonStaticMemberInitializer(Decl *VarD) { Toks.push_back(Eof); } -Parser::LateParsedDeclaration::~LateParsedDeclaration() {} +Parser::LateParsedDeclaration::~LateParsedDeclaration() = default; void Parser::LateParsedDeclaration::ParseLexedMethodDeclarations() {} void Parser::LateParsedDeclaration::ParseLexedMemberInitializers() {} void Parser::LateParsedDeclaration::ParseLexedMethodDefs() {} diff --git a/lib/Rewrite/TokenRewriter.cpp b/lib/Rewrite/TokenRewriter.cpp index 494defdeda..cc2ed1350a 100644 --- a/lib/Rewrite/TokenRewriter.cpp +++ b/lib/Rewrite/TokenRewriter.cpp @@ -46,8 +46,7 @@ TokenRewriter::TokenRewriter(FileID FID, SourceManager &SM, } } -TokenRewriter::~TokenRewriter() { -} +TokenRewriter::~TokenRewriter() = default; /// RemapIterator - Convert from token_iterator (a const iterator) to diff --git a/lib/Sema/AttributeList.cpp b/lib/Sema/AttributeList.cpp index 3c61c95ad8..02986deacc 100644 --- a/lib/Sema/AttributeList.cpp +++ b/lib/Sema/AttributeList.cpp @@ -44,7 +44,7 @@ AttributeFactory::AttributeFactory() { // Go ahead and configure all the inline capacity. This is just a memset. FreeLists.resize(InlineFreeListsCapacity); } -AttributeFactory::~AttributeFactory() {} +AttributeFactory::~AttributeFactory() = default; static size_t getFreeListIndexForSize(size_t size) { assert(size >= sizeof(AttributeList)); diff --git a/lib/Sema/CodeCompleteConsumer.cpp b/lib/Sema/CodeCompleteConsumer.cpp index 18e9a59116..708d9f5875 100644 --- a/lib/Sema/CodeCompleteConsumer.cpp +++ b/lib/Sema/CodeCompleteConsumer.cpp @@ -426,7 +426,7 @@ CodeCompleteConsumer::OverloadCandidate::getFunctionType() const { // Code completion consumer implementation //===----------------------------------------------------------------------===// -CodeCompleteConsumer::~CodeCompleteConsumer() { } +CodeCompleteConsumer::~CodeCompleteConsumer() = default; void PrintingCodeCompleteConsumer::ProcessCodeCompleteResults(Sema &SemaRef, diff --git a/lib/Sema/MultiplexExternalSemaSource.cpp b/lib/Sema/MultiplexExternalSemaSource.cpp index 0f93421ac2..5d0effc5a5 100644 --- a/lib/Sema/MultiplexExternalSemaSource.cpp +++ b/lib/Sema/MultiplexExternalSemaSource.cpp @@ -28,7 +28,7 @@ MultiplexExternalSemaSource::MultiplexExternalSemaSource(ExternalSemaSource &s1, } // pin the vtable here. -MultiplexExternalSemaSource::~MultiplexExternalSemaSource() {} +MultiplexExternalSemaSource::~MultiplexExternalSemaSource() = default; ///\brief Appends new source to the source list. /// diff --git a/lib/Sema/ScopeInfo.cpp b/lib/Sema/ScopeInfo.cpp index ba8c3642bc..a06375816f 100644 --- a/lib/Sema/ScopeInfo.cpp +++ b/lib/Sema/ScopeInfo.cpp @@ -232,6 +232,6 @@ void LambdaScopeInfo::getPotentialVariableCapture(unsigned Idx, VarDecl *&VD, assert(VD); } -FunctionScopeInfo::~FunctionScopeInfo() { } -BlockScopeInfo::~BlockScopeInfo() { } -CapturedRegionScopeInfo::~CapturedRegionScopeInfo() { } +FunctionScopeInfo::~FunctionScopeInfo() = default; +BlockScopeInfo::~BlockScopeInfo() = default; +CapturedRegionScopeInfo::~CapturedRegionScopeInfo() = default; diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 300e2f040a..bac323712e 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -1255,7 +1255,7 @@ void Sema::ActOnComment(SourceRange Comment) { } // Pin this vtable to this file. -ExternalSemaSource::~ExternalSemaSource() {} +ExternalSemaSource::~ExternalSemaSource() = default; void ExternalSemaSource::ReadMethodPool(Selector Sel) { } diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 588ae3d88e..1d027d5f07 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -9567,8 +9567,8 @@ protected: } public: - ExprBuilder() {} - virtual ~ExprBuilder() {} + ExprBuilder() = default; + virtual ~ExprBuilder() = default; virtual Expr *build(Sema &S, SourceLocation Loc) const = 0; }; diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 6fbe0da8c9..556e5bb8dc 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -3172,7 +3172,7 @@ void Sema::ArgumentDependentLookup(DeclarationName Name, SourceLocation Loc, //---------------------------------------------------------------------------- // Search for all visible declarations. //---------------------------------------------------------------------------- -VisibleDeclConsumer::~VisibleDeclConsumer() { } +VisibleDeclConsumer::~VisibleDeclConsumer() = default; bool VisibleDeclConsumer::includeHiddenDecls() const { return false; } diff --git a/lib/Sema/SemaOpenMP.cpp b/lib/Sema/SemaOpenMP.cpp index c4e1b26e7c..db658de7d9 100644 --- a/lib/Sema/SemaOpenMP.cpp +++ b/lib/Sema/SemaOpenMP.cpp @@ -56,7 +56,7 @@ private: ArrayRef Arr; }; struct MatchesAlways { - MatchesAlways() {} + MatchesAlways() = default; template bool operator()(T) { return true; } }; diff --git a/lib/Sema/SemaPseudoObject.cpp b/lib/Sema/SemaPseudoObject.cpp index 8998a7e8bc..f8974adfac 100644 --- a/lib/Sema/SemaPseudoObject.cpp +++ b/lib/Sema/SemaPseudoObject.cpp @@ -202,7 +202,7 @@ namespace { : S(S), ResultIndex(PseudoObjectExpr::NoResult), GenericLoc(genericLoc) {} - virtual ~PseudoOpBuilder() {} + virtual ~PseudoOpBuilder() = default; /// Add a normal semantic expression. void addSemanticExpr(Expr *semantic) { diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 31d69cbac3..9378c98899 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -3600,7 +3600,7 @@ public: const TemplateArgumentLoc *operator->() const { return &Arg; } }; - TemplateArgumentLocInventIterator() { } + TemplateArgumentLocInventIterator() = default; explicit TemplateArgumentLocInventIterator(TreeTransform &Self, InputIterator Iter) @@ -5249,7 +5249,7 @@ QualType TreeTransform::TransformAtomicType(TypeLocBuilder &TLB, }; - TemplateArgumentLocContainerIterator() {} + TemplateArgumentLocContainerIterator() = default; TemplateArgumentLocContainerIterator(ArgLocContainer &Container, unsigned Index) diff --git a/lib/Serialization/ASTCommon.cpp b/lib/Serialization/ASTCommon.cpp index ec1a936684..3839fdd187 100644 --- a/lib/Serialization/ASTCommon.cpp +++ b/lib/Serialization/ASTCommon.cpp @@ -21,7 +21,7 @@ using namespace clang; // Give ASTDeserializationListener's VTable a home. -ASTDeserializationListener::~ASTDeserializationListener() { } +ASTDeserializationListener::~ASTDeserializationListener() = default; serialization::TypeIdx serialization::TypeIdxFromBuiltin(const BuiltinType *BT) { diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index 59347de9c1..5e3d7622fa 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -164,7 +164,7 @@ bool ChainedASTReaderListener::visitInputFile(StringRef Filename, // PCH validator implementation //===----------------------------------------------------------------------===// -ASTReaderListener::~ASTReaderListener() {} +ASTReaderListener::~ASTReaderListener() = default; /// \brief Compare the given set of language options against an existing set of /// language options. diff --git a/lib/Serialization/GeneratePCH.cpp b/lib/Serialization/GeneratePCH.cpp index 9de2fdb75a..0b9acbe5ff 100644 --- a/lib/Serialization/GeneratePCH.cpp +++ b/lib/Serialization/GeneratePCH.cpp @@ -34,8 +34,7 @@ PCHGenerator::PCHGenerator(const Preprocessor &PP, StringRef OutputFile, Buffer->IsComplete = false; } -PCHGenerator::~PCHGenerator() { -} +PCHGenerator::~PCHGenerator() = default; void PCHGenerator::HandleTranslationUnit(ASTContext &Ctx) { // Don't create a PCH if there were fatal failures during module loading. diff --git a/lib/Serialization/MultiOnDiskHashTable.h b/lib/Serialization/MultiOnDiskHashTable.h index 04dea83169..6b81f1eb3d 100644 --- a/lib/Serialization/MultiOnDiskHashTable.h +++ b/lib/Serialization/MultiOnDiskHashTable.h @@ -161,7 +161,7 @@ private: friend class MultiOnDiskHashTableGenerator; public: - MultiOnDiskHashTable() {} + MultiOnDiskHashTable() = default; MultiOnDiskHashTable(MultiOnDiskHashTable &&O) : Tables(std::move(O.Tables)), PendingOverrides(std::move(O.PendingOverrides)) { diff --git a/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp b/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp index 5d8baf6ba7..8e304f7162 100644 --- a/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp @@ -142,7 +142,7 @@ public: : cfg(cfg), Ctx(ctx), BR(br), Checker(checker), AC(ac), Parents(parents), Escaped(escaped), currentBlock(nullptr) {} - ~DeadStoreObs() override {} + ~DeadStoreObs() override = default; bool isLive(const LiveVariables::LivenessValues &Live, const VarDecl *D) { if (Live.isLive(D)) diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp index 56d57c5014..1b17e7a6e2 100644 --- a/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/lib/StaticAnalyzer/Core/BugReporter.cpp @@ -46,7 +46,7 @@ STATISTIC(MaxValidBugClassSize, "The maximum number of bug reports in the same equivalence class " "where at least one report is valid (not suppressed)"); -BugReporterVisitor::~BugReporterVisitor() {} +BugReporterVisitor::~BugReporterVisitor() = default; void BugReporterContext::anchor() {} @@ -2731,9 +2731,9 @@ PathDiagnosticLocation BugReport::getLocation(const SourceManager &SM) const { // Methods for BugReporter and subclasses. //===----------------------------------------------------------------------===// -BugReportEquivClass::~BugReportEquivClass() { } -GRBugReporter::~GRBugReporter() { } -BugReporterData::~BugReporterData() {} +BugReportEquivClass::~BugReportEquivClass() = default; +GRBugReporter::~GRBugReporter() = default; +BugReporterData::~BugReporterData() = default; ExplodedGraph &GRBugReporter::getGraph() { return Eng.getGraph(); } diff --git a/lib/StaticAnalyzer/Core/ConstraintManager.cpp b/lib/StaticAnalyzer/Core/ConstraintManager.cpp index b7db8333aa..cf35f9879f 100644 --- a/lib/StaticAnalyzer/Core/ConstraintManager.cpp +++ b/lib/StaticAnalyzer/Core/ConstraintManager.cpp @@ -16,7 +16,7 @@ using namespace clang; using namespace ento; -ConstraintManager::~ConstraintManager() {} +ConstraintManager::~ConstraintManager() = default; static DefinedSVal getLocFromSymbol(const ProgramStateRef &State, SymbolRef Sym) { diff --git a/lib/StaticAnalyzer/Core/CoreEngine.cpp b/lib/StaticAnalyzer/Core/CoreEngine.cpp index 39cf7e7717..58f81ebc53 100644 --- a/lib/StaticAnalyzer/Core/CoreEngine.cpp +++ b/lib/StaticAnalyzer/Core/CoreEngine.cpp @@ -38,7 +38,7 @@ STATISTIC(NumPathsExplored, // Worklist classes for exploration of reachable states. //===----------------------------------------------------------------------===// -WorkList::Visitor::~Visitor() {} +WorkList::Visitor::~Visitor() = default; namespace { class DFS : public WorkList { @@ -100,7 +100,7 @@ public: // Place the dstor for WorkList here because it contains virtual member // functions, and we the code for the dstor generated in one compilation unit. -WorkList::~WorkList() {} +WorkList::~WorkList() = default; WorkList *WorkList::makeDFS() { return new DFS(); } WorkList *WorkList::makeBFS() { return new BFS(); } diff --git a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp index 8a09720b2a..b9dc1c363c 100644 --- a/lib/StaticAnalyzer/Core/ExplodedGraph.cpp +++ b/lib/StaticAnalyzer/Core/ExplodedGraph.cpp @@ -31,7 +31,7 @@ using namespace ento; //===----------------------------------------------------------------------===// // An out of line virtual method to provide a home for the class vtable. -ExplodedNode::Auditor::~Auditor() {} +ExplodedNode::Auditor::~Auditor() = default; #ifndef NDEBUG static ExplodedNode::Auditor* NodeAuditor = nullptr; @@ -50,7 +50,7 @@ void ExplodedNode::SetAuditor(ExplodedNode::Auditor* A) { ExplodedGraph::ExplodedGraph() : NumNodes(0), ReclaimNodeInterval(0) {} -ExplodedGraph::~ExplodedGraph() {} +ExplodedGraph::~ExplodedGraph() = default; //===----------------------------------------------------------------------===// // Node reclamation. diff --git a/lib/StaticAnalyzer/Core/MemRegion.cpp b/lib/StaticAnalyzer/Core/MemRegion.cpp index d41fed0619..7946db4d38 100644 --- a/lib/StaticAnalyzer/Core/MemRegion.cpp +++ b/lib/StaticAnalyzer/Core/MemRegion.cpp @@ -135,12 +135,11 @@ RegionTy* MemRegionManager::getSubRegion(const A1 a1, const A2 a2, const A3 a3, // Object destruction. //===----------------------------------------------------------------------===// -MemRegion::~MemRegion() {} +MemRegion::~MemRegion() = default; -MemRegionManager::~MemRegionManager() { - // All regions and their data are BumpPtrAllocated. No need to call - // their destructors. -} +// All regions and their data are BumpPtrAllocated. No need to call their +// destructors. +MemRegionManager::~MemRegionManager() = default; //===----------------------------------------------------------------------===// // Basic methods. diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp index 504df30de8..e5b473212e 100644 --- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp @@ -55,11 +55,11 @@ PathDiagnosticPiece::PathDiagnosticPiece(StringRef s, PathDiagnosticPiece::PathDiagnosticPiece(Kind k, DisplayHint hint) : kind(k), Hint(hint), LastInMainSourceFile(false) {} -PathDiagnosticPiece::~PathDiagnosticPiece() {} -PathDiagnosticEventPiece::~PathDiagnosticEventPiece() {} -PathDiagnosticCallPiece::~PathDiagnosticCallPiece() {} -PathDiagnosticControlFlowPiece::~PathDiagnosticControlFlowPiece() {} -PathDiagnosticMacroPiece::~PathDiagnosticMacroPiece() {} +PathDiagnosticPiece::~PathDiagnosticPiece() = default; +PathDiagnosticEventPiece::~PathDiagnosticEventPiece() = default; +PathDiagnosticCallPiece::~PathDiagnosticCallPiece() = default; +PathDiagnosticControlFlowPiece::~PathDiagnosticControlFlowPiece() = default; +PathDiagnosticMacroPiece::~PathDiagnosticMacroPiece() = default; void PathPieces::flattenTo(PathPieces &Primary, PathPieces &Current, @@ -103,7 +103,7 @@ void PathPieces::flattenTo(PathPieces &Primary, PathPieces &Current, } -PathDiagnostic::~PathDiagnostic() {} +PathDiagnostic::~PathDiagnostic() = default; PathDiagnostic::PathDiagnostic(StringRef CheckName, const Decl *declWithIssue, StringRef bugtype, StringRef verboseDesc, @@ -1119,7 +1119,7 @@ void PathDiagnostic::FullProfile(llvm::FoldingSetNodeID &ID) const { ID.AddString(*I); } -StackHintGenerator::~StackHintGenerator() {} +StackHintGenerator::~StackHintGenerator() = default; std::string StackHintGeneratorForSymbol::getMessage(const ExplodedNode *N){ ProgramPoint P = N->getLocation(); diff --git a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp index 59ed921c25..557774a894 100644 --- a/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ b/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -37,7 +37,7 @@ namespace { const LangOptions &LangOpts, bool supportsMultipleFiles); - ~PlistDiagnostics() override {} + ~PlistDiagnostics() override = default; void FlushDiagnosticsImpl(std::vector &Diags, FilesMade *filesMade) override; diff --git a/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp b/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp index 4051242434..9ed1aa5057 100644 --- a/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp +++ b/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp @@ -21,7 +21,7 @@ namespace clang { namespace ento { -SimpleConstraintManager::~SimpleConstraintManager() {} +SimpleConstraintManager::~SimpleConstraintManager() = default; bool SimpleConstraintManager::canReasonAbout(SVal X) const { Optional SymVal = X.getAs(); diff --git a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp index a704ce2245..6e18941f07 100644 --- a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp +++ b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp @@ -29,7 +29,7 @@ public: SimpleSValBuilder(llvm::BumpPtrAllocator &alloc, ASTContext &context, ProgramStateManager &stateMgr) : SValBuilder(alloc, context, stateMgr) {} - ~SimpleSValBuilder() override {} + ~SimpleSValBuilder() override = default; SVal evalMinus(NonLoc val) override; SVal evalComplement(NonLoc val) override; diff --git a/lib/StaticAnalyzer/Core/Store.cpp b/lib/StaticAnalyzer/Core/Store.cpp index 7cdb55a597..245f6ad26d 100644 --- a/lib/StaticAnalyzer/Core/Store.cpp +++ b/lib/StaticAnalyzer/Core/Store.cpp @@ -489,7 +489,7 @@ SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset, Ctx)); } -StoreManager::BindingsHandler::~BindingsHandler() {} +StoreManager::BindingsHandler::~BindingsHandler() = default; bool StoreManager::FindUniqueBinding::HandleBinding(StoreManager& SMgr, Store store, diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index ca92ffe8f0..13af3c1c71 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -92,7 +92,7 @@ class ClangDiagPathDiagConsumer : public PathDiagnosticConsumer { public: ClangDiagPathDiagConsumer(DiagnosticsEngine &Diag) : Diag(Diag), IncludePath(false) {} - ~ClangDiagPathDiagConsumer() override {} + ~ClangDiagPathDiagConsumer() override = default; StringRef getName() const override { return "ClangDiags"; } bool supportsLogicalOpControlFlow() const override { return true; } diff --git a/lib/Tooling/CompilationDatabase.cpp b/lib/Tooling/CompilationDatabase.cpp index 957e40137e..cdbfe5190a 100644 --- a/lib/Tooling/CompilationDatabase.cpp +++ b/lib/Tooling/CompilationDatabase.cpp @@ -32,7 +32,7 @@ using namespace clang; using namespace tooling; -CompilationDatabase::~CompilationDatabase() {} +CompilationDatabase::~CompilationDatabase() = default; std::unique_ptr CompilationDatabase::loadFromDirectory(StringRef BuildDirectory, @@ -106,7 +106,7 @@ CompilationDatabase::autoDetectFromDirectory(StringRef SourceDir, return DB; } -CompilationDatabasePlugin::~CompilationDatabasePlugin() {} +CompilationDatabasePlugin::~CompilationDatabasePlugin() = default; namespace { // Helper for recursively searching through a chain of actions and collecting diff --git a/lib/Tooling/Tooling.cpp b/lib/Tooling/Tooling.cpp index 220b62558b..53f6e06101 100644 --- a/lib/Tooling/Tooling.cpp +++ b/lib/Tooling/Tooling.cpp @@ -37,9 +37,9 @@ namespace clang { namespace tooling { -ToolAction::~ToolAction() {} +ToolAction::~ToolAction() = default; -FrontendActionFactory::~FrontendActionFactory() {} +FrontendActionFactory::~FrontendActionFactory() = default; // FIXME: This file contains structural duplication with other parts of the // code that sets up a compiler to run tools on it, and we should refactor @@ -319,7 +319,7 @@ ClangTool::ClangTool(const CompilationDatabase &Compilations, appendArgumentsAdjuster(getClangSyntaxOnlyAdjuster()); } -ClangTool::~ClangTool() {} +ClangTool::~ClangTool() = default; void ClangTool::mapVirtualFile(StringRef FilePath, StringRef Content) { MappedFileContents.push_back(std::make_pair(FilePath, Content)); diff --git a/tools/diagtool/DiagTool.cpp b/tools/diagtool/DiagTool.cpp index 0e4d8088c6..a8f4e1e37f 100644 --- a/tools/diagtool/DiagTool.cpp +++ b/tools/diagtool/DiagTool.cpp @@ -22,7 +22,7 @@ DiagTool::DiagTool(llvm::StringRef toolCmd, llvm::StringRef toolDesc) : cmd(toolCmd), description(toolDesc) {} -DiagTool::~DiagTool() {} +DiagTool::~DiagTool() = default; typedef llvm::StringMap ToolMap; static inline ToolMap *getTools(void *v) { return static_cast(v); } diff --git a/tools/libclang/CIndexDiagnostic.cpp b/tools/libclang/CIndexDiagnostic.cpp index 9ba36a6a0f..68f0353714 100644 --- a/tools/libclang/CIndexDiagnostic.cpp +++ b/tools/libclang/CIndexDiagnostic.cpp @@ -30,14 +30,14 @@ using namespace clang::cxloc; using namespace clang::cxdiag; using namespace llvm; -CXDiagnosticSetImpl::~CXDiagnosticSetImpl() {} +CXDiagnosticSetImpl::~CXDiagnosticSetImpl() = default; void CXDiagnosticSetImpl::appendDiagnostic(std::unique_ptr D) { Diagnostics.push_back(std::move(D)); } -CXDiagnosticImpl::~CXDiagnosticImpl() {} +CXDiagnosticImpl::~CXDiagnosticImpl() = default; namespace { class CXDiagnosticCustomNoteImpl : public CXDiagnosticImpl { @@ -48,7 +48,7 @@ public: : CXDiagnosticImpl(CustomNoteDiagnosticKind), Message(Msg), Loc(L) {} - ~CXDiagnosticCustomNoteImpl() override {} + ~CXDiagnosticCustomNoteImpl() override = default; CXDiagnosticSeverity getSeverity() const override { return CXDiagnostic_Note; @@ -92,7 +92,7 @@ public: : DiagnosticNoteRenderer(LangOpts, DiagOpts), CurrentSet(mainSet), MainSet(mainSet) {} - ~CXDiagnosticRenderer() override {} + ~CXDiagnosticRenderer() override = default; void beginDiagnostic(DiagOrStoredDiag D, DiagnosticsEngine::Level Level) override { diff --git a/tools/libclang/CIndexDiagnostic.h b/tools/libclang/CIndexDiagnostic.h index 9f406987eb..4f005e5aec 100644 --- a/tools/libclang/CIndexDiagnostic.h +++ b/tools/libclang/CIndexDiagnostic.h @@ -117,7 +117,7 @@ struct CXStoredDiagnostic : public CXDiagnosticImpl { : CXDiagnosticImpl(StoredDiagnosticKind), Diag(Diag), LangOpts(LangOpts) { } - ~CXStoredDiagnostic() override {} + ~CXStoredDiagnostic() override = default; /// \brief Return the severity of the diagnostic. CXDiagnosticSeverity getSeverity() const override; diff --git a/tools/libclang/CXLoadedDiagnostic.cpp b/tools/libclang/CXLoadedDiagnostic.cpp index 2c10d34844..7f45d85fe1 100644 --- a/tools/libclang/CXLoadedDiagnostic.cpp +++ b/tools/libclang/CXLoadedDiagnostic.cpp @@ -38,7 +38,7 @@ namespace { class CXLoadedDiagnosticSetImpl : public CXDiagnosticSetImpl { public: CXLoadedDiagnosticSetImpl() : CXDiagnosticSetImpl(true), FakeFiles(FO) {} - ~CXLoadedDiagnosticSetImpl() override {} + ~CXLoadedDiagnosticSetImpl() override = default; llvm::BumpPtrAllocator Alloc; Strings Categories; @@ -63,7 +63,7 @@ public: // Cleanup. //===----------------------------------------------------------------------===// -CXLoadedDiagnostic::~CXLoadedDiagnostic() {} +CXLoadedDiagnostic::~CXLoadedDiagnostic() = default; //===----------------------------------------------------------------------===// // Public CXLoadedDiagnostic methods. diff --git a/tools/libclang/Indexing.cpp b/tools/libclang/Indexing.cpp index 8a0498497e..c8b55e00d5 100644 --- a/tools/libclang/Indexing.cpp +++ b/tools/libclang/Indexing.cpp @@ -151,9 +151,7 @@ class SessionSkipBodyData { public: SessionSkipBodyData() : Mux(/*recursive=*/false) {} - ~SessionSkipBodyData() { - //llvm::errs() << "RegionData: " << Skipped.size() << " - " << Skipped.getMemorySize() << "\n"; - } + ~SessionSkipBodyData() = default; void copyTo(PPRegionSetTy &Set) { llvm::MutexGuard MG(Mux); diff --git a/unittests/AST/EvaluateAsRValueTest.cpp b/unittests/AST/EvaluateAsRValueTest.cpp index 820edbc7c3..4530bc95fb 100644 --- a/unittests/AST/EvaluateAsRValueTest.cpp +++ b/unittests/AST/EvaluateAsRValueTest.cpp @@ -66,7 +66,7 @@ class EvaluateConstantInitializersAction : public clang::ASTFrontendAction { private: class Consumer : public clang::ASTConsumer { public: - ~Consumer() override {} + ~Consumer() override = default; void HandleTranslationUnit(clang::ASTContext &Ctx) override { VarInfoMap VarInfo; diff --git a/unittests/ASTMatchers/ASTMatchersTest.h b/unittests/ASTMatchers/ASTMatchersTest.h index 9ed7ef66e5..b1456fd105 100644 --- a/unittests/ASTMatchers/ASTMatchersTest.h +++ b/unittests/ASTMatchers/ASTMatchersTest.h @@ -26,7 +26,7 @@ using clang::tooling::FileContentMappings; class BoundNodesCallback { public: - virtual ~BoundNodesCallback() {} + virtual ~BoundNodesCallback() = default; virtual bool run(const BoundNodes *BoundNodes) = 0; virtual bool run(const BoundNodes *BoundNodes, ASTContext *Context) = 0; virtual void onEndOfTranslationUnit() {} diff --git a/unittests/ASTMatchers/Dynamic/ParserTest.cpp b/unittests/ASTMatchers/Dynamic/ParserTest.cpp index ef66a816aa..f181d6d19e 100644 --- a/unittests/ASTMatchers/Dynamic/ParserTest.cpp +++ b/unittests/ASTMatchers/Dynamic/ParserTest.cpp @@ -23,7 +23,7 @@ namespace { class MockSema : public Parser::Sema { public: - ~MockSema() override {} + ~MockSema() override = default; uint64_t expectMatcher(StringRef MatcherName) { // Optimizations on the matcher framework make simple matchers like diff --git a/unittests/Tooling/CompilationDatabaseTest.cpp b/unittests/Tooling/CompilationDatabaseTest.cpp index 380d86fc56..d45871f729 100644 --- a/unittests/Tooling/CompilationDatabaseTest.cpp +++ b/unittests/Tooling/CompilationDatabaseTest.cpp @@ -173,7 +173,7 @@ TEST(JSONCompilationDatabase, ArgumentsPreferredOverCommand) { } struct FakeComparator : public PathComparator { - ~FakeComparator() override {} + ~FakeComparator() override = default; bool equivalent(StringRef FileA, StringRef FileB) const override { return FileA.equals_lower(FileB); } diff --git a/unittests/Tooling/RewriterTestContext.h b/unittests/Tooling/RewriterTestContext.h index eee7ea1873..ae593f08a5 100644 --- a/unittests/Tooling/RewriterTestContext.h +++ b/unittests/Tooling/RewriterTestContext.h @@ -50,7 +50,7 @@ class RewriterTestContext { OverlayFileSystem->pushOverlay(InMemoryFileSystem); } - ~RewriterTestContext() {} + ~RewriterTestContext() = default; FileID createInMemoryFile(StringRef Name, StringRef Content) { std::unique_ptr Source = diff --git a/unittests/Tooling/TestVisitor.h b/unittests/Tooling/TestVisitor.h index f4a0039448..a69e18eee1 100644 --- a/unittests/Tooling/TestVisitor.h +++ b/unittests/Tooling/TestVisitor.h @@ -35,9 +35,9 @@ namespace clang { template class TestVisitor : public RecursiveASTVisitor { public: - TestVisitor() { } + TestVisitor() = default; - virtual ~TestVisitor() { } + virtual ~TestVisitor() = default; enum Language { Lang_C,