diff options
author | Angel Garcia Gomez <angelgarcia@google.com> | 2015-10-20 12:52:55 +0000 |
---|---|---|
committer | Angel Garcia Gomez <angelgarcia@google.com> | 2015-10-20 12:52:55 +0000 |
commit | b5250d3448428b33ae52b8ee574993a2f0f03352 (patch) | |
tree | 3fce53fb0fc15a0d773b45a0d6090cfde992b052 /clang/lib | |
parent | f84916d40fb24692e1d4331c82920723d7b44ed1 (diff) | |
download | llvm-b5250d3448428b33ae52b8ee574993a2f0f03352.tar.gz |
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
llvm-svn: 250822
Diffstat (limited to 'clang/lib')
95 files changed, 146 insertions, 154 deletions
diff --git a/clang/lib/ARCMigrate/ARCMT.cpp b/clang/lib/ARCMigrate/ARCMT.cpp index 7eb01fb93db0..c9239ded2b2d 100644 --- a/clang/lib/ARCMigrate/ARCMT.cpp +++ b/clang/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/clang/lib/ARCMigrate/TransformActions.cpp b/clang/lib/ARCMigrate/TransformActions.cpp index c628b54ed414..e7eb821691f9 100644 --- a/clang/lib/ARCMigrate/TransformActions.cpp +++ b/clang/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/clang/lib/ARCMigrate/Transforms.cpp b/clang/lib/ARCMigrate/Transforms.cpp index 56d3af7233bf..2bdaf19ebca3 100644 --- a/clang/lib/ARCMigrate/Transforms.cpp +++ b/clang/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/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 848158877aa7..1f1e00a812e4 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index 6816dd11d9b2..fded9444a521 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/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/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 406dff68993a..ff92630a263a 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/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/clang/lib/AST/ExternalASTSource.cpp b/clang/lib/AST/ExternalASTSource.cpp index e3de8c5fefa2..c42a8b4fcd0c 100644 --- a/clang/lib/AST/ExternalASTSource.cpp +++ b/clang/lib/AST/ExternalASTSource.cpp @@ -21,7 +21,7 @@ using namespace clang; -ExternalASTSource::~ExternalASTSource() { } +ExternalASTSource::~ExternalASTSource() = default; llvm::Optional<ExternalASTSource::ASTSourceDescriptor> ExternalASTSource::getSourceDescriptor(unsigned ID) { diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index bf155f5680bb..21c2959f648c 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/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/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index 6829da5bb142..747a1bda367f 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/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/clang/lib/ASTMatchers/ASTMatchFinder.cpp b/clang/lib/ASTMatchers/ASTMatchFinder.cpp index 8807b13c5ed1..f4cf5ef20f22 100644 --- a/clang/lib/ASTMatchers/ASTMatchFinder.cpp +++ b/clang/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/clang/lib/ASTMatchers/Dynamic/Marshallers.h b/clang/lib/ASTMatchers/Dynamic/Marshallers.h index 64d6b7814aeb..0d6fbf916c5f 100644 --- a/clang/lib/ASTMatchers/Dynamic/Marshallers.h +++ b/clang/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<ParserValue> Args, Diagnostics *Error) const = 0; @@ -491,7 +491,7 @@ public: OverloadedMatcherDescriptor(ArrayRef<MatcherDescriptor *> Callbacks) : Overloads(Callbacks.begin(), Callbacks.end()) {} - ~OverloadedMatcherDescriptor() override {} + ~OverloadedMatcherDescriptor() override = default; VariantMatcher create(SourceRange NameRange, ArrayRef<ParserValue> Args, diff --git a/clang/lib/ASTMatchers/Dynamic/Parser.cpp b/clang/lib/ASTMatchers/Dynamic/Parser.cpp index cf9dab6dc7db..ca4a12716d29 100644 --- a/clang/lib/ASTMatchers/Dynamic/Parser.cpp +++ b/clang/lib/ASTMatchers/Dynamic/Parser.cpp @@ -257,7 +257,7 @@ private: const char *CodeCompletionLocation; }; -Parser::Sema::~Sema() {} +Parser::Sema::~Sema() = default; std::vector<ArgKind> Parser::Sema::getAcceptedCompletionTypes( llvm::ArrayRef<std::pair<MatcherCtor, unsigned>> 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<MatcherCtor> Parser::RegistrySema::lookupMatcherCtor(StringRef MatcherName) { diff --git a/clang/lib/ASTMatchers/Dynamic/VariantValue.cpp b/clang/lib/ASTMatchers/Dynamic/VariantValue.cpp index 8f3c70c1a8d8..d73fb7b623f8 100644 --- a/clang/lib/ASTMatchers/Dynamic/VariantValue.cpp +++ b/clang/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<DynTypedMatcher> MatchersIn) : Matchers(std::move(MatchersIn)) {} - ~PolymorphicPayload() override {} + ~PolymorphicPayload() override = default; llvm::Optional<DynTypedMatcher> getSingleMatcher() const override { if (Matchers.size() != 1) diff --git a/clang/lib/Analysis/AnalysisDeclContext.cpp b/clang/lib/Analysis/AnalysisDeclContext.cpp index d7fb7e95d758..a54710181d1a 100644 --- a/clang/lib/Analysis/AnalysisDeclContext.cpp +++ b/clang/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/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp index 6cb63f2b1755..63201c45951f 100644 --- a/clang/lib/Analysis/CFG.cpp +++ b/clang/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/clang/lib/Analysis/CodeInjector.cpp b/clang/lib/Analysis/CodeInjector.cpp index 76bf364444d1..3ac94f9bc013 100644 --- a/clang/lib/Analysis/CodeInjector.cpp +++ b/clang/lib/Analysis/CodeInjector.cpp @@ -11,5 +11,5 @@ using namespace clang; -CodeInjector::CodeInjector() {} -CodeInjector::~CodeInjector() {} +CodeInjector::CodeInjector() = default; +CodeInjector::~CodeInjector() = default; diff --git a/clang/lib/Analysis/Consumed.cpp b/clang/lib/Analysis/Consumed.cpp index 9df23923b014..11429fff452e 100644 --- a/clang/lib/Analysis/Consumed.cpp +++ b/clang/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/clang/lib/Analysis/FormatString.cpp b/clang/lib/Analysis/FormatString.cpp index 0948bc0b08a8..f8bbafd54904 100644 --- a/clang/lib/Analysis/FormatString.cpp +++ b/clang/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/clang/lib/Analysis/ProgramPoint.cpp b/clang/lib/Analysis/ProgramPoint.cpp index 26b59bb71de2..787e5bbca7ca 100644 --- a/clang/lib/Analysis/ProgramPoint.cpp +++ b/clang/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/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index bce5175ece2c..407b7f0e0d97 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/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/clang/lib/Analysis/UninitializedValues.cpp b/clang/lib/Analysis/UninitializedValues.cpp index f2f791957aa3..2ee94d5e8e5c 100644 --- a/clang/lib/Analysis/UninitializedValues.cpp +++ b/clang/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/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp index 0caa876a57b7..8c15f25b5b6f 100644 --- a/clang/lib/Basic/Diagnostic.cpp +++ b/clang/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/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp index 21e6ea3ab4bb..c04ebda1309b 100644 --- a/clang/lib/Basic/FileManager.cpp +++ b/clang/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/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index 199815aa891b..c60789d816cc 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/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/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 536ae7ff5c8f..100f6e88f1aa 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/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/clang/lib/Basic/TargetInfo.cpp b/clang/lib/Basic/TargetInfo.cpp index 21368f8b1145..6cde57d86538 100644 --- a/clang/lib/Basic/TargetInfo.cpp +++ b/clang/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/clang/lib/Basic/VirtualFileSystem.cpp b/clang/lib/Basic/VirtualFileSystem.cpp index a20132b3de89..540116f6c5e0 100644 --- a/clang/lib/Basic/VirtualFileSystem.cpp +++ b/clang/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<std::unique_ptr<MemoryBuffer>> 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/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp index cfb09e72c7b4..b09532bbad8c 100644 --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/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/clang/lib/CodeGen/CGCUDARuntime.cpp b/clang/lib/CodeGen/CGCUDARuntime.cpp index 014a5dbd46d6..bd8b034c814f 100644 --- a/clang/lib/CodeGen/CGCUDARuntime.cpp +++ b/clang/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/clang/lib/CodeGen/CGCXXABI.cpp b/clang/lib/CodeGen/CGCXXABI.cpp index 51f1b0730b32..5455000f21e7 100644 --- a/clang/lib/CodeGen/CGCXXABI.cpp +++ b/clang/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/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index bb7fdca667aa..2b8e44ba72a7 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/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/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index c4b5b43b7115..12ea96755cf2 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -3058,4 +3058,4 @@ CodeGenFunction::EmitBlockCopyAndAutorelease(llvm::Value *Block, QualType Ty) { } -CGObjCRuntime::~CGObjCRuntime() {} +CGObjCRuntime::~CGObjCRuntime() = default; diff --git a/clang/lib/CodeGen/CGOpenCLRuntime.cpp b/clang/lib/CodeGen/CGOpenCLRuntime.cpp index 8af39ceecdfe..808406a97c3b 100644 --- a/clang/lib/CodeGen/CGOpenCLRuntime.cpp +++ b/clang/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/clang/lib/CodeGen/CGOpenMPRuntime.h b/clang/lib/CodeGen/CGOpenMPRuntime.h index dc4238cda62a..947f2cf7a9bb 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.h +++ b/clang/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/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 8801c3b3f256..9fbfcf424aea 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/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/clang/lib/CodeGen/CodeGenTBAA.cpp b/clang/lib/CodeGen/CodeGenTBAA.cpp index c3c925cde2fd..ee232ce7736f 100644 --- a/clang/lib/CodeGen/CodeGenTBAA.cpp +++ b/clang/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/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp index f76fad16cc28..aa54b0a4d4f7 100644 --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/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/clang/lib/Driver/Tool.cpp b/clang/lib/Driver/Tool.cpp index 7142e822f16e..6ae3506e657f 100644 --- a/clang/lib/Driver/Tool.cpp +++ b/clang/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/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp index 65d4f4f4e0ab..e4611d21b6d5 100644 --- a/clang/lib/Driver/ToolChain.cpp +++ b/clang/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/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 6438ea7606aa..0687699e4a1d 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/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/clang/lib/Format/BreakableToken.h b/clang/lib/Format/BreakableToken.h index eb1f9fda3071..506d979f2ded 100644 --- a/clang/lib/Format/BreakableToken.h +++ b/clang/lib/Format/BreakableToken.h @@ -36,7 +36,7 @@ public: /// \brief Contains starting character index and length of split. typedef std::pair<StringRef::size_type, unsigned> 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/clang/lib/Format/FormatToken.cpp b/clang/lib/Format/FormatToken.cpp index b293cf25c355..fec48605b04b 100644 --- a/clang/lib/Format/FormatToken.cpp +++ b/clang/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/clang/lib/Format/UnwrappedLineFormatter.cpp b/clang/lib/Format/UnwrappedLineFormatter.cpp index 6d9b1da49b26..100aedcd9997 100644 --- a/clang/lib/Format/UnwrappedLineFormatter.cpp +++ b/clang/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/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index 634dbe970845..2956f841e791 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/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/clang/lib/Format/UnwrappedLineParser.h b/clang/lib/Format/UnwrappedLineParser.h index c2fa02957685..88c0dc5cb7fd 100644 --- a/clang/lib/Format/UnwrappedLineParser.h +++ b/clang/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/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index d3d7185ea3ad..1696e36418df 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/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/clang/lib/Frontend/CacheTokens.cpp b/clang/lib/Frontend/CacheTokens.cpp index 7d2a09cd7ca0..9f641855559f 100644 --- a/clang/lib/Frontend/CacheTokens.cpp +++ b/clang/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<vfs::File> *F, diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 6e234112d7d5..b5ac59990fe4 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/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/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp index 93d4a8034696..15ddb702cb27 100644 --- a/clang/lib/Frontend/DependencyFile.cpp +++ b/clang/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<DepCollectorPPCallbacks>(*this, PP.getSourceManager())); diff --git a/clang/lib/Frontend/DiagnosticRenderer.cpp b/clang/lib/Frontend/DiagnosticRenderer.cpp index 6ef9a89d86fd..b8d4124f175e 100644 --- a/clang/lib/Frontend/DiagnosticRenderer.cpp +++ b/clang/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/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index ecef92e0a7dd..3c6c7d5a4466 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/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<ASTUnit> AST) { diff --git a/clang/lib/Frontend/MultiplexConsumer.cpp b/clang/lib/Frontend/MultiplexConsumer.cpp index 91ee100f6394..226e33da4555 100644 --- a/clang/lib/Frontend/MultiplexConsumer.cpp +++ b/clang/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/clang/lib/Frontend/Rewrite/FixItRewriter.cpp b/clang/lib/Frontend/Rewrite/FixItRewriter.cpp index dc787ac9557c..8daf2ce41b41 100644 --- a/clang/lib/Frontend/Rewrite/FixItRewriter.cpp +++ b/clang/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/clang/lib/Frontend/Rewrite/FrontendActions.cpp b/clang/lib/Frontend/Rewrite/FrontendActions.cpp index 8cf8adf37ed6..d3a22ce9adcc 100644 --- a/clang/lib/Frontend/Rewrite/FrontendActions.cpp +++ b/clang/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<ASTConsumer> FixItAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) { diff --git a/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp b/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp index 2902ba78c4ef..3523783b5c53 100644 --- a/clang/lib/Frontend/Rewrite/RewriteModernObjC.cpp +++ b/clang/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/clang/lib/Frontend/Rewrite/RewriteObjC.cpp b/clang/lib/Frontend/Rewrite/RewriteObjC.cpp index 204820b3041a..9d9be2cbc364 100644 --- a/clang/lib/Frontend/Rewrite/RewriteObjC.cpp +++ b/clang/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/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp b/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp index 1bf10d276945..1cf886ce7be3 100644 --- a/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp +++ b/clang/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/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp index d4e156d44582..938fe58ea818 100644 --- a/clang/lib/Frontend/TextDiagnostic.cpp +++ b/clang/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/clang/lib/Index/CommentToXML.cpp b/clang/lib/Index/CommentToXML.cpp index 15f1696cbe91..df103db1de96 100644 --- a/clang/lib/Index/CommentToXML.cpp +++ b/clang/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<char> &HTML, diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 469d782deb31..79564ca2d553 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -50,7 +50,7 @@ HeaderFileInfo::getControllingMacro(ExternalPreprocessorSource *External) { return ControllingMacro; } -ExternalHeaderFileInfoSource::~ExternalHeaderFileInfoSource() {} +ExternalHeaderFileInfoSource::~ExternalHeaderFileInfoSource() = default; HeaderSearch::HeaderSearch(IntrusiveRefCntPtr<HeaderSearchOptions> HSOpts, SourceManager &SourceMgr, DiagnosticsEngine &Diags, diff --git a/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp index c231e18eecc3..8f5171880a52 100644 --- a/clang/lib/Lex/PPLexerChange.cpp +++ b/clang/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/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp index 5f63d35c5be7..f1a625a88208 100644 --- a/clang/lib/Lex/PTHLexer.cpp +++ b/clang/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/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp index 3134790ccb90..1f158cf5e329 100644 --- a/clang/lib/Lex/Pragma.cpp +++ b/clang/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/clang/lib/Lex/PreprocessingRecord.cpp b/clang/lib/Lex/PreprocessingRecord.cpp index 32e6de69f0db..d01dfca8b613 100644 --- a/clang/lib/Lex/PreprocessingRecord.cpp +++ b/clang/lib/Lex/PreprocessingRecord.cpp @@ -19,7 +19,7 @@ using namespace clang; -ExternalPreprocessingRecordSource::~ExternalPreprocessingRecordSource() { } +ExternalPreprocessingRecordSource::~ExternalPreprocessingRecordSource() = default; InclusionDirective::InclusionDirective(PreprocessingRecord &PPRec, diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 869890b46cf4..7b1f78a51024 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -53,7 +53,7 @@ using namespace clang; //===----------------------------------------------------------------------===// -ExternalPreprocessorSource::~ExternalPreprocessorSource() { } +ExternalPreprocessorSource::~ExternalPreprocessorSource() = default; Preprocessor::Preprocessor(IntrusiveRefCntPtr<PreprocessorOptions> 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/clang/lib/Parse/ParseCXXInlineMethods.cpp b/clang/lib/Parse/ParseCXXInlineMethods.cpp index ab1f97d31a69..82fef5ace443 100644 --- a/clang/lib/Parse/ParseCXXInlineMethods.cpp +++ b/clang/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/clang/lib/Rewrite/TokenRewriter.cpp b/clang/lib/Rewrite/TokenRewriter.cpp index 494defdedaa9..cc2ed1350aac 100644 --- a/clang/lib/Rewrite/TokenRewriter.cpp +++ b/clang/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/clang/lib/Sema/AttributeList.cpp b/clang/lib/Sema/AttributeList.cpp index 3c61c95ad8ec..02986deacc00 100644 --- a/clang/lib/Sema/AttributeList.cpp +++ b/clang/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/clang/lib/Sema/CodeCompleteConsumer.cpp b/clang/lib/Sema/CodeCompleteConsumer.cpp index 18e9a5911641..708d9f58754d 100644 --- a/clang/lib/Sema/CodeCompleteConsumer.cpp +++ b/clang/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/clang/lib/Sema/MultiplexExternalSemaSource.cpp b/clang/lib/Sema/MultiplexExternalSemaSource.cpp index 0f93421ac21b..5d0effc5a518 100644 --- a/clang/lib/Sema/MultiplexExternalSemaSource.cpp +++ b/clang/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/clang/lib/Sema/ScopeInfo.cpp b/clang/lib/Sema/ScopeInfo.cpp index ba8c3642bc8c..a06375816f7a 100644 --- a/clang/lib/Sema/ScopeInfo.cpp +++ b/clang/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/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 300e2f040a20..bac323712e83 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/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/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 588ae3d88ebc..1d027d5f07dd 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/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/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp index 6fbe0da8c901..556e5bb8dc1a 100644 --- a/clang/lib/Sema/SemaLookup.cpp +++ b/clang/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/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index c4e1b26e7c5f..db658de7d94d 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -56,7 +56,7 @@ private: ArrayRef<T> Arr; }; struct MatchesAlways { - MatchesAlways() {} + MatchesAlways() = default; template <class T> bool operator()(T) { return true; } }; diff --git a/clang/lib/Sema/SemaPseudoObject.cpp b/clang/lib/Sema/SemaPseudoObject.cpp index 8998a7e8bc9c..f8974adfac4b 100644 --- a/clang/lib/Sema/SemaPseudoObject.cpp +++ b/clang/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/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 31d69cbac35e..9378c98899d1 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -3600,7 +3600,7 @@ public: const TemplateArgumentLoc *operator->() const { return &Arg; } }; - TemplateArgumentLocInventIterator() { } + TemplateArgumentLocInventIterator() = default; explicit TemplateArgumentLocInventIterator(TreeTransform<Derived> &Self, InputIterator Iter) @@ -5249,7 +5249,7 @@ QualType TreeTransform<Derived>::TransformAtomicType(TypeLocBuilder &TLB, }; - TemplateArgumentLocContainerIterator() {} + TemplateArgumentLocContainerIterator() = default; TemplateArgumentLocContainerIterator(ArgLocContainer &Container, unsigned Index) diff --git a/clang/lib/Serialization/ASTCommon.cpp b/clang/lib/Serialization/ASTCommon.cpp index ec1a936684f4..3839fdd18717 100644 --- a/clang/lib/Serialization/ASTCommon.cpp +++ b/clang/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/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 59347de9c17d..5e3d7622fa93 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/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/clang/lib/Serialization/GeneratePCH.cpp b/clang/lib/Serialization/GeneratePCH.cpp index 9de2fdb75a07..0b9acbe5ffa0 100644 --- a/clang/lib/Serialization/GeneratePCH.cpp +++ b/clang/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/clang/lib/Serialization/MultiOnDiskHashTable.h b/clang/lib/Serialization/MultiOnDiskHashTable.h index 04dea831695c..6b81f1eb3d3c 100644 --- a/clang/lib/Serialization/MultiOnDiskHashTable.h +++ b/clang/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/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp index 5d8baf6ba7de..8e304f7162bd 100644 --- a/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp +++ b/clang/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/clang/lib/StaticAnalyzer/Core/BugReporter.cpp b/clang/lib/StaticAnalyzer/Core/BugReporter.cpp index 56d57c501404..1b17e7a6e20e 100644 --- a/clang/lib/StaticAnalyzer/Core/BugReporter.cpp +++ b/clang/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/clang/lib/StaticAnalyzer/Core/ConstraintManager.cpp b/clang/lib/StaticAnalyzer/Core/ConstraintManager.cpp index b7db8333aaac..cf35f9879fe4 100644 --- a/clang/lib/StaticAnalyzer/Core/ConstraintManager.cpp +++ b/clang/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/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp index 39cf7e771755..58f81ebc53d1 100644 --- a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp +++ b/clang/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/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp b/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp index 8a09720b2a19..b9dc1c363c2f 100644 --- a/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp +++ b/clang/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/clang/lib/StaticAnalyzer/Core/MemRegion.cpp b/clang/lib/StaticAnalyzer/Core/MemRegion.cpp index d41fed0619e7..7946db4d3861 100644 --- a/clang/lib/StaticAnalyzer/Core/MemRegion.cpp +++ b/clang/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/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp index 504df30de834..e5b473212e19 100644 --- a/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ b/clang/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/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp index 59ed921c2501..557774a89425 100644 --- a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp +++ b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp @@ -37,7 +37,7 @@ namespace { const LangOptions &LangOpts, bool supportsMultipleFiles); - ~PlistDiagnostics() override {} + ~PlistDiagnostics() override = default; void FlushDiagnosticsImpl(std::vector<const PathDiagnostic *> &Diags, FilesMade *filesMade) override; diff --git a/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp b/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp index 4051242434ec..9ed1aa505706 100644 --- a/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp +++ b/clang/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<nonloc::SymbolVal> SymVal = X.getAs<nonloc::SymbolVal>(); diff --git a/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp index a704ce224554..6e18941f075e 100644 --- a/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp +++ b/clang/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/clang/lib/StaticAnalyzer/Core/Store.cpp b/clang/lib/StaticAnalyzer/Core/Store.cpp index 7cdb55a59782..245f6ad26de2 100644 --- a/clang/lib/StaticAnalyzer/Core/Store.cpp +++ b/clang/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/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index ca92ffe8f01d..13af3c1c717b 100644 --- a/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/clang/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/clang/lib/Tooling/CompilationDatabase.cpp b/clang/lib/Tooling/CompilationDatabase.cpp index 957e40137eac..cdbfe5190a70 100644 --- a/clang/lib/Tooling/CompilationDatabase.cpp +++ b/clang/lib/Tooling/CompilationDatabase.cpp @@ -32,7 +32,7 @@ using namespace clang; using namespace tooling; -CompilationDatabase::~CompilationDatabase() {} +CompilationDatabase::~CompilationDatabase() = default; std::unique_ptr<CompilationDatabase> 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/clang/lib/Tooling/Tooling.cpp b/clang/lib/Tooling/Tooling.cpp index 220b62558bfb..53f6e06101f7 100644 --- a/clang/lib/Tooling/Tooling.cpp +++ b/clang/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)); |