blob: 4ee48f072ae093612987150186b75bb5cd8e0f48 [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
Anders Carlssona99fad82009-05-17 18:26:53 +0000299 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
300 FullExprArg CondVal, StmtArg ThenVal,
301 SourceLocation ElseLoc,
Sebastian Redlde307472009-01-11 00:38:46 +0000302 StmtArg ElseVal) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000303 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000304 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000305 }
Sebastian Redlde307472009-01-11 00:38:46 +0000306
307 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000308 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000309 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000310 }
Sebastian Redlde307472009-01-11 00:38:46 +0000311
312 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
313 StmtArg Switch,
314 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000315 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000316 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000317 }
318
Sebastian Redlf05b1522009-01-16 23:28:06 +0000319 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
320 ExprArg Cond, StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000321 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000322 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000323 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000324 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
325 SourceLocation WhileLoc, ExprArg Cond){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000326 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000327 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000328 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000329 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
330 SourceLocation LParenLoc,
331 StmtArg First, ExprArg Second,
332 ExprArg Third, SourceLocation RParenLoc,
333 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000334 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000335 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000336 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000337 virtual OwningStmtResult ActOnObjCForCollectionStmt(
338 SourceLocation ForColLoc,
339 SourceLocation LParenLoc,
340 StmtArg First, ExprArg Second,
341 SourceLocation RParenLoc, StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000342 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000343 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000344 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000345 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
346 SourceLocation LabelLoc,
347 IdentifierInfo *LabelII) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000348 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000349 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000350 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000351 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
352 SourceLocation StarLoc,
353 ExprArg DestExp) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000354 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000355 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000356 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000357 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
358 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000359 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000360 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000361 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000362 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
363 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000364 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000365 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000366 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000367 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
368 ExprArg RetValExp) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000369 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000370 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000371 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000372 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000373 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000374 bool IsVolatile,
375 unsigned NumOutputs,
376 unsigned NumInputs,
377 std::string *Names,
378 MultiExprArg Constraints,
379 MultiExprArg Exprs,
380 ExprArg AsmString,
381 MultiExprArg Clobbers,
382 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000383 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000384 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000385 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000386
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000387 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000388 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
389 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000390 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000391 StmtArg CatchList) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000392 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000393 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000394 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000395
396 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
397 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000398 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000399 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000400 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000401
402 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
403 StmtArg Try, StmtArg Catch,
404 StmtArg Finally) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000405 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000406 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000407 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000408
409 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000410 ExprArg Throw,
411 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000412 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000413 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000414 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000415
416 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
417 ExprArg SynchExpr,
418 StmtArg SynchBody) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000419 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000420 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000421 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000422
423 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000424 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Sebastian Redla0fd8652008-12-21 16:41:36 +0000425 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000426 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000427 }
428
429 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000430 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000431 StmtArg HandlerBlock) {
432 llvm::cout << __FUNCTION__ << "\n";
433 return StmtEmpty();
434 }
435
436 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
437 StmtArg TryBlock,
438 MultiStmtArg Handlers) {
439 llvm::cout << __FUNCTION__ << "\n";
440 return StmtEmpty();
441 }
442
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000443 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000444 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000445 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000446
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000447 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000448
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000449 /// ActOnIdentifierExpr - Parse an identifier in expression context.
450 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
451 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000452 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
453 IdentifierInfo &II,
454 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000455 const CXXScopeSpec *SS,
456 bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000457 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000458 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000459 }
460
Sebastian Redlcd965b92009-01-18 18:53:16 +0000461 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
462 Scope *S, SourceLocation OperatorLoc,
463 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000464 bool HasTrailingLParen, const CXXScopeSpec &SS,
465 bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000466 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000467 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000468 }
469
Sebastian Redlcd965b92009-01-18 18:53:16 +0000470 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
471 Scope *S, SourceLocation OperatorLoc,
472 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000473 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000474 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000475 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000476 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000477
478 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
479 tok::TokenKind Kind) {
480 llvm::cout << __FUNCTION__ << "\n";
481 return ExprEmpty();
482 }
483
484 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
485 llvm::cout << __FUNCTION__ << "\n";
486 return ExprEmpty();
487 }
488
489 virtual OwningExprResult ActOnNumericConstant(const Token &) {
490 llvm::cout << __FUNCTION__ << "\n";
491 return ExprEmpty();
492 }
493
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000494 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
495 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000496 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
497 unsigned NumToks) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000498 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000499 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000500 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000501
502 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
503 ExprArg Val) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000504 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000505 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000506 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000507
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000508 // Postfix Expressions.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000509 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
510 tok::TokenKind Kind,
511 ExprArg Input) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000512 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000513 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000514 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000515 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
516 SourceLocation LLoc,
517 ExprArg Idx,
518 SourceLocation RLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000519 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000520 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000521 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000522 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
523 SourceLocation OpLoc,
524 tok::TokenKind OpKind,
525 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000526 IdentifierInfo &Member,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000527 DeclPtrTy ImplDecl) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000528 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000529 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000530 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000531
532 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
533 SourceLocation LParenLoc,
534 MultiExprArg Args,
535 SourceLocation *CommaLocs,
536 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000537 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000538 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000539 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000540
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000541 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000542 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
543 tok::TokenKind Op, ExprArg Input) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000544 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000545 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000546 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000547 virtual OwningExprResult
548 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
549 void *TyOrEx, const SourceRange &ArgRange) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000550 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000551 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000552 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000553
554 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
555 TypeTy *Ty,
556 SourceLocation RParen,
557 ExprArg Op) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000558 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000559 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000560 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000561 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
562 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000563 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000564 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000565 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000566 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000567 virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
568 SourceLocation RParenLoc,ExprArg Op){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000569 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000570 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000571 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000572
573 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
574 tok::TokenKind Kind,
575 ExprArg LHS, ExprArg RHS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000576 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000577 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000578 }
579
580 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
581 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000582 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
583 SourceLocation ColonLoc,
584 ExprArg Cond, ExprArg LHS,
585 ExprArg RHS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000586 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000587 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000588 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000589
590 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000591
Sebastian Redlf53597f2009-03-15 17:47:39 +0000592 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
593 SourceLocation LabLoc,
594 IdentifierInfo *LabelII) {// "&&foo"
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000595 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000596 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000597 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000598
599 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
600 StmtArg SubStmt,
601 SourceLocation RPLoc) { // "({..})"
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000602 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000603 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000604 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000605
606 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
607 SourceLocation BuiltinLoc,
608 SourceLocation TypeLoc,
609 TypeTy *Arg1,
610 OffsetOfComponent *CompPtr,
611 unsigned NumComponents,
612 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000613 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000614 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000615 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000616
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000617 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000618 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
619 TypeTy *arg1,TypeTy *arg2,
620 SourceLocation RPLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000621 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000622 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000623 }
624 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000625 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
626 ExprArg cond, ExprArg expr1,
627 ExprArg expr2,
628 SourceLocation RPLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000629 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000630 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000631 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000632
633 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000634 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
635 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000636 SourceLocation RPLoc) {
637 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000638 return ExprEmpty();
639 }
640
641 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
642 llvm::cout << __FUNCTION__ << "\n";
643 return ExprEmpty();
644 }
645
646 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
647 llvm::cout << __FUNCTION__ << "\n";
648 }
649
650 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
651 llvm::cout << __FUNCTION__ << "\n";
652 }
653
654 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
655 llvm::cout << __FUNCTION__ << "\n";
656 }
657
658 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
659 StmtArg Body,
660 Scope *CurScope) {
661 llvm::cout << __FUNCTION__ << "\n";
662 return ExprEmpty();
663 }
664
Chris Lattnerb28317a2009-03-28 19:18:32 +0000665 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
666 IdentifierInfo *Ident,
667 SourceLocation LBrace) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000668 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000669 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000670 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000671
Chris Lattnerb28317a2009-03-28 19:18:32 +0000672 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000673 llvm::cout << __FUNCTION__ << "\n";
674 return;
675 }
676
677#if 0
678 // FIXME: AttrList should be deleted by this function, but the definition
679 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000680 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
681 SourceLocation UsingLoc,
682 SourceLocation NamespcLoc,
683 const CXXScopeSpec &SS,
684 SourceLocation IdentLoc,
685 IdentifierInfo *NamespcName,
686 AttributeList *AttrList) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000687 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000688 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000689 }
690#endif
691
Chris Lattnerb28317a2009-03-28 19:18:32 +0000692 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000693 SourceLocation EqualLoc,
694 ExprArg defarg) {
695 llvm::cout << __FUNCTION__ << "\n";
696 }
697
Chris Lattnerb28317a2009-03-28 19:18:32 +0000698 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000699 SourceLocation EqualLoc) {
700 llvm::cout << __FUNCTION__ << "\n";
701 }
702
Chris Lattnerb28317a2009-03-28 19:18:32 +0000703 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000704 llvm::cout << __FUNCTION__ << "\n";
705 }
706
Chris Lattnerb28317a2009-03-28 19:18:32 +0000707 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000708 SourceLocation LParenLoc,
709 MultiExprArg Exprs,
710 SourceLocation *CommaLocs,
711 SourceLocation RParenLoc) {
712 llvm::cout << __FUNCTION__ << "\n";
713 return;
714 }
715
Chris Lattnerb28317a2009-03-28 19:18:32 +0000716 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
717 DeclPtrTy Method)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000718 {
719 llvm::cout << __FUNCTION__ << "\n";
720 }
721
Chris Lattnerb28317a2009-03-28 19:18:32 +0000722 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000723 llvm::cout << __FUNCTION__ << "\n";
724 }
725
726 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000727 DeclPtrTy Method) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000728 llvm::cout << __FUNCTION__ << "\n";
729 }
730
Chris Lattnerb28317a2009-03-28 19:18:32 +0000731 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
732 ExprArg AssertExpr,
733 ExprArg AssertMessageExpr) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000734 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000735 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000736 }
737
738 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
739 tok::TokenKind Kind,
740 SourceLocation LAngleBracketLoc,
741 TypeTy *Ty,
742 SourceLocation RAngleBracketLoc,
743 SourceLocation LParenLoc,
744 ExprArg Op,
745 SourceLocation RParenLoc) {
746 llvm::cout << __FUNCTION__ << "\n";
747 return ExprEmpty();
748 }
749
750 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
751 SourceLocation LParenLoc,
752 bool isType, void *TyOrExpr,
753 SourceLocation RParenLoc) {
754 llvm::cout << __FUNCTION__ << "\n";
755 return ExprEmpty();
756 }
757
758 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
759 llvm::cout << __FUNCTION__ << "\n";
760 return ExprEmpty();
761 }
762
763 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
764 tok::TokenKind Kind) {
765 llvm::cout << __FUNCTION__ << "\n";
766 return ExprEmpty();
767 }
768
769 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
770 llvm::cout << __FUNCTION__ << "\n";
771 return ExprEmpty();
772 }
773
774 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
775 TypeTy *TypeRep,
776 SourceLocation LParenLoc,
777 MultiExprArg Exprs,
778 SourceLocation *CommaLocs,
779 SourceLocation RParenLoc) {
780 llvm::cout << __FUNCTION__ << "\n";
781 return ExprEmpty();
782 }
783
784 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
785 SourceLocation StartLoc,
786 Declarator &D,
787 SourceLocation EqualLoc,
788 ExprArg AssignExprVal) {
789 llvm::cout << __FUNCTION__ << "\n";
790 return ExprEmpty();
791 }
792
793 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
794 bool UseGlobal,
795 SourceLocation PlacementLParen,
796 MultiExprArg PlacementArgs,
797 SourceLocation PlacementRParen,
798 bool ParenTypeId, Declarator &D,
799 SourceLocation ConstructorLParen,
800 MultiExprArg ConstructorArgs,
801 SourceLocation ConstructorRParen) {
802 llvm::cout << __FUNCTION__ << "\n";
803 return ExprEmpty();
804 }
805
806 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
807 bool UseGlobal, bool ArrayForm,
808 ExprArg Operand) {
809 llvm::cout << __FUNCTION__ << "\n";
810 return ExprEmpty();
811 }
812
813 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
814 SourceLocation KWLoc,
815 SourceLocation LParen,
816 TypeTy *Ty,
817 SourceLocation RParen) {
818 llvm::cout << __FUNCTION__ << "\n";
819 return ExprEmpty();
820 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000821 };
822}
823
Daniel Dunbare10b0f22008-10-31 08:56:51 +0000824MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP) {
825 return new ParserPrintActions(PP);
Reid Spencer5f016e22007-07-11 17:01:13 +0000826}