#define LLVM_CLANG_SEMA_LOOKUP_H
#include "clang/Sema/Sema.h"
+#include "clang/AST/DeclCXX.h"
namespace clang {
#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"
CXXRecordDecl *DerivedClass,
AccessSpecifier Access)
: Access(Access), IsMember(false),
- Target(BaseClass), NamingClass(DerivedClass),
+ Target(reinterpret_cast<NamedDecl*>(BaseClass)),
+ NamingClass(DerivedClass),
Diag(0, Context.getDiagAllocator()) {
}
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
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,
#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"
#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"
//===----------------------------------------------------------------------===//
#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"
#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"
#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"
#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"
#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"
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() {
//
//===----------------------------------------------------------------------===//
-#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;
namespace clang {
class Scope;
class Decl;
- class Attr;
+ class AttributeList;
class Sema;
class TargetAttributesSema {