diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/DeclBase.cpp | 39 | ||||
| -rw-r--r-- | clang/lib/AST/ExternalASTSource.cpp | 10 |
2 files changed, 34 insertions, 15 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 1e15ee98bbe..29ce7ae034b 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -1,4 +1,4 @@ -//===--- DeclBase.cpp - Declaration AST Node Implementation ---------------===// +//===- DeclBase.cpp - Declaration AST Node Implementation -----------------===// // // The LLVM Compiler Infrastructure // @@ -15,6 +15,7 @@ #include "clang/AST/ASTContext.h" #include "clang/AST/ASTMutationListener.h" #include "clang/AST/Attr.h" +#include "clang/AST/AttrIterator.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclContextInternals.h" @@ -25,11 +26,30 @@ #include "clang/AST/DependentDiagnostic.h" #include "clang/AST/ExternalASTSource.h" #include "clang/AST/Stmt.h" -#include "clang/AST/StmtCXX.h" #include "clang/AST/Type.h" +#include "clang/Basic/IdentifierTable.h" +#include "clang/Basic/LLVM.h" +#include "clang/Basic/LangOptions.h" +#include "clang/Basic/ObjCRuntime.h" +#include "clang/Basic/PartialDiagnostic.h" +#include "clang/Basic/SourceLocation.h" #include "clang/Basic/TargetInfo.h" +#include "clang/Basic/VersionTuple.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/PointerIntPair.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/Casting.h" +#include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> +#include <cassert> +#include <cstddef> +#include <string> +#include <tuple> +#include <utility> + using namespace clang; //===----------------------------------------------------------------------===// @@ -230,7 +250,6 @@ const DeclContext *Decl::getParentFunctionOrMethod() const { return nullptr; } - //===----------------------------------------------------------------------===// // PrettyStackTraceDecl Implementation //===----------------------------------------------------------------------===// @@ -260,7 +279,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; @@ -913,7 +932,6 @@ const FunctionType *Decl::getFunctionType(bool BlocksToo) const { return Ty->getAs<FunctionType>(); } - /// Starting at a given context (a Decl or DeclContext), look for a /// code context that is not a closure (a lambda, block, etc.). template <class T> static Decl *getNonClosureContext(T *D) { @@ -966,7 +984,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. @@ -1057,15 +1075,14 @@ static bool isLinkageSpecContext(const DeclContext *DC, } bool DeclContext::isExternCContext() const { - return isLinkageSpecContext(this, clang::LinkageSpecDecl::lang_c); + return isLinkageSpecContext(this, LinkageSpecDecl::lang_c); } const LinkageSpecDecl *DeclContext::getExternCContext() const { const DeclContext *DC = this; while (DC->getDeclKind() != Decl::TranslationUnit) { if (DC->getDeclKind() == Decl::LinkageSpec && - cast<LinkageSpecDecl>(DC)->getLanguage() == - clang::LinkageSpecDecl::lang_c) + cast<LinkageSpecDecl>(DC)->getLanguage() == LinkageSpecDecl::lang_c) return cast<LinkageSpecDecl>(DC); DC = DC->getLexicalParent(); } @@ -1073,7 +1090,7 @@ const LinkageSpecDecl *DeclContext::getExternCContext() const { } bool DeclContext::isExternCXXContext() const { - return isLinkageSpecContext(this, clang::LinkageSpecDecl::lang_cxx); + return isLinkageSpecContext(this, LinkageSpecDecl::lang_cxx); } bool DeclContext::Encloses(const DeclContext *DC) const { @@ -1108,13 +1125,11 @@ DeclContext *DeclContext::getPrimaryContext() { case Decl::ObjCInterface: if (ObjCInterfaceDecl *Def = cast<ObjCInterfaceDecl>(this)->getDefinition()) return Def; - return this; case Decl::ObjCProtocol: if (ObjCProtocolDecl *Def = cast<ObjCProtocolDecl>(this)->getDefinition()) return Def; - return this; case Decl::ObjCCategory: diff --git a/clang/lib/AST/ExternalASTSource.cpp b/clang/lib/AST/ExternalASTSource.cpp index 182d38242f5..198ba9d4fbd 100644 --- a/clang/lib/AST/ExternalASTSource.cpp +++ b/clang/lib/AST/ExternalASTSource.cpp @@ -1,4 +1,4 @@ -//===- ExternalASTSource.cpp - Abstract External AST Interface --*- C++ -*-===// +//===- ExternalASTSource.cpp - Abstract External AST Interface ------------===// // // The LLVM Compiler Infrastructure // @@ -16,12 +16,16 @@ #include "clang/AST/ExternalASTSource.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclarationName.h" +#include "clang/Basic/IdentifierTable.h" +#include "clang/Basic/LLVM.h" #include "clang/Basic/Module.h" +#include "llvm/ADT/None.h" #include "llvm/Support/ErrorHandling.h" +#include <cstdint> using namespace clang; -ExternalASTSource::~ExternalASTSource() { } +ExternalASTSource::~ExternalASTSource() = default; llvm::Optional<ExternalASTSource::ASTSourceDescriptor> ExternalASTSource::getSourceDescriptor(unsigned ID) { @@ -66,7 +70,7 @@ void ExternalASTSource::FinishedDeserializing() {} void ExternalASTSource::StartTranslationUnit(ASTConsumer *Consumer) {} -void ExternalASTSource::PrintStats() { } +void ExternalASTSource::PrintStats() {} bool ExternalASTSource::layoutRecordType( const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, |

