diff options
Diffstat (limited to 'clang/include/clang')
-rw-r--r-- | clang/include/clang/AST/ASTContext.h | 18 | ||||
-rw-r--r-- | clang/include/clang/AST/ASTFwd.h | 4 | ||||
-rw-r--r-- | clang/include/clang/AST/ASTTypeTraits.h | 3 | ||||
-rw-r--r-- | clang/include/clang/AST/Expr.h | 14 | ||||
-rw-r--r-- | clang/include/clang/AST/TypeLoc.h | 15 | ||||
-rw-r--r-- | clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h | 1 |
6 files changed, 22 insertions, 33 deletions
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 4ba54fa5188..024aa1cb021 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -22,7 +22,6 @@ #include "clang/AST/Decl.h" #include "clang/AST/DeclBase.h" #include "clang/AST/DeclarationName.h" -#include "clang/AST/Expr.h" #include "clang/AST/ExternalASTSource.h" #include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/PrettyPrinter.h" @@ -124,6 +123,7 @@ class UnresolvedSetIterator; class UsingShadowDecl; class VarTemplateDecl; class VTableContextBase; +struct BlockVarCopyInit; namespace Builtin { @@ -158,22 +158,6 @@ struct TypeInfo { /// Holds long-lived AST nodes (such as types and decls) that can be /// referred to throughout the semantic analysis of a file. class ASTContext : public RefCountedBase<ASTContext> { -public: - /// Copy initialization expr of a __block variable and a boolean flag that - /// indicates whether the expression can throw. - struct BlockVarCopyInit { - BlockVarCopyInit() = default; - BlockVarCopyInit(Expr *CopyExpr, bool CanThrow) - : ExprAndFlag(CopyExpr, CanThrow) {} - void setExprAndFlag(Expr *CopyExpr, bool CanThrow) { - ExprAndFlag.setPointerAndInt(CopyExpr, CanThrow); - } - Expr *getCopyExpr() const { return ExprAndFlag.getPointer(); } - bool canThrow() const { return ExprAndFlag.getInt(); } - llvm::PointerIntPair<Expr *, 1, bool> ExprAndFlag; - }; - -private: friend class NestedNameSpecifier; mutable SmallVector<Type *, 0> Types; diff --git a/clang/include/clang/AST/ASTFwd.h b/clang/include/clang/AST/ASTFwd.h index 25c32148544..5a891817b33 100644 --- a/clang/include/clang/AST/ASTFwd.h +++ b/clang/include/clang/AST/ASTFwd.h @@ -26,6 +26,10 @@ class Type; #define TYPE(DERIVED, BASE) class DERIVED##Type; #include "clang/AST/TypeNodes.inc" class CXXCtorInitializer; +class OMPClause; +#define OPENMP_CLAUSE(KIND, CLASSNAME) class CLASSNAME; +#include "clang/Basic/OpenMPKinds.def" + } // end namespace clang diff --git a/clang/include/clang/AST/ASTTypeTraits.h b/clang/include/clang/AST/ASTTypeTraits.h index dd4ead2f0c2..3e2f4162e13 100644 --- a/clang/include/clang/AST/ASTTypeTraits.h +++ b/clang/include/clang/AST/ASTTypeTraits.h @@ -16,10 +16,7 @@ #define LLVM_CLANG_AST_ASTTYPETRAITS_H #include "clang/AST/ASTFwd.h" -#include "clang/AST/Decl.h" #include "clang/AST/NestedNameSpecifier.h" -#include "clang/AST/OpenMPClause.h" -#include "clang/AST/Stmt.h" #include "clang/AST/TemplateBase.h" #include "clang/AST/TypeLoc.h" #include "clang/Basic/LLVM.h" diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h index afb710efe79..ef0d1e5b20a 100644 --- a/clang/include/clang/AST/Expr.h +++ b/clang/include/clang/AST/Expr.h @@ -5610,6 +5610,20 @@ public: } }; +/// Copy initialization expr of a __block variable and a boolean flag that +/// indicates whether the expression can throw. +struct BlockVarCopyInit { + BlockVarCopyInit() = default; + BlockVarCopyInit(Expr *CopyExpr, bool CanThrow) + : ExprAndFlag(CopyExpr, CanThrow) {} + void setExprAndFlag(Expr *CopyExpr, bool CanThrow) { + ExprAndFlag.setPointerAndInt(CopyExpr, CanThrow); + } + Expr *getCopyExpr() const { return ExprAndFlag.getPointer(); } + bool canThrow() const { return ExprAndFlag.getInt(); } + llvm::PointerIntPair<Expr *, 1, bool> ExprAndFlag; +}; + /// AsTypeExpr - Clang builtin function __builtin_astype [OpenCL 6.2.4.2] /// This AST node provides support for reinterpreting a type to another /// type of the same size. diff --git a/clang/include/clang/AST/TypeLoc.h b/clang/include/clang/AST/TypeLoc.h index 7f1d429ac3b..618e462d097 100644 --- a/clang/include/clang/AST/TypeLoc.h +++ b/clang/include/clang/AST/TypeLoc.h @@ -14,7 +14,6 @@ #ifndef LLVM_CLANG_AST_TYPELOC_H #define LLVM_CLANG_AST_TYPELOC_H -#include "clang/AST/Attr.h" #include "clang/AST/Decl.h" #include "clang/AST/NestedNameSpecifier.h" #include "clang/AST/TemplateBase.h" @@ -33,6 +32,7 @@ namespace clang { +class Attr; class ASTContext; class CXXRecordDecl; class Expr; @@ -878,18 +878,7 @@ public: return dyn_cast_or_null<T>(getAttr()); } - SourceRange getLocalSourceRange() const { - // Note that this does *not* include the range of the attribute - // enclosure, e.g.: - // __attribute__((foo(bar))) - // ^~~~~~~~~~~~~~~ ~~ - // or - // [[foo(bar)]] - // ^~ ~~ - // That enclosure doesn't necessarily belong to a single attribute - // anyway. - return getAttr() ? getAttr()->getRange() : SourceRange(); - } + SourceRange getLocalSourceRange() const; void initializeLocal(ASTContext &Context, SourceLocation loc) { setAttr(nullptr); diff --git a/clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h b/clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h index 10c89024652..f7bd5b58aab 100644 --- a/clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h +++ b/clang/include/clang/StaticAnalyzer/Checkers/SValExplainer.h @@ -15,6 +15,7 @@ #ifndef LLVM_CLANG_STATICANALYZER_CHECKERS_SVALEXPLAINER_H #define LLVM_CLANG_STATICANALYZER_CHECKERS_SVALEXPLAINER_H +#include "clang/AST/Attr.h" #include "clang/AST/DeclCXX.h" #include "clang/StaticAnalyzer/Core/PathSensitive/SValVisitor.h" |