From 461a67fa15370a9ec88f8f8a240bf7c123bb2029 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 18 Dec 2017 20:11:37 +0000 Subject: Vendor import of clang trunk r321017: https://llvm.org/svn/llvm-project/cfe/trunk@321017 --- include/clang/AST/DeclContextInternals.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'include/clang/AST/DeclContextInternals.h') diff --git a/include/clang/AST/DeclContextInternals.h b/include/clang/AST/DeclContextInternals.h index eb86526e8eca..6545f70f70b5 100644 --- a/include/clang/AST/DeclContextInternals.h +++ b/include/clang/AST/DeclContextInternals.h @@ -1,4 +1,4 @@ -//===-- DeclContextInternals.h - DeclContext Representation -----*- C++ -*-===// +//===- DeclContextInternals.h - DeclContext Representation ------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -11,10 +11,12 @@ // of DeclContext. // //===----------------------------------------------------------------------===// + #ifndef LLVM_CLANG_AST_DECLCONTEXTINTERNALS_H #define LLVM_CLANG_AST_DECLCONTEXTINTERNALS_H #include "clang/AST/Decl.h" +#include "clang/AST/DeclBase.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclarationName.h" #include "llvm/ADT/DenseMap.h" @@ -22,6 +24,7 @@ #include "llvm/ADT/PointerUnion.h" #include "llvm/ADT/SmallVector.h" #include +#include namespace clang { @@ -30,21 +33,20 @@ class DependentDiagnostic; /// \brief An array of decls optimized for the common case of only containing /// one entry. struct StoredDeclsList { - /// \brief When in vector form, this is what the Data pointer points to. - typedef SmallVector DeclsTy; + using DeclsTy = SmallVector; /// \brief A collection of declarations, with a flag to indicate if we have /// further external declarations. - typedef llvm::PointerIntPair DeclsAndHasExternalTy; + using DeclsAndHasExternalTy = llvm::PointerIntPair; /// \brief The stored data, which will be either a pointer to a NamedDecl, /// or a pointer to a vector with a flag to indicate if there are further /// external declarations. - llvm::PointerUnion Data; + llvm::PointerUnion Data; public: - StoredDeclsList() {} + StoredDeclsList() = default; StoredDeclsList(StoredDeclsList &&RHS) : Data(RHS.Data) { RHS.Data = (NamedDecl *)nullptr; @@ -186,7 +188,6 @@ public: /// AddSubsequentDecl - This is called on the second and later decl when it is /// not a redeclaration to merge it into the appropriate place in our list. - /// void AddSubsequentDecl(NamedDecl *D) { assert(!isNull() && "don't AddSubsequentDecl when we have no decls"); @@ -237,28 +238,28 @@ public: }; class StoredDeclsMap - : public llvm::SmallDenseMap { - + : public llvm::SmallDenseMap { public: static void DestroyAll(StoredDeclsMap *Map, bool Dependent); private: friend class ASTContext; // walks the chain deleting these friend class DeclContext; + llvm::PointerIntPair Previous; }; class DependentStoredDeclsMap : public StoredDeclsMap { public: - DependentStoredDeclsMap() : FirstDiagnostic(nullptr) {} + DependentStoredDeclsMap() = default; private: - friend class DependentDiagnostic; friend class DeclContext; // iterates over diagnostics + friend class DependentDiagnostic; - DependentDiagnostic *FirstDiagnostic; + DependentDiagnostic *FirstDiagnostic = nullptr; }; -} // end namespace clang +} // namespace clang -#endif +#endif // LLVM_CLANG_AST_DECLCONTEXTINTERNALS_H -- cgit v1.2.3