[cfe-commits] r112032 - in /cfe/trunk: 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
John McCall
rjmccall at apple.com
Wed Aug 25 00:42:41 PDT 2010
Author: rjmccall
Date: Wed Aug 25 02:42:41 2010
New Revision: 112032
URL: http://llvm.org/viewvc/llvm-project?rev=112032&view=rev
Log:
Remove Sema.h's dependency on DeclCXX.h.
Modified:
cfe/trunk/include/clang/Sema/Lookup.h
cfe/trunk/include/clang/Sema/Sema.h
cfe/trunk/lib/Parse/ParseAST.cpp
cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
cfe/trunk/lib/Sema/JumpDiagnostics.cpp
cfe/trunk/lib/Sema/Sema.cpp
cfe/trunk/lib/Sema/SemaChecking.cpp
cfe/trunk/lib/Sema/SemaDecl.cpp
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
cfe/trunk/lib/Sema/TargetAttributesSema.cpp
cfe/trunk/lib/Sema/TargetAttributesSema.h
Modified: cfe/trunk/include/clang/Sema/Lookup.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Lookup.h (original)
+++ cfe/trunk/include/clang/Sema/Lookup.h Wed Aug 25 02:42:41 2010
@@ -16,6 +16,7 @@
#define LLVM_CLANG_SEMA_LOOKUP_H
#include "clang/Sema/Sema.h"
+#include "clang/AST/DeclCXX.h"
namespace clang {
Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Wed Aug 25 02:42:41 2010
@@ -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 @@
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 @@
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 @@
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,
Modified: cfe/trunk/lib/Parse/ParseAST.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseAST.cpp?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseAST.cpp (original)
+++ cfe/trunk/lib/Parse/ParseAST.cpp Wed Aug 25 02:42:41 2010
@@ -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"
Modified: cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp (original)
+++ cfe/trunk/lib/Sema/AnalysisBasedWarnings.cpp Wed Aug 25 02:42:41 2010
@@ -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"
Modified: cfe/trunk/lib/Sema/JumpDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/JumpDiagnostics.cpp?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/JumpDiagnostics.cpp (original)
+++ cfe/trunk/lib/Sema/JumpDiagnostics.cpp Wed Aug 25 02:42:41 2010
@@ -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"
Modified: cfe/trunk/lib/Sema/Sema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.cpp?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/Sema.cpp (original)
+++ cfe/trunk/lib/Sema/Sema.cpp Wed Aug 25 02:42:41 2010
@@ -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"
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Wed Aug 25 02:42:41 2010
@@ -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"
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Wed Aug 25 02:42:41 2010
@@ -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"
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Aug 25 02:42:41 2010
@@ -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"
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Aug 25 02:42:41 2010
@@ -3430,6 +3430,16 @@
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() {
Modified: cfe/trunk/lib/Sema/TargetAttributesSema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TargetAttributesSema.cpp?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TargetAttributesSema.cpp (original)
+++ cfe/trunk/lib/Sema/TargetAttributesSema.cpp Wed Aug 25 02:42:41 2010
@@ -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;
Modified: cfe/trunk/lib/Sema/TargetAttributesSema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TargetAttributesSema.h?rev=112032&r1=112031&r2=112032&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/TargetAttributesSema.h (original)
+++ cfe/trunk/lib/Sema/TargetAttributesSema.h Wed Aug 25 02:42:41 2010
@@ -13,7 +13,7 @@
namespace clang {
class Scope;
class Decl;
- class Attr;
+ class AttributeList;
class Sema;
class TargetAttributesSema {
More information about the cfe-commits
mailing list