blob: ceb0500c3f64be3848ba878bc394f4305a6ad54e [file] [log] [blame]
Reid Spencer5f016e22007-07-11 17:01:13 +00001//===--- PrintParserActions.cpp - Implement -parse-print-callbacks mode ---===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner0bc735f2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Reid Spencer5f016e22007-07-11 17:01:13 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This code simply runs the preprocessor on the input file and prints out the
11// result. This is the traditional behavior of the -E option.
12//
13//===----------------------------------------------------------------------===//
14
Ted Kremenekc2542b62009-03-31 18:58:14 +000015#include "clang-cc.h"
Reid Spencer5f016e22007-07-11 17:01:13 +000016#include "clang/Parse/Action.h"
17#include "clang/Parse/DeclSpec.h"
Ted Kremenekbdd30c22008-01-14 16:44:48 +000018#include "llvm/Support/Streams.h"
Reid Spencer5f016e22007-07-11 17:01:13 +000019using namespace clang;
20
21namespace {
22 class ParserPrintActions : public MinimalAction {
23
Steve Naroffb4292f22007-10-31 20:55:39 +000024 public:
Daniel Dunbare10b0f22008-10-31 08:56:51 +000025 ParserPrintActions(Preprocessor &PP) : MinimalAction(PP) {}
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000026
27 // Printing Functions which also must call MinimalAction
28
Steve Naroff08d92e42007-09-15 18:49:24 +000029 /// ActOnDeclarator - This callback is invoked when a declarator is parsed
Reid Spencer5f016e22007-07-11 17:01:13 +000030 /// and 'Init' specifies the initializer if any. This is for things like:
31 /// "int X = 4" or "typedef int foo".
Chris Lattner682bf922009-03-29 16:50:03 +000032 virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000033 llvm::cout << __FUNCTION__ << " ";
Reid Spencer5f016e22007-07-11 17:01:13 +000034 if (IdentifierInfo *II = D.getIdentifier()) {
Ted Kremenekbdd30c22008-01-14 16:44:48 +000035 llvm::cout << "'" << II->getName() << "'";
Reid Spencer5f016e22007-07-11 17:01:13 +000036 } else {
Ted Kremenekbdd30c22008-01-14 16:44:48 +000037 llvm::cout << "<anon>";
Reid Spencer5f016e22007-07-11 17:01:13 +000038 }
Ted Kremenekbdd30c22008-01-14 16:44:48 +000039 llvm::cout << "\n";
Reid Spencer5f016e22007-07-11 17:01:13 +000040
41 // Pass up to EmptyActions so that the symbol table is maintained right.
Chris Lattner682bf922009-03-29 16:50:03 +000042 return MinimalAction::ActOnDeclarator(S, D);
Reid Spencer5f016e22007-07-11 17:01:13 +000043 }
Steve Naroff640db422007-10-10 17:45:44 +000044 /// ActOnPopScope - This callback is called immediately before the specified
45 /// scope is popped and deleted.
46 virtual void ActOnPopScope(SourceLocation Loc, Scope *S) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000047 llvm::cout << __FUNCTION__ << "\n";
48 return MinimalAction::ActOnPopScope(Loc, S);
49 }
50
51 /// ActOnTranslationUnitScope - This callback is called once, immediately
52 /// after creating the translation unit scope (in Parser::Initialize).
53 virtual void ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
54 llvm::cout << __FUNCTION__ << "\n";
55 MinimalAction::ActOnTranslationUnitScope(Loc, S);
56 }
57
58
Chris Lattnerb28317a2009-03-28 19:18:32 +000059 Action::DeclPtrTy ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
60 IdentifierInfo *ClassName,
61 SourceLocation ClassLoc,
62 IdentifierInfo *SuperName,
63 SourceLocation SuperLoc,
64 const DeclPtrTy *ProtoRefs,
65 unsigned NumProtocols,
66 SourceLocation EndProtoLoc,
67 AttributeList *AttrList) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000068 llvm::cout << __FUNCTION__ << "\n";
69 return MinimalAction::ActOnStartClassInterface(AtInterfaceLoc,
70 ClassName, ClassLoc,
71 SuperName, SuperLoc,
72 ProtoRefs, NumProtocols,
73 EndProtoLoc, AttrList);
74 }
75
76 /// ActOnForwardClassDeclaration -
77 /// Scope will always be top level file scope.
Chris Lattnerb28317a2009-03-28 19:18:32 +000078 Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
79 IdentifierInfo **IdentList,
80 unsigned NumElts) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000081 llvm::cout << __FUNCTION__ << "\n";
82 return MinimalAction::ActOnForwardClassDeclaration(AtClassLoc, IdentList,
83 NumElts);
84 }
85
86 // Pure Printing
87
88 /// ActOnParamDeclarator - This callback is invoked when a parameter
89 /// declarator is parsed. This callback only occurs for functions
90 /// with prototypes. S is the function prototype scope for the
91 /// parameters (C++ [basic.scope.proto]).
Chris Lattnerb28317a2009-03-28 19:18:32 +000092 virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000093 llvm::cout << __FUNCTION__ << " ";
94 if (IdentifierInfo *II = D.getIdentifier()) {
95 llvm::cout << "'" << II->getName() << "'";
96 } else {
97 llvm::cout << "<anon>";
98 }
99 llvm::cout << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000100 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000101 }
102
103 /// AddInitializerToDecl - This action is called immediately after
104 /// ParseDeclarator (when an initializer is present). The code is factored
105 /// this way to make sure we are able to handle the following:
106 /// void func() { int xx = xx; }
107 /// This allows ActOnDeclarator to register "xx" prior to parsing the
108 /// initializer. The declaration above should still result in a warning,
109 /// since the reference to "xx" is uninitialized.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000110 virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000111 llvm::cout << __FUNCTION__ << "\n";
112 }
113
Chris Lattner682bf922009-03-29 16:50:03 +0000114 /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed,
115 /// this gives the actions implementation a chance to process the group as
116 /// a whole.
117 virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, DeclPtrTy *Group,
118 unsigned NumDecls) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000119 llvm::cout << __FUNCTION__ << "\n";
Chris Lattner682bf922009-03-29 16:50:03 +0000120 return DeclGroupPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000121 }
122
123 /// ActOnStartOfFunctionDef - This is called at the start of a function
124 /// definition, instead of calling ActOnDeclarator. The Declarator includes
125 /// information about formal arguments that are part of this function.
Chris Lattner682bf922009-03-29 16:50:03 +0000126 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope,
127 Declarator &D){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000128 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000129 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000130 }
131
132 /// ActOnStartOfFunctionDef - This is called at the start of a function
133 /// definition, after the FunctionDecl has already been created.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000134 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000135 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000136 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000137 }
138
Chris Lattnerb28317a2009-03-28 19:18:32 +0000139 virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000140 llvm::cout << __FUNCTION__ << "\n";
141 }
142
143 /// ActOnFunctionDefBody - This is called when a function body has completed
144 /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000145 virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000146 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000147 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000148 }
149
Chris Lattnerb28317a2009-03-28 19:18:32 +0000150 virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
151 ExprArg AsmString) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000152 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000153 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000154 }
155
156 /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
157 /// no declarator (e.g. "struct foo;") is parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000158 virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000159 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000160 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000161 }
Douglas Gregore79837a2008-12-17 01:46:43 +0000162
163 /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
164 /// contained braces. Lang/StrSize contains the language string that
165 /// was parsed at location Loc. Decls/NumDecls provides the
166 /// declarations parsed inside the linkage specification.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000167 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
168 SourceLocation LBrace,
169 SourceLocation RBrace, const char *Lang,
170 unsigned StrSize,
171 DeclPtrTy *Decls, unsigned NumDecls) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000172 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000173 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000174 }
Douglas Gregore79837a2008-12-17 01:46:43 +0000175
176 /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
177 /// braces. Lang/StrSize contains the language string that was
178 /// parsed at location Loc. D is the declaration parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000179 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
180 unsigned StrSize, DeclPtrTy D) {
181 return DeclPtrTy();
Douglas Gregore79837a2008-12-17 01:46:43 +0000182 }
183
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000184 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000185 // Type Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000186 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000187
Sebastian Redlcee63fb2008-12-02 14:43:59 +0000188 virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000189 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000190 return TypeResult();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000191 }
192
Chris Lattnerb28317a2009-03-28 19:18:32 +0000193 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagType, TagKind TK,
194 SourceLocation KWLoc, const CXXScopeSpec &SS,
195 IdentifierInfo *Name, SourceLocation NameLoc,
196 AttributeList *Attr, AccessSpecifier AS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000197 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
198 // is (struct/union/enum/class).
199 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000200 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000201 }
202
203 /// Act on @defs() element found when parsing a structure. ClassName is the
204 /// name of the referenced class.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000205 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000206 IdentifierInfo *ClassName,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000207 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000208 llvm::cout << __FUNCTION__ << "\n";
209 }
210
Chris Lattnerb28317a2009-03-28 19:18:32 +0000211 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
212 SourceLocation DeclStart,
213 Declarator &D, ExprTy *BitfieldWidth) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000214 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000215 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000216 }
217
Chris Lattnerb28317a2009-03-28 19:18:32 +0000218 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
219 Declarator &D, ExprTy *BitfieldWidth,
220 tok::ObjCKeywordKind visibility) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000221 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000222 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000223 }
224
Chris Lattnerb28317a2009-03-28 19:18:32 +0000225 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
226 DeclPtrTy *Fields, unsigned NumFields,
Daniel Dunbar1bfe1c22008-10-03 02:03:53 +0000227 SourceLocation LBrac, SourceLocation RBrac,
228 AttributeList *AttrList) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000229 llvm::cout << __FUNCTION__ << "\n";
230 }
231
Chris Lattnerb28317a2009-03-28 19:18:32 +0000232 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
233 DeclPtrTy LastEnumConstant,
234 SourceLocation IdLoc,IdentifierInfo *Id,
235 SourceLocation EqualLoc, ExprTy *Val) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000236 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000237 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000238 }
239
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000240 virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
241 SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000242 DeclPtrTy *Elements, unsigned NumElements) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000243 llvm::cout << __FUNCTION__ << "\n";
244 }
245
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000246 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000247 // Statement Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000248 //===------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000249
250 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000251 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000252 return StmtEmpty();
253 }
254
255 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
256 SourceLocation R,
257 MultiStmtArg Elts,
258 bool isStmtExpr) {
259 llvm::cout << __FUNCTION__ << "\n";
260 return StmtEmpty();
261 }
Chris Lattner682bf922009-03-29 16:50:03 +0000262 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000263 SourceLocation StartLoc,
264 SourceLocation EndLoc) {
265 llvm::cout << __FUNCTION__ << "\n";
266 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000267 }
268
Sebastian Redla60528c2008-12-21 12:04:03 +0000269 virtual OwningStmtResult ActOnExprStmt(ExprArg Expr) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000270 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000271 return OwningStmtResult(*this, Expr.release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000272 }
273
274 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
275 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000276 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
277 ExprArg LHSVal,
278 SourceLocation DotDotDotLoc,
279 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000280 SourceLocation ColonLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000281 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000282 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000283 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000284 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
285 SourceLocation ColonLoc,
286 StmtArg SubStmt, Scope *CurScope){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000287 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000288 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000289 }
Sebastian Redlde307472009-01-11 00:38:46 +0000290
291 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
292 IdentifierInfo *II,
293 SourceLocation ColonLoc,
294 StmtArg SubStmt) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000295 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000296 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000297 }
Sebastian Redlde307472009-01-11 00:38:46 +0000298
299 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc, ExprArg CondVal,
300 StmtArg ThenVal,SourceLocation ElseLoc,
301 StmtArg ElseVal) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000302 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000303 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000304 }
Sebastian Redlde307472009-01-11 00:38:46 +0000305
306 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000307 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000308 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000309 }
Sebastian Redlde307472009-01-11 00:38:46 +0000310
311 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
312 StmtArg Switch,
313 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000314 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000315 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000316 }
317
Sebastian Redlf05b1522009-01-16 23:28:06 +0000318 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
319 ExprArg Cond, StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000320 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000321 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000322 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000323 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
324 SourceLocation WhileLoc, ExprArg Cond){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000325 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000326 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000327 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000328 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
329 SourceLocation LParenLoc,
330 StmtArg First, ExprArg Second,
331 ExprArg Third, SourceLocation RParenLoc,
332 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000333 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000334 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000335 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000336 virtual OwningStmtResult ActOnObjCForCollectionStmt(
337 SourceLocation ForColLoc,
338 SourceLocation LParenLoc,
339 StmtArg First, ExprArg Second,
340 SourceLocation RParenLoc, StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000341 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000342 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000343 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000344 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
345 SourceLocation LabelLoc,
346 IdentifierInfo *LabelII) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000347 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000348 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000349 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000350 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
351 SourceLocation StarLoc,
352 ExprArg DestExp) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000353 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000354 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000355 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000356 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
357 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000358 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000359 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000360 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000361 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
362 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000363 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000364 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000365 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000366 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
367 ExprArg RetValExp) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000368 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000369 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000370 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000371 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000372 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000373 bool IsVolatile,
374 unsigned NumOutputs,
375 unsigned NumInputs,
376 std::string *Names,
377 MultiExprArg Constraints,
378 MultiExprArg Exprs,
379 ExprArg AsmString,
380 MultiExprArg Clobbers,
381 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000382 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000383 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000384 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000385
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000386 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000387 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
388 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000389 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000390 StmtArg CatchList) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000391 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000392 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000393 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000394
395 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
396 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000397 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000398 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000399 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000400
401 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
402 StmtArg Try, StmtArg Catch,
403 StmtArg Finally) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000404 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000405 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000406 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000407
408 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000409 ExprArg Throw,
410 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000411 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000412 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000413 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000414
415 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
416 ExprArg SynchExpr,
417 StmtArg SynchBody) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000418 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000419 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000420 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000421
422 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000423 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Sebastian Redla0fd8652008-12-21 16:41:36 +0000424 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000425 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000426 }
427
428 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000429 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000430 StmtArg HandlerBlock) {
431 llvm::cout << __FUNCTION__ << "\n";
432 return StmtEmpty();
433 }
434
435 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
436 StmtArg TryBlock,
437 MultiStmtArg Handlers) {
438 llvm::cout << __FUNCTION__ << "\n";
439 return StmtEmpty();
440 }
441
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000442 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000443 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000444 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000445
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000446 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000447
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000448 /// ActOnIdentifierExpr - Parse an identifier in expression context.
449 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
450 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000451 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
452 IdentifierInfo &II,
453 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000454 const CXXScopeSpec *SS,
455 bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000456 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000457 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000458 }
459
Sebastian Redlcd965b92009-01-18 18:53:16 +0000460 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
461 Scope *S, SourceLocation OperatorLoc,
462 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000463 bool HasTrailingLParen, const CXXScopeSpec &SS,
464 bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000465 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000466 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000467 }
468
Sebastian Redlcd965b92009-01-18 18:53:16 +0000469 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
470 Scope *S, SourceLocation OperatorLoc,
471 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000472 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000473 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000474 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000475 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000476
477 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
478 tok::TokenKind Kind) {
479 llvm::cout << __FUNCTION__ << "\n";
480 return ExprEmpty();
481 }
482
483 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
484 llvm::cout << __FUNCTION__ << "\n";
485 return ExprEmpty();
486 }
487
488 virtual OwningExprResult ActOnNumericConstant(const Token &) {
489 llvm::cout << __FUNCTION__ << "\n";
490 return ExprEmpty();
491 }
492
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000493 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
494 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000495 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
496 unsigned NumToks) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000497 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000498 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000499 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000500
501 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
502 ExprArg Val) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000503 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000504 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000505 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000506
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000507 // Postfix Expressions.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000508 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
509 tok::TokenKind Kind,
510 ExprArg Input) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000511 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000512 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000513 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000514 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
515 SourceLocation LLoc,
516 ExprArg Idx,
517 SourceLocation RLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000518 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000519 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000520 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000521 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
522 SourceLocation OpLoc,
523 tok::TokenKind OpKind,
524 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000525 IdentifierInfo &Member,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000526 DeclPtrTy ImplDecl) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000527 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000528 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000529 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000530
531 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
532 SourceLocation LParenLoc,
533 MultiExprArg Args,
534 SourceLocation *CommaLocs,
535 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000536 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000537 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000538 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000539
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000540 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000541 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
542 tok::TokenKind Op, ExprArg Input) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000543 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000544 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000545 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000546 virtual OwningExprResult
547 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
548 void *TyOrEx, const SourceRange &ArgRange) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000549 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000550 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000551 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000552
553 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
554 TypeTy *Ty,
555 SourceLocation RParen,
556 ExprArg Op) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000557 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000558 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000559 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000560 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
561 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000562 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000563 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000564 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000565 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000566 virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
567 SourceLocation RParenLoc,ExprArg Op){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000568 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000569 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000570 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000571
572 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
573 tok::TokenKind Kind,
574 ExprArg LHS, ExprArg RHS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000575 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000576 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000577 }
578
579 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
580 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000581 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
582 SourceLocation ColonLoc,
583 ExprArg Cond, ExprArg LHS,
584 ExprArg RHS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000585 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000586 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000587 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000588
589 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000590
Sebastian Redlf53597f2009-03-15 17:47:39 +0000591 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
592 SourceLocation LabLoc,
593 IdentifierInfo *LabelII) {// "&&foo"
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000594 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000595 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000596 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000597
598 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
599 StmtArg SubStmt,
600 SourceLocation RPLoc) { // "({..})"
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000601 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000602 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000603 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000604
605 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
606 SourceLocation BuiltinLoc,
607 SourceLocation TypeLoc,
608 TypeTy *Arg1,
609 OffsetOfComponent *CompPtr,
610 unsigned NumComponents,
611 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000612 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000613 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000614 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000615
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000616 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000617 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
618 TypeTy *arg1,TypeTy *arg2,
619 SourceLocation RPLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000620 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000621 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000622 }
623 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000624 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
625 ExprArg cond, ExprArg expr1,
626 ExprArg expr2,
627 SourceLocation RPLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000628 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000629 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000630 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000631
632 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000633 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
634 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000635 SourceLocation RPLoc) {
636 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000637 return ExprEmpty();
638 }
639
640 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
641 llvm::cout << __FUNCTION__ << "\n";
642 return ExprEmpty();
643 }
644
645 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
646 llvm::cout << __FUNCTION__ << "\n";
647 }
648
649 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
650 llvm::cout << __FUNCTION__ << "\n";
651 }
652
653 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
654 llvm::cout << __FUNCTION__ << "\n";
655 }
656
657 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
658 StmtArg Body,
659 Scope *CurScope) {
660 llvm::cout << __FUNCTION__ << "\n";
661 return ExprEmpty();
662 }
663
Chris Lattnerb28317a2009-03-28 19:18:32 +0000664 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
665 IdentifierInfo *Ident,
666 SourceLocation LBrace) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000667 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000668 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000669 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000670
Chris Lattnerb28317a2009-03-28 19:18:32 +0000671 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000672 llvm::cout << __FUNCTION__ << "\n";
673 return;
674 }
675
676#if 0
677 // FIXME: AttrList should be deleted by this function, but the definition
678 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000679 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
680 SourceLocation UsingLoc,
681 SourceLocation NamespcLoc,
682 const CXXScopeSpec &SS,
683 SourceLocation IdentLoc,
684 IdentifierInfo *NamespcName,
685 AttributeList *AttrList) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000686 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000687 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000688 }
689#endif
690
Chris Lattnerb28317a2009-03-28 19:18:32 +0000691 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000692 SourceLocation EqualLoc,
693 ExprArg defarg) {
694 llvm::cout << __FUNCTION__ << "\n";
695 }
696
Chris Lattnerb28317a2009-03-28 19:18:32 +0000697 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000698 SourceLocation EqualLoc) {
699 llvm::cout << __FUNCTION__ << "\n";
700 }
701
Chris Lattnerb28317a2009-03-28 19:18:32 +0000702 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000703 llvm::cout << __FUNCTION__ << "\n";
704 }
705
Chris Lattnerb28317a2009-03-28 19:18:32 +0000706 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000707 SourceLocation LParenLoc,
708 MultiExprArg Exprs,
709 SourceLocation *CommaLocs,
710 SourceLocation RParenLoc) {
711 llvm::cout << __FUNCTION__ << "\n";
712 return;
713 }
714
Chris Lattnerb28317a2009-03-28 19:18:32 +0000715 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
716 DeclPtrTy Method)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000717 {
718 llvm::cout << __FUNCTION__ << "\n";
719 }
720
Chris Lattnerb28317a2009-03-28 19:18:32 +0000721 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000722 llvm::cout << __FUNCTION__ << "\n";
723 }
724
725 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000726 DeclPtrTy Method) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000727 llvm::cout << __FUNCTION__ << "\n";
728 }
729
Chris Lattnerb28317a2009-03-28 19:18:32 +0000730 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
731 ExprArg AssertExpr,
732 ExprArg AssertMessageExpr) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000733 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000734 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000735 }
736
737 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
738 tok::TokenKind Kind,
739 SourceLocation LAngleBracketLoc,
740 TypeTy *Ty,
741 SourceLocation RAngleBracketLoc,
742 SourceLocation LParenLoc,
743 ExprArg Op,
744 SourceLocation RParenLoc) {
745 llvm::cout << __FUNCTION__ << "\n";
746 return ExprEmpty();
747 }
748
749 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
750 SourceLocation LParenLoc,
751 bool isType, void *TyOrExpr,
752 SourceLocation RParenLoc) {
753 llvm::cout << __FUNCTION__ << "\n";
754 return ExprEmpty();
755 }
756
757 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
758 llvm::cout << __FUNCTION__ << "\n";
759 return ExprEmpty();
760 }
761
762 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
763 tok::TokenKind Kind) {
764 llvm::cout << __FUNCTION__ << "\n";
765 return ExprEmpty();
766 }
767
768 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
769 llvm::cout << __FUNCTION__ << "\n";
770 return ExprEmpty();
771 }
772
773 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
774 TypeTy *TypeRep,
775 SourceLocation LParenLoc,
776 MultiExprArg Exprs,
777 SourceLocation *CommaLocs,
778 SourceLocation RParenLoc) {
779 llvm::cout << __FUNCTION__ << "\n";
780 return ExprEmpty();
781 }
782
783 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
784 SourceLocation StartLoc,
785 Declarator &D,
786 SourceLocation EqualLoc,
787 ExprArg AssignExprVal) {
788 llvm::cout << __FUNCTION__ << "\n";
789 return ExprEmpty();
790 }
791
792 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
793 bool UseGlobal,
794 SourceLocation PlacementLParen,
795 MultiExprArg PlacementArgs,
796 SourceLocation PlacementRParen,
797 bool ParenTypeId, Declarator &D,
798 SourceLocation ConstructorLParen,
799 MultiExprArg ConstructorArgs,
800 SourceLocation ConstructorRParen) {
801 llvm::cout << __FUNCTION__ << "\n";
802 return ExprEmpty();
803 }
804
805 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
806 bool UseGlobal, bool ArrayForm,
807 ExprArg Operand) {
808 llvm::cout << __FUNCTION__ << "\n";
809 return ExprEmpty();
810 }
811
812 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
813 SourceLocation KWLoc,
814 SourceLocation LParen,
815 TypeTy *Ty,
816 SourceLocation RParen) {
817 llvm::cout << __FUNCTION__ << "\n";
818 return ExprEmpty();
819 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000820 };
821}
822
Daniel Dunbare10b0f22008-10-31 08:56:51 +0000823MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP) {
824 return new ParserPrintActions(PP);
Reid Spencer5f016e22007-07-11 17:01:13 +0000825}