diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-04 06:12:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-04 06:12:32 +0000 |
commit | c5ffed4a66c7d586deb16f741dc41b8ae16c2e55 (patch) | |
tree | 2a8fe831594557649a77d6a5d04dd8dcb8e7edd7 /clang/lib/AST/ASTContext.cpp | |
parent | 318d3ef88e3ae765ffa5b9d5b477a1b2bf41d371 (diff) | |
download | bcm5719-llvm-c5ffed4a66c7d586deb16f741dc41b8ae16c2e55.tar.gz bcm5719-llvm-c5ffed4a66c7d586deb16f741dc41b8ae16c2e55.zip |
Introduce ContextDecl, patch by Argiris Kirtzidis!
-Added ContextDecl (no TranslationUnitDecl)
-ScopedDecl class has a ContextDecl member
-FieldDecl class has a ContextDecl member, so that a Field or a ObjCIvar can be traced back to their RecordDecl/ObjCInterfaceDecl easily
-FunctionDecl, ObjCMethodDecl, TagDecl, ObjCInterfaceDecl inherit from ContextDecl. With TagDecl as ContextDecl, enum constants have a EnumDecl as their context.
-Moved Decl class to a "DeclBase.h" along with ContextDecl class
-CurContext is handled by Sema
llvm-svn: 49208
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index ce75122b3d7..9e51b292fb3 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1115,7 +1115,7 @@ QualType ASTContext::maxIntegerType(QualType lhs, QualType rhs) { QualType ASTContext::getCFConstantStringType() { if (!CFConstantStringTypeDecl) { CFConstantStringTypeDecl = - RecordDecl::Create(*this, Decl::Struct, SourceLocation(), + RecordDecl::Create(*this, Decl::Struct, NULL, SourceLocation(), &Idents.get("NSConstantString"), 0); QualType FieldTypes[4]; @@ -1131,7 +1131,8 @@ QualType ASTContext::getCFConstantStringType() { FieldDecl *FieldDecls[4]; for (unsigned i = 0; i < 4; ++i) - FieldDecls[i] = FieldDecl::Create(*this, SourceLocation(), 0, + FieldDecls[i] = FieldDecl::Create(*this, CFConstantStringTypeDecl, + SourceLocation(), 0, FieldTypes[i]); CFConstantStringTypeDecl->defineBody(FieldDecls, 4); @@ -1907,14 +1908,14 @@ ASTContext* ASTContext::Create(llvm::Deserializer& D) { TargetInfo &t = D.ReadRef<TargetInfo>(); IdentifierTable &idents = D.ReadRef<IdentifierTable>(); SelectorTable &sels = D.ReadRef<SelectorTable>(); - + unsigned size_reserve = D.ReadInt(); ASTContext* A = new ASTContext(SM,t,idents,sels,size_reserve); for (unsigned i = 0; i < size_reserve; ++i) Type::Create(*A,i,D); - + // FIXME: A->CFConstantStringTypeDecl = D.ReadOwnedPtr<RecordDecl>(); return A; |