]> granicus.if.org Git - clang/commitdiff
Remove Sema.h's dependency on DeclCXX.h.
authorJohn McCall <rjmccall@apple.com>
Wed, 25 Aug 2010 07:42:41 +0000 (07:42 +0000)
committerJohn McCall <rjmccall@apple.com>
Wed, 25 Aug 2010 07:42:41 +0000 (07:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112032 91177308-0d34-0410-b5e6-96231b3b80d8

12 files changed:
include/clang/Sema/Lookup.h
include/clang/Sema/Sema.h
lib/Parse/ParseAST.cpp
lib/Sema/AnalysisBasedWarnings.cpp
lib/Sema/JumpDiagnostics.cpp
lib/Sema/Sema.cpp
lib/Sema/SemaChecking.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaDeclCXX.cpp
lib/Sema/TargetAttributesSema.cpp
lib/Sema/TargetAttributesSema.h

index 9b0b052390db7b1644ae939c6c2bd75ab2817a7c..c9b090ae228cb3d0b12cf0bf9418e73a8557ac8e 100644 (file)
@@ -16,6 +16,7 @@
 #define LLVM_CLANG_SEMA_LOOKUP_H
 
 #include "clang/Sema/Sema.h"
+#include "clang/AST/DeclCXX.h"
 
 namespace clang {
 
index bb0da18092f6dbe67aa84a29e576ca909f9f672c..2c06bcaf9820c593a019980f8b39796ba4d92a6f 100644 (file)
@@ -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,
index e500aae369dc45105f8a9c4307eda4176a295f03..d02787941b0dc168cd9109587f0b91b4b236a39e 100644 (file)
@@ -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"
index b57f33d4103f31e96073f7949a2568d0309680a6..775681eebe96cc4d58e1306489454ded757efc26 100644 (file)
@@ -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"
index f3dc6ceafe6e9120d6d2d8986fd68fd5d5465db4..7bab65a072ad0685bdd2e4f1db1a6d34b7ff10ee 100644 (file)
@@ -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"
index 569f4edf4ad3f291905b452f66863fa527b013fe..1de7b7fbead873c9eb4e8ddb86c997f99f048456 100644 (file)
@@ -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"
index 61d209f683289bb86099b1045d47deaa30628f3b..7a64511f32290b4c683d41edd147213e2f080122 100644 (file)
@@ -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"
index 6500e889c8c58ca9f7ea80a5ac36714df73bf402..219a46d7dadb10e1b59d01f324ae85f417f749c8 100644 (file)
@@ -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"
index dcee0b396f47bc6a4568055dfc562ec809eeec6c..f515e6883970a62d563a7d0280d6e38e12ed09ff 100644 (file)
@@ -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"
index 9fed285064bd6c821d0b0f9b267b2f4734c7201d..7761ac910ed6cc070c5e84582dc0cd823ca4cc1b 100644 (file)
@@ -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() {
index dc08a735a753826398f1ca7c62c64d3716be6f93..52b069675defeb682dad2ea24fa451b9f841f45c 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#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;
index 8794e4013ec7be9c8afe8739bbc569a6c7bb2db1..410c900222f6266c4f4f6e10cb942e9883e38cc0 100644 (file)
@@ -13,7 +13,7 @@
 namespace clang {
   class Scope;
   class Decl;
-  class Attr;
+  class AttributeList;
   class Sema;
 
   class TargetAttributesSema {