aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Sema/Lookup.h1
-rw-r--r--include/clang/Sema/Sema.h18
-rw-r--r--lib/Parse/ParseAST.cpp1
-rw-r--r--lib/Sema/AnalysisBasedWarnings.cpp1
-rw-r--r--lib/Sema/JumpDiagnostics.cpp1
-rw-r--r--lib/Sema/Sema.cpp1
-rw-r--r--lib/Sema/SemaChecking.cpp1
-rw-r--r--lib/Sema/SemaDecl.cpp1
-rw-r--r--lib/Sema/SemaDeclAttr.cpp1
-rw-r--r--lib/Sema/SemaDeclCXX.cpp10
-rw-r--r--lib/Sema/TargetAttributesSema.cpp3
-rw-r--r--lib/Sema/TargetAttributesSema.h2
12 files changed, 28 insertions, 13 deletions
diff --git a/include/clang/Sema/Lookup.h b/include/clang/Sema/Lookup.h
index 9b0b052390..c9b090ae22 100644
--- a/include/clang/Sema/Lookup.h
+++ b/include/clang/Sema/Lookup.h
@@ -16,6 +16,7 @@
#define LLVM_CLANG_SEMA_LOOKUP_H
#include "clang/Sema/Sema.h"
+#include "clang/AST/DeclCXX.h"
namespace clang {
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
index bb0da18092..2c06bcaf98 100644
--- a/include/clang/Sema/Sema.h
+++ b/include/clang/Sema/Sema.h
@@ -21,7 +21,6 @@
#include "clang/Sema/ObjCMethodList.h"
#include "clang/Sema/SemaDiagnostic.h"
#include "clang/AST/Decl.h"
-#include "clang/AST/DeclCXX.h"
#include "clang/AST/Expr.h"
#include "clang/AST/DeclarationName.h"
#include "llvm/ADT/OwningPtr.h"
@@ -396,7 +395,8 @@ public:
CXXRecordDecl *DerivedClass,
AccessSpecifier Access)
: Access(Access), IsMember(false),
- Target(BaseClass), NamingClass(DerivedClass),
+ Target(reinterpret_cast<NamedDecl*>(BaseClass)),
+ NamingClass(DerivedClass),
Diag(0, Context.getDiagAllocator()) {
}
@@ -409,7 +409,9 @@ public:
CXXRecordDecl *getNamingClass() const { return NamingClass; }
// ...and these apply to hierarchy conversions.
- CXXRecordDecl *getBaseClass() const { return cast<CXXRecordDecl>(Target); }
+ CXXRecordDecl *getBaseClass() const {
+ assert(!IsMember); return reinterpret_cast<CXXRecordDecl*>(Target);
+ }
CXXRecordDecl *getDerivedClass() const { return NamingClass; }
/// Retrieves the base object type, important when accessing
@@ -2157,16 +2159,10 @@ public:
AttributeList *AttrList);
virtual void ActOnFinishNamespaceDef(Decl *Dcl, SourceLocation RBrace);
- NamespaceDecl *getStdNamespace() const {
- return cast_or_null<NamespaceDecl>(
- StdNamespace.get(Context.getExternalSource()));
- }
+ NamespaceDecl *getStdNamespace() const;
NamespaceDecl *getOrCreateStdNamespace();
- CXXRecordDecl *getStdBadAlloc() const {
- return cast_or_null<CXXRecordDecl>(
- StdBadAlloc.get(Context.getExternalSource()));
- }
+ CXXRecordDecl *getStdBadAlloc() const;
virtual Decl *ActOnUsingDirective(Scope *CurScope,
SourceLocation UsingLoc,
diff --git a/lib/Parse/ParseAST.cpp b/lib/Parse/ParseAST.cpp
index e500aae369..d02787941b 100644
--- a/lib/Parse/ParseAST.cpp
+++ b/lib/Parse/ParseAST.cpp
@@ -17,6 +17,7 @@
#include "clang/Sema/SemaConsumer.h"
#include "clang/Sema/ExternalSemaSource.h"
#include "clang/AST/ASTConsumer.h"
+#include "clang/AST/DeclCXX.h"
#include "clang/AST/ExternalASTSource.h"
#include "clang/AST/Stmt.h"
#include "clang/Parse/Parser.h"
diff --git a/lib/Sema/AnalysisBasedWarnings.cpp b/lib/Sema/AnalysisBasedWarnings.cpp
index b57f33d410..775681eebe 100644
--- a/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/lib/Sema/AnalysisBasedWarnings.cpp
@@ -17,6 +17,7 @@
#include "clang/Sema/AnalysisBasedWarnings.h"
#include "clang/Basic/SourceManager.h"
#include "clang/AST/DeclObjC.h"
+#include "clang/AST/DeclCXX.h"
#include "clang/AST/ExprObjC.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/StmtObjC.h"
diff --git a/lib/Sema/JumpDiagnostics.cpp b/lib/Sema/JumpDiagnostics.cpp
index f3dc6ceafe..7bab65a072 100644
--- a/lib/Sema/JumpDiagnostics.cpp
+++ b/lib/Sema/JumpDiagnostics.cpp
@@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
#include "clang/Sema/Sema.h"
+#include "clang/AST/DeclCXX.h"
#include "clang/AST/Expr.h"
#include "clang/AST/StmtObjC.h"
#include "clang/AST/StmtCXX.h"
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 569f4edf4a..1de7b7fbea 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -23,6 +23,7 @@
#include "clang/Sema/SemaConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTDiagnostic.h"
+#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/Lex/Preprocessor.h"
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index 61d209f683..7a64511f32 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -16,6 +16,7 @@
#include "clang/Analysis/Analyses/FormatString.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/CharUnits.h"
+#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/ExprCXX.h"
#include "clang/AST/ExprObjC.h"
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 6500e889c8..219a46d7da 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -20,6 +20,7 @@
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/CXXInheritance.h"
+#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/ExprCXX.h"
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index dcee0b396f..f515e68839 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -14,6 +14,7 @@
#include "clang/Sema/Sema.h"
#include "TargetAttributesSema.h"
#include "clang/AST/ASTContext.h"
+#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/Basic/TargetInfo.h"
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 9fed285064..7761ac910e 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -3430,6 +3430,16 @@ void Sema::ActOnFinishNamespaceDef(Decl *Dcl, SourceLocation RBrace) {
PopPragmaVisibility();
}
+CXXRecordDecl *Sema::getStdBadAlloc() const {
+ return cast_or_null<CXXRecordDecl>(
+ StdBadAlloc.get(Context.getExternalSource()));
+}
+
+NamespaceDecl *Sema::getStdNamespace() const {
+ return cast_or_null<NamespaceDecl>(
+ StdNamespace.get(Context.getExternalSource()));
+}
+
/// \brief Retrieve the special "std" namespace, which may require us to
/// implicitly define the namespace.
NamespaceDecl *Sema::getOrCreateStdNamespace() {
diff --git a/lib/Sema/TargetAttributesSema.cpp b/lib/Sema/TargetAttributesSema.cpp
index dc08a735a7..52b069675d 100644
--- a/lib/Sema/TargetAttributesSema.cpp
+++ b/lib/Sema/TargetAttributesSema.cpp
@@ -12,9 +12,10 @@
//
//===----------------------------------------------------------------------===//
-#include "clang/Sema/Sema.h"
#include "TargetAttributesSema.h"
+#include "clang/Sema/Sema.h"
#include "clang/Basic/TargetInfo.h"
+#include "clang/AST/DeclCXX.h"
#include "llvm/ADT/Triple.h"
using namespace clang;
diff --git a/lib/Sema/TargetAttributesSema.h b/lib/Sema/TargetAttributesSema.h
index 8794e4013e..410c900222 100644
--- a/lib/Sema/TargetAttributesSema.h
+++ b/lib/Sema/TargetAttributesSema.h
@@ -13,7 +13,7 @@
namespace clang {
class Scope;
class Decl;
- class Attr;
+ class AttributeList;
class Sema;
class TargetAttributesSema {