diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-07-01 10:37:29 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-07-01 10:37:29 +0000 |
commit | 07952324dda0e758c17f8bc3015793c65c51c48c (patch) | |
tree | df23760bd379514f0adb730fe44cb2642df6d58c /lib/Sema/Sema.h | |
parent | aae2d7418b7004fde1ba08fe60db219d0c95ff30 (diff) |
Add Sema support for C++ classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.h')
-rw-r--r-- | lib/Sema/Sema.h | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 3e687b9659..9df94d4ae4 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -16,11 +16,13 @@ #define LLVM_CLANG_AST_SEMA_H #include "IdentifierResolver.h" +#include "CXXFieldCollector.h" #include "clang/Parse/Action.h" #include "clang/Parse/DeclSpec.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/OwningPtr.h" #include <vector> #include <string> @@ -109,6 +111,9 @@ public: ObjCCompatibleAliasDecl*> ObjCAliasTy; ObjCAliasTy ObjCAliasDecls; + /// FieldCollector - Collects CXXFieldDecls during parsing of C++ classes. + llvm::OwningPtr<CXXFieldCollector> FieldCollector; + IdentifierResolver IdResolver; // Enum values used by KnownFunctionIDs (see below). @@ -215,9 +220,7 @@ private: virtual DeclTy *FinalizeDeclaratorGroup(Scope *S, DeclTy *Group); virtual DeclTy *ActOnStartOfFunctionDef(Scope *S, Declarator &D); - // Until 'real' implementation is in place, override both - // 'ActOnStartOfFunctionDef' to satisfy the compiler. - virtual DeclTy *ActOnStartOfFunctionDef(Scope *S, DeclTy *D) { return D; } + virtual DeclTy *ActOnStartOfFunctionDef(Scope *S, DeclTy *D); virtual void ObjCActOnStartOfMethodDef(Scope *S, DeclTy *D); virtual DeclTy *ActOnFinishFunctionBody(DeclTy *Decl, StmtTy *Body); @@ -258,6 +261,8 @@ private: virtual void ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl, DeclTy **Elements, unsigned NumElements); private: + DeclContext *getDCParent(DeclContext *DC); + /// Set the current declaration context until it gets popped. void PushDeclContext(DeclContext *DC); void PopDeclContext(); @@ -545,6 +550,9 @@ public: SourceLocation LParenLoc, ExprTy *E, SourceLocation RParenLoc); + //// ActOnCXXThis - Parse 'this' pointer. + virtual ExprResult ActOnCXXThis(SourceLocation ThisLoc); + /// ActOnCXXBoolLiteral - Parse {true,false} literals. virtual ExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc, tok::TokenKind Kind); @@ -585,6 +593,20 @@ public: bool Virtual, AccessSpecifier Access, DeclTy *basetype, SourceLocation BaseLoc); + virtual void ActOnStartCXXClassDef(Scope *S, DeclTy *TagDecl, + SourceLocation LBrace); + + virtual DeclTy *ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, + Declarator &D, ExprTy *BitfieldWidth, + ExprTy *Init, DeclTy *LastInGroup); + + virtual void ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc, + DeclTy *TagDecl, + SourceLocation LBrac, + SourceLocation RBrac); + + virtual void ActOnFinishCXXClassDef(DeclTy *TagDecl,SourceLocation RBrace); + // Objective-C declarations. virtual DeclTy *ActOnStartClassInterface( |