From: Benjamin Kramer Date: Sat, 1 Dec 2012 15:09:41 +0000 (+0000) Subject: Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2fa67efeaf66a9332c30a026dc1c21bef6c33a6c;p=clang Pull the Attr iteration parts out of Attr.h, so including DeclBase.h doesn't pull in all the generated Attr code. Required to pull some functions out of line, but this shouldn't have a perf impact. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169092 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index b7d3f1fbcc..aaed5f3cea 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -2143,8 +2143,8 @@ static inline Selector GetUnarySelector(StringRef name, ASTContext& Ctx) { /// This placement form of operator new uses the ASTContext's allocator for /// obtaining memory. /// -/// IMPORTANT: These are also declared in clang/AST/Attr.h! Any changes here -/// need to also be made there. +/// IMPORTANT: These are also declared in clang/AST/AttrIterator.h! Any changes +/// here need to also be made there. /// /// We intentionally avoid using a nothrow specification here so that the calls /// to this operator will not perform a null check on the result -- the diff --git a/include/clang/AST/ASTMutationListener.h b/include/clang/AST/ASTMutationListener.h index 56d15260a5..6b70285e3a 100644 --- a/include/clang/AST/ASTMutationListener.h +++ b/include/clang/AST/ASTMutationListener.h @@ -16,18 +16,19 @@ #include "clang/Basic/SourceLocation.h" namespace clang { - class Decl; - class DeclContext; - class TagDecl; class CXXRecordDecl; class ClassTemplateDecl; class ClassTemplateSpecializationDecl; + class Decl; + class DeclContext; class FunctionDecl; class FunctionTemplateDecl; class ObjCCategoryDecl; - class ObjCInterfaceDecl; class ObjCContainerDecl; + class ObjCInterfaceDecl; class ObjCPropertyDecl; + class TagDecl; + class VarDecl; /// \brief An abstract interface that should be implemented by listeners /// that want to be notified when an AST entity gets modified after its diff --git a/include/clang/AST/ASTVector.h b/include/clang/AST/ASTVector.h index 91966520d8..13ac375022 100644 --- a/include/clang/AST/ASTVector.h +++ b/include/clang/AST/ASTVector.h @@ -18,6 +18,7 @@ #ifndef LLVM_CLANG_AST_VECTOR #define LLVM_CLANG_AST_VECTOR +#include "clang/AST/ASTContext.h" #include "llvm/Support/type_traits.h" #include "llvm/Support/Allocator.h" #include "llvm/ADT/PointerIntPair.h" diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h index 12a9855617..29ec1a2686 100644 --- a/include/clang/AST/Attr.h +++ b/include/clang/AST/Attr.h @@ -14,9 +14,10 @@ #ifndef LLVM_CLANG_AST_ATTR_H #define LLVM_CLANG_AST_ATTR_H -#include "clang/Basic/LLVM.h" -#include "clang/Basic/AttrKinds.h" +#include "clang/AST/AttrIterator.h" #include "clang/AST/Type.h" +#include "clang/Basic/AttrKinds.h" +#include "clang/Basic/LLVM.h" #include "clang/Basic/SourceLocation.h" #include "clang/Basic/VersionTuple.h" #include "llvm/ADT/SmallVector.h" @@ -26,7 +27,6 @@ #include "llvm/Support/raw_ostream.h" #include #include -#include namespace clang { class ASTContext; @@ -36,23 +36,6 @@ namespace clang { class QualType; class FunctionDecl; class TypeSourceInfo; -} - -// Defined in ASTContext.h -void *operator new(size_t Bytes, const clang::ASTContext &C, - size_t Alignment = 16); -// FIXME: Being forced to not have a default argument here due to redeclaration -// rules on default arguments sucks -void *operator new[](size_t Bytes, const clang::ASTContext &C, - size_t Alignment); - -// It is good practice to pair new/delete operators. Also, MSVC gives many -// warnings if a matching delete overload is not declared, even though the -// throw() spec guarantees it will not be implicitly called. -void operator delete(void *Ptr, const clang::ASTContext &C, size_t); -void operator delete[](void *Ptr, const clang::ASTContext &C, size_t); - -namespace clang { /// Attr - This represents one attribute. class Attr { @@ -139,114 +122,6 @@ public: #include "clang/AST/Attrs.inc" -/// AttrVec - A vector of Attr, which is how they are stored on the AST. -typedef SmallVector AttrVec; -typedef SmallVector ConstAttrVec; - -/// specific_attr_iterator - Iterates over a subrange of an AttrVec, only -/// providing attributes that are of a specifc type. -template -class specific_attr_iterator { - typedef typename Container::const_iterator Iterator; - - /// Current - The current, underlying iterator. - /// In order to ensure we don't dereference an invalid iterator unless - /// specifically requested, we don't necessarily advance this all the - /// way. Instead, we advance it when an operation is requested; if the - /// operation is acting on what should be a past-the-end iterator, - /// then we offer no guarantees, but this way we do not dererence a - /// past-the-end iterator when we move to a past-the-end position. - mutable Iterator Current; - - void AdvanceToNext() const { - while (!isa(*Current)) - ++Current; - } - - void AdvanceToNext(Iterator I) const { - while (Current != I && !isa(*Current)) - ++Current; - } - -public: - typedef SpecificAttr* value_type; - typedef SpecificAttr* reference; - typedef SpecificAttr* pointer; - typedef std::forward_iterator_tag iterator_category; - typedef std::ptrdiff_t difference_type; - - specific_attr_iterator() : Current() { } - explicit specific_attr_iterator(Iterator i) : Current(i) { } - - reference operator*() const { - AdvanceToNext(); - return cast(*Current); - } - pointer operator->() const { - AdvanceToNext(); - return cast(*Current); - } - - specific_attr_iterator& operator++() { - ++Current; - return *this; - } - specific_attr_iterator operator++(int) { - specific_attr_iterator Tmp(*this); - ++(*this); - return Tmp; - } - - friend bool operator==(specific_attr_iterator Left, - specific_attr_iterator Right) { - if (Left.Current < Right.Current) - Left.AdvanceToNext(Right.Current); - else - Right.AdvanceToNext(Left.Current); - return Left.Current == Right.Current; - } - friend bool operator!=(specific_attr_iterator Left, - specific_attr_iterator Right) { - return !(Left == Right); - } -}; - -template -inline specific_attr_iterator - specific_attr_begin(const Container& container) { - return specific_attr_iterator(container.begin()); -} -template -inline specific_attr_iterator - specific_attr_end(const Container& container) { - return specific_attr_iterator(container.end()); -} - -template -inline bool hasSpecificAttr(const Container& container) { - return specific_attr_begin(container) != - specific_attr_end(container); -} -template -inline SpecificAttr *getSpecificAttr(const Container& container) { - specific_attr_iterator i = - specific_attr_begin(container); - if (i != specific_attr_end(container)) - return *i; - else - return 0; -} - -/// getMaxAlignment - Returns the highest alignment value found among -/// AlignedAttrs in an AttrVec, or 0 if there are none. -inline unsigned getMaxAttrAlignment(const AttrVec& V, ASTContext &Ctx) { - unsigned Align = 0; - specific_attr_iterator i(V.begin()), e(V.end()); - for(; i != e; ++i) - Align = std::max(Align, i->getAlignment(Ctx)); - return Align; -} - } // end namespace clang #endif diff --git a/include/clang/AST/AttrIterator.h b/include/clang/AST/AttrIterator.h new file mode 100644 index 0000000000..e74405dfb1 --- /dev/null +++ b/include/clang/AST/AttrIterator.h @@ -0,0 +1,141 @@ +//===--- AttrIterator.h - Classes for attribute iteration -------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the Attr vector and specific_attr_iterator interfaces. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_ATTRITERATOR_H +#define LLVM_CLANG_AST_ATTRITERATOR_H + +#include "clang/Basic/LLVM.h" +#include + +namespace clang { + class ASTContext; + class Attr; +} + +// Defined in ASTContext.h +void *operator new(size_t Bytes, const clang::ASTContext &C, + size_t Alignment = 16); +// FIXME: Being forced to not have a default argument here due to redeclaration +// rules on default arguments sucks +void *operator new[](size_t Bytes, const clang::ASTContext &C, + size_t Alignment); + +// It is good practice to pair new/delete operators. Also, MSVC gives many +// warnings if a matching delete overload is not declared, even though the +// throw() spec guarantees it will not be implicitly called. +void operator delete(void *Ptr, const clang::ASTContext &C, size_t); +void operator delete[](void *Ptr, const clang::ASTContext &C, size_t); + +namespace clang { + +/// AttrVec - A vector of Attr, which is how they are stored on the AST. +typedef SmallVector AttrVec; +typedef SmallVector ConstAttrVec; + +/// specific_attr_iterator - Iterates over a subrange of an AttrVec, only +/// providing attributes that are of a specifc type. +template +class specific_attr_iterator { + typedef typename Container::const_iterator Iterator; + + /// Current - The current, underlying iterator. + /// In order to ensure we don't dereference an invalid iterator unless + /// specifically requested, we don't necessarily advance this all the + /// way. Instead, we advance it when an operation is requested; if the + /// operation is acting on what should be a past-the-end iterator, + /// then we offer no guarantees, but this way we do not dererence a + /// past-the-end iterator when we move to a past-the-end position. + mutable Iterator Current; + + void AdvanceToNext() const { + while (!isa(*Current)) + ++Current; + } + + void AdvanceToNext(Iterator I) const { + while (Current != I && !isa(*Current)) + ++Current; + } + +public: + typedef SpecificAttr* value_type; + typedef SpecificAttr* reference; + typedef SpecificAttr* pointer; + typedef std::forward_iterator_tag iterator_category; + typedef std::ptrdiff_t difference_type; + + specific_attr_iterator() : Current() { } + explicit specific_attr_iterator(Iterator i) : Current(i) { } + + reference operator*() const { + AdvanceToNext(); + return cast(*Current); + } + pointer operator->() const { + AdvanceToNext(); + return cast(*Current); + } + + specific_attr_iterator& operator++() { + ++Current; + return *this; + } + specific_attr_iterator operator++(int) { + specific_attr_iterator Tmp(*this); + ++(*this); + return Tmp; + } + + friend bool operator==(specific_attr_iterator Left, + specific_attr_iterator Right) { + if (Left.Current < Right.Current) + Left.AdvanceToNext(Right.Current); + else + Right.AdvanceToNext(Left.Current); + return Left.Current == Right.Current; + } + friend bool operator!=(specific_attr_iterator Left, + specific_attr_iterator Right) { + return !(Left == Right); + } +}; + +template +inline specific_attr_iterator + specific_attr_begin(const Container& container) { + return specific_attr_iterator(container.begin()); +} +template +inline specific_attr_iterator + specific_attr_end(const Container& container) { + return specific_attr_iterator(container.end()); +} + +template +inline bool hasSpecificAttr(const Container& container) { + return specific_attr_begin(container) != + specific_attr_end(container); +} +template +inline SpecificAttr *getSpecificAttr(const Container& container) { + specific_attr_iterator i = + specific_attr_begin(container); + if (i != specific_attr_end(container)) + return *i; + else + return 0; +} + +} // end namespace clang + +#endif diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index 020f3b05fc..d61e6dd7a4 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -538,9 +538,7 @@ public: /// \brief Determine whether this symbol is weakly-imported, /// or declared with the weak or weak-ref attr. - bool isWeak() const { - return hasAttr() || hasAttr() || isWeakImported(); - } + bool isWeak() const; // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return classofKind(D->getKind()); } diff --git a/include/clang/AST/DeclAccessPair.h b/include/clang/AST/DeclAccessPair.h index 7ecd8f8bcd..5731308f55 100644 --- a/include/clang/AST/DeclAccessPair.h +++ b/include/clang/AST/DeclAccessPair.h @@ -19,6 +19,7 @@ #define LLVM_CLANG_AST_DECLACCESSPAIR_H #include "clang/Basic/Specifiers.h" +#include "llvm/Support/DataTypes.h" namespace clang { diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 50e202738d..7865566bec 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -14,7 +14,7 @@ #ifndef LLVM_CLANG_AST_DECLBASE_H #define LLVM_CLANG_AST_DECLBASE_H -#include "clang/AST/Attr.h" +#include "clang/AST/AttrIterator.h" #include "clang/AST/DeclarationName.h" #include "clang/AST/Type.h" #include "clang/Basic/Specifiers.h" @@ -455,9 +455,7 @@ public: /// getMaxAlignment - return the maximum alignment specified by attributes /// on this decl, 0 if there are none. - unsigned getMaxAlignment() const { - return hasAttrs() ? getMaxAttrAlignment(getAttrs(), getASTContext()) : 0; - } + unsigned getMaxAlignment() const; /// setInvalidDecl - Indicates the Decl had a semantic error. This /// allows for graceful error recovery. diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index ccfb5a6ccd..13155f0606 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -924,28 +924,12 @@ public: /// isArcWeakrefUnavailable - Checks for a class or one of its super classes /// to be incompatible with __weak references. Returns true if it is. - bool isArcWeakrefUnavailable() const { - const ObjCInterfaceDecl *Class = this; - while (Class) { - if (Class->hasAttr()) - return true; - Class = Class->getSuperClass(); - } - return false; - } + bool isArcWeakrefUnavailable() const; /// isObjCRequiresPropertyDefs - Checks that a class or one of its super /// classes must not be auto-synthesized. Returns class decl. if it must not /// be; 0, otherwise. - const ObjCInterfaceDecl *isObjCRequiresPropertyDefs() const { - const ObjCInterfaceDecl *Class = this; - while (Class) { - if (Class->hasAttr()) - return Class; - Class = Class->getSuperClass(); - } - return 0; - } + const ObjCInterfaceDecl *isObjCRequiresPropertyDefs() const; ObjCIvarDecl *lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared); diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index 9f213f1004..acf3cec5d4 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -30,6 +30,7 @@ class CXXDestructorDecl; class CXXMethodDecl; class CXXTemporary; class TemplateArgumentListInfo; +class UuidAttr; //===--------------------------------------------------------------------===// // C++ Expressions. diff --git a/include/clang/AST/PrettyPrinter.h b/include/clang/AST/PrettyPrinter.h index 7babc1b24a..6a99a00f7b 100644 --- a/include/clang/AST/PrettyPrinter.h +++ b/include/clang/AST/PrettyPrinter.h @@ -19,9 +19,10 @@ namespace clang { +class LangOptions; +class SourceManager; class Stmt; class TagDecl; -class LangOptions; class PrinterHelper { public: diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 4dc102e89d..f2a0e76982 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -14,13 +14,14 @@ #ifndef LLVM_CLANG_AST_STMT_H #define LLVM_CLANG_AST_STMT_H -#include "clang/Basic/LLVM.h" -#include "clang/Basic/SourceLocation.h" +#include "clang/AST/DeclGroup.h" #include "clang/AST/PrettyPrinter.h" #include "clang/AST/StmtIterator.h" -#include "clang/AST/DeclGroup.h" -#include "clang/AST/Attr.h" +#include "clang/Basic/IdentifierTable.h" +#include "clang/Basic/LLVM.h" +#include "clang/Basic/SourceLocation.h" #include "clang/Lex/Token.h" +#include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/raw_ostream.h" @@ -32,12 +33,13 @@ namespace llvm { namespace clang { class ASTContext; - class Expr; + class Attr; class Decl; - class ParmVarDecl; - class QualType; + class Expr; class IdentifierInfo; class LabelDecl; + class ParmVarDecl; + class QualType; class SourceManager; class StringLiteral; class SwitchStmt; @@ -302,14 +304,10 @@ public: // Only allow allocation of Stmts using the allocator in ASTContext // or by doing a placement new. void* operator new(size_t bytes, ASTContext& C, - unsigned alignment = 8) throw() { - return ::operator new(bytes, C, alignment); - } + unsigned alignment = 8) throw(); void* operator new(size_t bytes, ASTContext* C, - unsigned alignment = 8) throw() { - return ::operator new(bytes, *C, alignment); - } + unsigned alignment = 8) throw(); void* operator new(size_t bytes, void* mem) throw() { return mem; diff --git a/include/clang/AST/UnresolvedSet.h b/include/clang/AST/UnresolvedSet.h index de96601323..d26065e374 100644 --- a/include/clang/AST/UnresolvedSet.h +++ b/include/clang/AST/UnresolvedSet.h @@ -15,9 +15,11 @@ #ifndef LLVM_CLANG_AST_UNRESOLVEDSET_H #define LLVM_CLANG_AST_UNRESOLVEDSET_H -#include -#include "llvm/ADT/SmallVector.h" #include "clang/AST/DeclAccessPair.h" +#include "clang/Basic/LLVM.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/SmallVector.h" +#include namespace clang { diff --git a/include/clang/Sema/Initialization.h b/include/clang/Sema/Initialization.h index 80dbd38d19..3a8b345f7f 100644 --- a/include/clang/Sema/Initialization.h +++ b/include/clang/Sema/Initialization.h @@ -16,6 +16,7 @@ #include "clang/Sema/Ownership.h" #include "clang/Sema/Overload.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "clang/AST/Type.h" #include "clang/AST/UnresolvedSet.h" #include "clang/Basic/SourceLocation.h" diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index fea957dfe1..df820330e0 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -24,18 +24,19 @@ #include "clang/Sema/LocInfoType.h" #include "clang/Sema/TypoCorrection.h" #include "clang/Sema/Weak.h" +#include "clang/AST/Attr.h" +#include "clang/AST/DeclarationName.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprObjC.h" -#include "clang/AST/DeclarationName.h" #include "clang/AST/ExternalASTSource.h" #include "clang/AST/LambdaMangleContext.h" -#include "clang/AST/TypeLoc.h" #include "clang/AST/NSAPI.h" -#include "clang/Lex/ModuleLoader.h" +#include "clang/AST/TypeLoc.h" +#include "clang/Basic/ExpressionTraits.h" #include "clang/Basic/Specifiers.h" #include "clang/Basic/TemplateKinds.h" #include "clang/Basic/TypeTraits.h" -#include "clang/Basic/ExpressionTraits.h" +#include "clang/Lex/ModuleLoader.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/OwningPtr.h" diff --git a/lib/ARCMigrate/TransBlockObjCVariable.cpp b/lib/ARCMigrate/TransBlockObjCVariable.cpp index 2940f40290..97c4e3480c 100644 --- a/lib/ARCMigrate/TransBlockObjCVariable.cpp +++ b/lib/ARCMigrate/TransBlockObjCVariable.cpp @@ -28,6 +28,7 @@ #include "Transforms.h" #include "Internals.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "clang/Basic/SourceManager.h" using namespace clang; diff --git a/lib/ARCMigrate/TransUnbridgedCasts.cpp b/lib/ARCMigrate/TransUnbridgedCasts.cpp index 6e2d03ed55..55518d1266 100644 --- a/lib/ARCMigrate/TransUnbridgedCasts.cpp +++ b/lib/ARCMigrate/TransUnbridgedCasts.cpp @@ -34,9 +34,10 @@ #include "Transforms.h" #include "Internals.h" -#include "clang/Analysis/DomainSpecific/CocoaConventions.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "clang/AST/ParentMap.h" +#include "clang/Analysis/DomainSpecific/CocoaConventions.h" #include "clang/Basic/SourceManager.h" #include "clang/Lex/Lexer.h" #include "clang/Sema/SemaDiagnostic.h" diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 26c2941804..79c12d96b9 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -12,27 +12,28 @@ //===----------------------------------------------------------------------===// #include "clang/AST/ASTContext.h" +#include "clang/AST/ASTMutationListener.h" +#include "clang/AST/Attr.h" #include "clang/AST/CharUnits.h" +#include "clang/AST/Comment.h" #include "clang/AST/CommentCommandTraits.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" -#include "clang/AST/TypeLoc.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/ExternalASTSource.h" -#include "clang/AST/ASTMutationListener.h" -#include "clang/AST/RecordLayout.h" #include "clang/AST/Mangle.h" -#include "clang/AST/Comment.h" +#include "clang/AST/RecordLayout.h" +#include "clang/AST/TypeLoc.h" #include "clang/Basic/Builtins.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/TargetInfo.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/Support/Capacity.h" #include "llvm/Support/MathExtras.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/Support/Capacity.h" #include "CXXABI.h" #include diff --git a/lib/AST/CommentSema.cpp b/lib/AST/CommentSema.cpp index 08ecb3a994..fb1137a9ed 100644 --- a/lib/AST/CommentSema.cpp +++ b/lib/AST/CommentSema.cpp @@ -8,8 +8,9 @@ //===----------------------------------------------------------------------===// #include "clang/AST/CommentSema.h" -#include "clang/AST/CommentDiagnostic.h" +#include "clang/AST/Attr.h" #include "clang/AST/CommentCommandTraits.h" +#include "clang/AST/CommentDiagnostic.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclTemplate.h" #include "clang/Basic/SourceManager.h" diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 1f390eec05..73c83fc66b 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -16,12 +16,13 @@ #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/ASTContext.h" -#include "clang/AST/TypeLoc.h" -#include "clang/AST/Stmt.h" +#include "clang/AST/ASTMutationListener.h" +#include "clang/AST/Attr.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/PrettyPrinter.h" -#include "clang/AST/ASTMutationListener.h" +#include "clang/AST/Stmt.h" +#include "clang/AST/TypeLoc.h" #include "clang/Basic/Builtins.h" #include "clang/Basic/IdentifierTable.h" #include "clang/Basic/Module.h" @@ -2844,6 +2845,14 @@ LabelDecl *LabelDecl::CreateDeserialized(ASTContext &C, unsigned ID) { void ValueDecl::anchor() { } +bool ValueDecl::isWeak() const { + for (attr_iterator I = attr_begin(), E = attr_end(); I != E; ++I) + if (isa(*I) || isa(*I)) + return true; + + return isWeakImported(); +} + void ImplicitParamDecl::anchor() { } ImplicitParamDecl *ImplicitParamDecl::Create(ASTContext &C, DeclContext *DC, diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index b04c149dee..bfd6c27c09 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -19,12 +19,13 @@ #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/DependentDiagnostic.h" -#include "clang/AST/ExternalASTSource.h" #include "clang/AST/ASTContext.h" -#include "clang/AST/Type.h" +#include "clang/AST/ASTMutationListener.h" +#include "clang/AST/Attr.h" +#include "clang/AST/ExternalASTSource.h" #include "clang/AST/Stmt.h" #include "clang/AST/StmtCXX.h" -#include "clang/AST/ASTMutationListener.h" +#include "clang/AST/Type.h" #include "clang/Basic/TargetInfo.h" #include "llvm/ADT/DenseMap.h" #include "llvm/Support/raw_ostream.h" @@ -253,6 +254,19 @@ ASTMutationListener *Decl::getASTMutationListener() const { return getASTContext().getASTMutationListener(); } +unsigned Decl::getMaxAlignment() const { + if (!hasAttrs()) + return 0; + + unsigned Align = 0; + const AttrVec &V = getAttrs(); + ASTContext &Ctx = getASTContext(); + specific_attr_iterator I(V.begin()), E(V.end()); + for (; I != E; ++I) + Align = std::max(Align, I->getAlignment(Ctx)); + return Align; +} + bool Decl::isUsed(bool CheckUsedAttr) const { if (Used) return true; diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 65a987836f..2b7b13b43f 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -13,8 +13,9 @@ #include "clang/AST/DeclObjC.h" #include "clang/AST/ASTContext.h" -#include "clang/AST/Stmt.h" #include "clang/AST/ASTMutationListener.h" +#include "clang/AST/Attr.h" +#include "clang/AST/Stmt.h" #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SmallString.h" using namespace clang; @@ -205,6 +206,26 @@ void ObjCInterfaceDecl::collectPropertiesToImplement(PropertyMap &PM) const { // explicitly, have to search class extension properties. } +bool ObjCInterfaceDecl::isArcWeakrefUnavailable() const { + const ObjCInterfaceDecl *Class = this; + while (Class) { + if (Class->hasAttr()) + return true; + Class = Class->getSuperClass(); + } + return false; +} + +const ObjCInterfaceDecl *ObjCInterfaceDecl::isObjCRequiresPropertyDefs() const { + const ObjCInterfaceDecl *Class = this; + while (Class) { + if (Class->hasAttr()) + return Class; + Class = Class->getSuperClass(); + } + return 0; +} + void ObjCInterfaceDecl::mergeClassExtensionProtocolList( ObjCProtocolDecl *const* ExtList, unsigned ExtNum, ASTContext &C) diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 386ad66c99..83f38badd1 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -12,10 +12,11 @@ // //===----------------------------------------------------------------------===// #include "clang/AST/ASTContext.h" -#include "clang/AST/DeclVisitor.h" +#include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclObjC.h" +#include "clang/AST/DeclVisitor.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/PrettyPrinter.h" diff --git a/lib/AST/DumpXML.cpp b/lib/AST/DumpXML.cpp index 5f43fbc251..f2483f4296 100644 --- a/lib/AST/DumpXML.cpp +++ b/lib/AST/DumpXML.cpp @@ -17,6 +17,7 @@ // Only pay for this in code size in assertions-enabled builds. #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclFriend.h" @@ -37,8 +38,6 @@ #include "clang/AST/TypeLoc.h" #include "clang/AST/TypeLocVisitor.h" #include "clang/AST/TypeVisitor.h" -#include "clang/AST/Expr.h" -#include "clang/AST/ExprCXX.h" #include "llvm/ADT/SmallString.h" using namespace clang; diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp index f3a2e05638..e6171eb708 100644 --- a/lib/AST/Expr.cpp +++ b/lib/AST/Expr.cpp @@ -11,22 +11,23 @@ // //===----------------------------------------------------------------------===// -#include "clang/AST/Expr.h" -#include "clang/AST/ExprCXX.h" #include "clang/AST/APValue.h" #include "clang/AST/ASTContext.h" -#include "clang/AST/DeclObjC.h" +#include "clang/AST/Attr.h" #include "clang/AST/DeclCXX.h" +#include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/EvaluatedExprVisitor.h" +#include "clang/AST/Expr.h" +#include "clang/AST/ExprCXX.h" #include "clang/AST/RecordLayout.h" #include "clang/AST/StmtVisitor.h" -#include "clang/Lex/LiteralSupport.h" -#include "clang/Lex/Lexer.h" -#include "clang/Sema/SemaDiagnostic.h" #include "clang/Basic/Builtins.h" #include "clang/Basic/SourceManager.h" #include "clang/Basic/TargetInfo.h" +#include "clang/Lex/Lexer.h" +#include "clang/Lex/LiteralSupport.h" +#include "clang/Sema/SemaDiagnostic.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" #include diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp index 55722a2a99..1dc7de1b4d 100644 --- a/lib/AST/ExprCXX.cpp +++ b/lib/AST/ExprCXX.cpp @@ -11,12 +11,13 @@ // //===----------------------------------------------------------------------===// -#include "clang/Basic/IdentifierTable.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/TypeLoc.h" +#include "clang/Basic/IdentifierTable.h" using namespace clang; diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 7509d96a25..566a3894cb 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -16,6 +16,7 @@ //===----------------------------------------------------------------------===// #include "clang/AST/Mangle.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclObjC.h" @@ -27,8 +28,8 @@ #include "clang/Basic/SourceManager.h" #include "clang/Basic/TargetInfo.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/Support/raw_ostream.h" #include "llvm/Support/ErrorHandling.h" +#include "llvm/Support/raw_ostream.h" #define MANGLE_CHECKER 0 diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index afb8bf8844..0da7f516db 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -13,6 +13,7 @@ #include "clang/AST/Mangle.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "clang/AST/CharUnits.h" #include "clang/AST/Decl.h" #include "clang/AST/DeclCXX.h" @@ -21,7 +22,6 @@ #include "clang/AST/ExprCXX.h" #include "clang/Basic/ABI.h" #include "clang/Basic/DiagnosticOptions.h" - #include using namespace clang; diff --git a/lib/AST/Stmt.cpp b/lib/AST/Stmt.cpp index eafcf92eee..952f0ddf25 100644 --- a/lib/AST/Stmt.cpp +++ b/lib/AST/Stmt.cpp @@ -46,6 +46,16 @@ static StmtClassNameTable &getStmtInfoTableEntry(Stmt::StmtClass E) { return StmtClassInfo[E]; } +void *Stmt::operator new(size_t bytes, ASTContext& C, + unsigned alignment) throw() { + return ::operator new(bytes, C, alignment); +} + +void *Stmt::operator new(size_t bytes, ASTContext* C, + unsigned alignment) throw() { + return ::operator new(bytes, *C, alignment); +} + const char *Stmt::getStmtClassName() const { return getStmtInfoTableEntry((StmtClass) StmtBits.sClass).Name; } diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index e3398ae9c9..5ed970bf7b 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -13,13 +13,14 @@ //===----------------------------------------------------------------------===// #include "clang/AST/ASTContext.h" -#include "clang/AST/StmtVisitor.h" +#include "clang/AST/Attr.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" -#include "clang/AST/PrettyPrinter.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" +#include "clang/AST/PrettyPrinter.h" +#include "clang/AST/StmtVisitor.h" #include "llvm/ADT/SmallString.h" using namespace clang; diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp index 0aab240a53..97448eee81 100644 --- a/lib/AST/Type.cpp +++ b/lib/AST/Type.cpp @@ -12,13 +12,14 @@ //===----------------------------------------------------------------------===// #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "clang/AST/CharUnits.h" -#include "clang/AST/Type.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/Expr.h" #include "clang/AST/PrettyPrinter.h" +#include "clang/AST/Type.h" #include "clang/AST/TypeVisitor.h" #include "clang/Basic/Specifiers.h" #include "llvm/ADT/APSInt.h" diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 315e54380b..3fe76d58bc 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -12,20 +12,20 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Support/SaveAndRestore.h" #include "clang/Analysis/CFG.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" +#include "clang/AST/CharUnits.h" #include "clang/AST/DeclCXX.h" -#include "clang/AST/StmtVisitor.h" #include "clang/AST/PrettyPrinter.h" -#include "clang/AST/CharUnits.h" -#include "clang/Basic/AttrKinds.h" -#include "llvm/Support/GraphWriter.h" -#include "llvm/Support/Allocator.h" -#include "llvm/Support/Format.h" +#include "clang/AST/StmtVisitor.h" #include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/Support/Allocator.h" +#include "llvm/Support/Format.h" +#include "llvm/Support/GraphWriter.h" +#include "llvm/Support/SaveAndRestore.h" using namespace clang; diff --git a/lib/Analysis/ThreadSafety.cpp b/lib/Analysis/ThreadSafety.cpp index c7f1f62cb5..6245294c2c 100644 --- a/lib/Analysis/ThreadSafety.cpp +++ b/lib/Analysis/ThreadSafety.cpp @@ -20,13 +20,14 @@ #include "clang/Analysis/AnalysisContext.h" #include "clang/Analysis/CFG.h" #include "clang/Analysis/CFGStmtMap.h" +#include "clang/AST/Attr.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/StmtCXX.h" #include "clang/AST/StmtVisitor.h" -#include "clang/Basic/SourceManager.h" -#include "clang/Basic/SourceLocation.h" #include "clang/Basic/OperatorKinds.h" +#include "clang/Basic/SourceLocation.h" +#include "clang/Basic/SourceManager.h" #include "llvm/ADT/BitVector.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/ImmutableMap.h" diff --git a/lib/Analysis/UninitializedValues.cpp b/lib/Analysis/UninitializedValues.cpp index bbf59bf3b0..aa1a65674f 100644 --- a/lib/Analysis/UninitializedValues.cpp +++ b/lib/Analysis/UninitializedValues.cpp @@ -11,21 +11,22 @@ // //===----------------------------------------------------------------------===// -#include -#include "llvm/ADT/Optional.h" -#include "llvm/ADT/SmallBitVector.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/PackedVector.h" -#include "llvm/ADT/DenseMap.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "clang/AST/Decl.h" -#include "clang/Analysis/CFG.h" -#include "clang/Analysis/AnalysisContext.h" -#include "clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h" #include "clang/Analysis/Analyses/PostOrderCFGView.h" #include "clang/Analysis/Analyses/UninitializedValues.h" +#include "clang/Analysis/AnalysisContext.h" +#include "clang/Analysis/CFG.h" #include "clang/Analysis/DomainSpecific/ObjCNoReturn.h" +#include "clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/Optional.h" +#include "llvm/ADT/PackedVector.h" +#include "llvm/ADT/SmallBitVector.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Support/SaveAndRestore.h" +#include using namespace clang; diff --git a/lib/CodeGen/CodeGenTBAA.cpp b/lib/CodeGen/CodeGenTBAA.cpp index d9004a02ae..0a5a019764 100644 --- a/lib/CodeGen/CodeGenTBAA.cpp +++ b/lib/CodeGen/CodeGenTBAA.cpp @@ -17,12 +17,13 @@ #include "CodeGenTBAA.h" #include "clang/AST/ASTContext.h" -#include "clang/AST/RecordLayout.h" +#include "clang/AST/Attr.h" #include "clang/AST/Mangle.h" +#include "clang/AST/RecordLayout.h" #include "clang/Frontend/CodeGenOptions.h" +#include "llvm/Constants.h" #include "llvm/LLVMContext.h" #include "llvm/Metadata.h" -#include "llvm/Constants.h" #include "llvm/Type.h" using namespace clang; using namespace CodeGen; diff --git a/lib/Rewrite/Frontend/RewriteModernObjC.cpp b/lib/Rewrite/Frontend/RewriteModernObjC.cpp index 19acb94925..01811f642a 100644 --- a/lib/Rewrite/Frontend/RewriteModernObjC.cpp +++ b/lib/Rewrite/Frontend/RewriteModernObjC.cpp @@ -15,17 +15,18 @@ #include "clang/Rewrite/Core/Rewriter.h" #include "clang/AST/AST.h" #include "clang/AST/ASTConsumer.h" +#include "clang/AST/Attr.h" #include "clang/AST/ParentMap.h" -#include "clang/Basic/SourceManager.h" -#include "clang/Basic/IdentifierTable.h" #include "clang/Basic/Diagnostic.h" +#include "clang/Basic/IdentifierTable.h" +#include "clang/Basic/SourceManager.h" #include "clang/Lex/Lexer.h" +#include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/ADT/StringExtras.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/OwningPtr.h" -#include "llvm/ADT/DenseSet.h" using namespace clang; using llvm::utostr; diff --git a/lib/Rewrite/Frontend/RewriteObjC.cpp b/lib/Rewrite/Frontend/RewriteObjC.cpp index 982c730d28..d5f957c4b2 100644 --- a/lib/Rewrite/Frontend/RewriteObjC.cpp +++ b/lib/Rewrite/Frontend/RewriteObjC.cpp @@ -15,17 +15,18 @@ #include "clang/Rewrite/Core/Rewriter.h" #include "clang/AST/AST.h" #include "clang/AST/ASTConsumer.h" +#include "clang/AST/Attr.h" #include "clang/AST/ParentMap.h" -#include "clang/Basic/SourceManager.h" -#include "clang/Basic/IdentifierTable.h" #include "clang/Basic/Diagnostic.h" +#include "clang/Basic/IdentifierTable.h" +#include "clang/Basic/SourceManager.h" #include "clang/Lex/Lexer.h" +#include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/ADT/StringExtras.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/OwningPtr.h" -#include "llvm/ADT/DenseSet.h" using namespace clang; using llvm::utostr; diff --git a/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp b/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp index 81e8dd885a..ef7d63d6ef 100644 --- a/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp @@ -13,6 +13,7 @@ //===----------------------------------------------------------------------===// #include "ClangSACheckers.h" +#include "clang/AST/Attr.h" #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h" diff --git a/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp b/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp index 90872058af..18952dfb15 100644 --- a/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp +++ b/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp @@ -18,9 +18,10 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h" #include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h" -#include "clang/AST/ExprObjC.h" -#include "clang/AST/Expr.h" +#include "clang/AST/Attr.h" #include "clang/AST/DeclObjC.h" +#include "clang/AST/Expr.h" +#include "clang/AST/ExprObjC.h" #include "clang/Basic/LangOptions.h" #include "llvm/Support/raw_ostream.h" diff --git a/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp b/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp index 59e03ecd5c..05156bacf7 100644 --- a/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp @@ -14,6 +14,7 @@ #include "ClangSACheckers.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Attr.h" #include "clang/AST/ParentMap.h" #include "clang/AST/RecursiveASTVisitor.h" #include "clang/Analysis/Analyses/LiveVariables.h" diff --git a/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp b/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp index a9e02173c3..3db088f844 100644 --- a/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp @@ -20,6 +20,7 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" +#include "clang/AST/Attr.h" #include "clang/Basic/Builtins.h" #include diff --git a/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp b/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp index bf256cd9fa..9aaa366b9f 100644 --- a/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp @@ -26,6 +26,7 @@ #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h" #include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h" +#include "clang/AST/Attr.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/StmtVisitor.h" #include "llvm/ADT/DenseMap.h" diff --git a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index 33f68b6c11..5dad0f9d67 100644 --- a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -22,10 +22,11 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h" #include "clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h" +#include "clang/AST/Attr.h" #include "clang/Basic/SourceManager.h" #include "llvm/ADT/ImmutableMap.h" -#include "llvm/ADT/SmallString.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" #include diff --git a/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp b/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp index efb707294d..756cff8f70 100644 --- a/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp @@ -17,6 +17,7 @@ #include "clang/StaticAnalyzer/Core/CheckerManager.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" +#include "clang/AST/Attr.h" #include "llvm/ADT/StringSwitch.h" #include diff --git a/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp b/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp index 582269c332..b4ea105b84 100644 --- a/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp @@ -17,9 +17,10 @@ #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugReporter.h" -#include "clang/AST/ExprObjC.h" -#include "clang/AST/Expr.h" +#include "clang/AST/Attr.h" #include "clang/AST/DeclObjC.h" +#include "clang/AST/Expr.h" +#include "clang/AST/ExprObjC.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/SourceManager.h" diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index 304051c139..7056ea0837 100644 --- a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -13,12 +13,13 @@ //===----------------------------------------------------------------------===// #include "ClangSACheckers.h" -#include "clang/AST/DeclObjC.h" +#include "clang/AST/Attr.h" #include "clang/AST/DeclCXX.h" +#include "clang/AST/DeclObjC.h" +#include "clang/AST/ParentMap.h" +#include "clang/Analysis/DomainSpecific/CocoaConventions.h" #include "clang/Basic/LangOptions.h" #include "clang/Basic/SourceManager.h" -#include "clang/Analysis/DomainSpecific/CocoaConventions.h" -#include "clang/AST/ParentMap.h" #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h" #include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" @@ -31,8 +32,8 @@ #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/ImmutableList.h" #include "llvm/ADT/ImmutableMap.h" -#include "llvm/ADT/SmallString.h" #include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringExtras.h" #include diff --git a/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp b/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp index 30ccffaab0..6023048601 100644 --- a/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp @@ -12,11 +12,12 @@ //===----------------------------------------------------------------------===// #include "ClangSACheckers.h" +#include "clang/AST/Attr.h" +#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" #include "clang/StaticAnalyzer/Core/Checker.h" #include "clang/StaticAnalyzer/Core/CheckerManager.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h" -#include "clang/StaticAnalyzer/Core/BugReporter/BugType.h" #include "llvm/ADT/SmallString.h" #include "llvm/Support/raw_ostream.h" diff --git a/lib/StaticAnalyzer/Core/MemRegion.cpp b/lib/StaticAnalyzer/Core/MemRegion.cpp index 37f65ec31e..b034b7e823 100644 --- a/lib/StaticAnalyzer/Core/MemRegion.cpp +++ b/lib/StaticAnalyzer/Core/MemRegion.cpp @@ -17,6 +17,7 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h" #include "clang/Analysis/AnalysisContext.h" #include "clang/Analysis/Support/BumpVector.h" +#include "clang/AST/Attr.h" #include "clang/AST/CharUnits.h" #include "clang/AST/DeclObjC.h" #include "clang/AST/RecordLayout.h" diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp index aed994df41..251735b200 100644 --- a/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -14,14 +14,15 @@ // parameters are created lazily. // //===----------------------------------------------------------------------===// +#include "clang/AST/Attr.h" #include "clang/AST/CharUnits.h" #include "clang/Analysis/Analyses/LiveVariables.h" #include "clang/Analysis/AnalysisContext.h" #include "clang/Basic/TargetInfo.h" #include "clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h" +#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h" #include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h" -#include "clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h" #include "llvm/ADT/ImmutableList.h" #include "llvm/ADT/ImmutableMap.h" #include "llvm/ADT/Optional.h"