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/Sema/Sema.h | |
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/Sema/Sema.h')
-rw-r--r-- | clang/lib/Sema/Sema.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index d2ad5c5f754..b1d0499d137 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -32,6 +32,7 @@ namespace clang { class ASTConsumer; class Preprocessor; class Decl; + class ContextDecl; class NamedDecl; class ScopedDecl; class Expr; @@ -73,7 +74,9 @@ class Sema : public Action { /// CurMethodDecl - If inside of a method body, this contains a pointer to /// the method decl for the method being parsed. ObjCMethodDecl *CurMethodDecl; - + + ContextDecl *CurContext; + /// LabelMap - This is a mapping from label identifiers to the LabelStmt for /// it (which acts like the label decl in some ways). Forward referenced /// labels have a LabelStmt created for them with a null location & SubStmt. @@ -246,6 +249,10 @@ private: virtual void ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl, DeclTy **Elements, unsigned NumElements); private: + /// Set the current declaration context until it gets popped. + void PushContextDecl(ContextDecl *CD); + void PopContextDecl(); + /// Subroutines of ActOnDeclarator(). TypedefDecl *ParseTypedefDecl(Scope *S, Declarator &D, QualType T, ScopedDecl *LastDecl); |