blob: 9dce6d837b16d2c31e822d154851bdae27a0ad03 [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
15#include "clang.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 Lattnerb28317a2009-03-28 19:18:32 +000032 virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D,
33 DeclPtrTy LastInGroup) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000034 llvm::cout << __FUNCTION__ << " ";
Reid Spencer5f016e22007-07-11 17:01:13 +000035 if (IdentifierInfo *II = D.getIdentifier()) {
Ted Kremenekbdd30c22008-01-14 16:44:48 +000036 llvm::cout << "'" << II->getName() << "'";
Reid Spencer5f016e22007-07-11 17:01:13 +000037 } else {
Ted Kremenekbdd30c22008-01-14 16:44:48 +000038 llvm::cout << "<anon>";
Reid Spencer5f016e22007-07-11 17:01:13 +000039 }
Ted Kremenekbdd30c22008-01-14 16:44:48 +000040 llvm::cout << "\n";
Reid Spencer5f016e22007-07-11 17:01:13 +000041
42 // Pass up to EmptyActions so that the symbol table is maintained right.
Daniel Dunbar914701e2008-08-05 16:28:08 +000043 return MinimalAction::ActOnDeclarator(S, D, LastInGroup);
Reid Spencer5f016e22007-07-11 17:01:13 +000044 }
Steve Naroff640db422007-10-10 17:45:44 +000045 /// ActOnPopScope - This callback is called immediately before the specified
46 /// scope is popped and deleted.
47 virtual void ActOnPopScope(SourceLocation Loc, Scope *S) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000048 llvm::cout << __FUNCTION__ << "\n";
49 return MinimalAction::ActOnPopScope(Loc, S);
50 }
51
52 /// ActOnTranslationUnitScope - This callback is called once, immediately
53 /// after creating the translation unit scope (in Parser::Initialize).
54 virtual void ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
55 llvm::cout << __FUNCTION__ << "\n";
56 MinimalAction::ActOnTranslationUnitScope(Loc, S);
57 }
58
59
Chris Lattnerb28317a2009-03-28 19:18:32 +000060 Action::DeclPtrTy ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
61 IdentifierInfo *ClassName,
62 SourceLocation ClassLoc,
63 IdentifierInfo *SuperName,
64 SourceLocation SuperLoc,
65 const DeclPtrTy *ProtoRefs,
66 unsigned NumProtocols,
67 SourceLocation EndProtoLoc,
68 AttributeList *AttrList) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000069 llvm::cout << __FUNCTION__ << "\n";
70 return MinimalAction::ActOnStartClassInterface(AtInterfaceLoc,
71 ClassName, ClassLoc,
72 SuperName, SuperLoc,
73 ProtoRefs, NumProtocols,
74 EndProtoLoc, AttrList);
75 }
76
77 /// ActOnForwardClassDeclaration -
78 /// Scope will always be top level file scope.
Chris Lattnerb28317a2009-03-28 19:18:32 +000079 Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
80 IdentifierInfo **IdentList,
81 unsigned NumElts) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000082 llvm::cout << __FUNCTION__ << "\n";
83 return MinimalAction::ActOnForwardClassDeclaration(AtClassLoc, IdentList,
84 NumElts);
85 }
86
87 // Pure Printing
88
89 /// ActOnParamDeclarator - This callback is invoked when a parameter
90 /// declarator is parsed. This callback only occurs for functions
91 /// with prototypes. S is the function prototype scope for the
92 /// parameters (C++ [basic.scope.proto]).
Chris Lattnerb28317a2009-03-28 19:18:32 +000093 virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000094 llvm::cout << __FUNCTION__ << " ";
95 if (IdentifierInfo *II = D.getIdentifier()) {
96 llvm::cout << "'" << II->getName() << "'";
97 } else {
98 llvm::cout << "<anon>";
99 }
100 llvm::cout << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000101 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000102 }
103
104 /// AddInitializerToDecl - This action is called immediately after
105 /// ParseDeclarator (when an initializer is present). The code is factored
106 /// this way to make sure we are able to handle the following:
107 /// void func() { int xx = xx; }
108 /// This allows ActOnDeclarator to register "xx" prior to parsing the
109 /// initializer. The declaration above should still result in a warning,
110 /// since the reference to "xx" is uninitialized.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000111 virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000112 llvm::cout << __FUNCTION__ << "\n";
113 }
114
115 /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed, this
116 /// gives the actions implementation a chance to process the group as a whole.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000117 virtual DeclPtrTy FinalizeDeclaratorGroup(Scope *S, DeclPtrTy Group) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000118 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000119 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000120 }
121
122 /// ActOnStartOfFunctionDef - This is called at the start of a function
123 /// definition, instead of calling ActOnDeclarator. The Declarator includes
124 /// information about formal arguments that are part of this function.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000125 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000126 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000127 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000128 }
129
130 /// ActOnStartOfFunctionDef - This is called at the start of a function
131 /// definition, after the FunctionDecl has already been created.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000132 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000133 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000134 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000135 }
136
Chris Lattnerb28317a2009-03-28 19:18:32 +0000137 virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000138 llvm::cout << __FUNCTION__ << "\n";
139 }
140
141 /// ActOnFunctionDefBody - This is called when a function body has completed
142 /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000143 virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000144 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000145 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000146 }
147
Chris Lattnerb28317a2009-03-28 19:18:32 +0000148 virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
149 ExprArg AsmString) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000150 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000151 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000152 }
153
154 /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
155 /// no declarator (e.g. "struct foo;") is parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000156 virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000157 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000158 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000159 }
Douglas Gregore79837a2008-12-17 01:46:43 +0000160
161 /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
162 /// contained braces. Lang/StrSize contains the language string that
163 /// was parsed at location Loc. Decls/NumDecls provides the
164 /// declarations parsed inside the linkage specification.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000165 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
166 SourceLocation LBrace,
167 SourceLocation RBrace, const char *Lang,
168 unsigned StrSize,
169 DeclPtrTy *Decls, unsigned NumDecls) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000170 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000171 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000172 }
Douglas Gregore79837a2008-12-17 01:46:43 +0000173
174 /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
175 /// braces. Lang/StrSize contains the language string that was
176 /// parsed at location Loc. D is the declaration parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000177 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
178 unsigned StrSize, DeclPtrTy D) {
179 return DeclPtrTy();
Douglas Gregore79837a2008-12-17 01:46:43 +0000180 }
181
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000182 //===--------------------------------------------------------------------===//
183 // Type Parsing Callbacks.
184 //===--------------------------------------------------------------------===//
185
Sebastian Redlcee63fb2008-12-02 14:43:59 +0000186 virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000187 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000188 return TypeResult();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000189 }
190
Chris Lattnerb28317a2009-03-28 19:18:32 +0000191 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagType, TagKind TK,
192 SourceLocation KWLoc, const CXXScopeSpec &SS,
193 IdentifierInfo *Name, SourceLocation NameLoc,
194 AttributeList *Attr, AccessSpecifier AS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000195 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
196 // is (struct/union/enum/class).
197 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000198 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000199 }
200
201 /// Act on @defs() element found when parsing a structure. ClassName is the
202 /// name of the referenced class.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000203 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000204 IdentifierInfo *ClassName,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000205 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000206 llvm::cout << __FUNCTION__ << "\n";
207 }
208
Chris Lattnerb28317a2009-03-28 19:18:32 +0000209 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
210 SourceLocation DeclStart,
211 Declarator &D, ExprTy *BitfieldWidth) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000212 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000213 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000214 }
215
Chris Lattnerb28317a2009-03-28 19:18:32 +0000216 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
217 Declarator &D, ExprTy *BitfieldWidth,
218 tok::ObjCKeywordKind visibility) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000219 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000220 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000221 }
222
Chris Lattnerb28317a2009-03-28 19:18:32 +0000223 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
224 DeclPtrTy *Fields, unsigned NumFields,
Daniel Dunbar1bfe1c22008-10-03 02:03:53 +0000225 SourceLocation LBrac, SourceLocation RBrac,
226 AttributeList *AttrList) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000227 llvm::cout << __FUNCTION__ << "\n";
228 }
229
Chris Lattnerb28317a2009-03-28 19:18:32 +0000230 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
231 DeclPtrTy LastEnumConstant,
232 SourceLocation IdLoc,IdentifierInfo *Id,
233 SourceLocation EqualLoc, ExprTy *Val) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000234 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000235 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000236 }
237
Chris Lattnerb28317a2009-03-28 19:18:32 +0000238 virtual void ActOnEnumBody(SourceLocation EnumLoc, DeclPtrTy EnumDecl,
239 DeclPtrTy *Elements, unsigned NumElements) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000240 llvm::cout << __FUNCTION__ << "\n";
241 }
242
243 //===--------------------------------------------------------------------===//
244 // Statement Parsing Callbacks.
245 //===--------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000246
247 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000248 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000249 return StmtEmpty();
250 }
251
252 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
253 SourceLocation R,
254 MultiStmtArg Elts,
255 bool isStmtExpr) {
256 llvm::cout << __FUNCTION__ << "\n";
257 return StmtEmpty();
258 }
Chris Lattnerb28317a2009-03-28 19:18:32 +0000259 virtual OwningStmtResult ActOnDeclStmt(DeclPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000260 SourceLocation StartLoc,
261 SourceLocation EndLoc) {
262 llvm::cout << __FUNCTION__ << "\n";
263 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000264 }
265
Sebastian Redla60528c2008-12-21 12:04:03 +0000266 virtual OwningStmtResult ActOnExprStmt(ExprArg Expr) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000267 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000268 return OwningStmtResult(*this, Expr.release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000269 }
270
271 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
272 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000273 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
274 ExprArg LHSVal,
275 SourceLocation DotDotDotLoc,
276 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000277 SourceLocation ColonLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000278 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000279 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000280 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000281 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
282 SourceLocation ColonLoc,
283 StmtArg SubStmt, Scope *CurScope){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000284 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000285 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000286 }
Sebastian Redlde307472009-01-11 00:38:46 +0000287
288 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
289 IdentifierInfo *II,
290 SourceLocation ColonLoc,
291 StmtArg SubStmt) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000292 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000293 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000294 }
Sebastian Redlde307472009-01-11 00:38:46 +0000295
296 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc, ExprArg CondVal,
297 StmtArg ThenVal,SourceLocation ElseLoc,
298 StmtArg ElseVal) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000299 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000300 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000301 }
Sebastian Redlde307472009-01-11 00:38:46 +0000302
303 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000304 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000305 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000306 }
Sebastian Redlde307472009-01-11 00:38:46 +0000307
308 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
309 StmtArg Switch,
310 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000311 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000312 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000313 }
314
Sebastian Redlf05b1522009-01-16 23:28:06 +0000315 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
316 ExprArg Cond, StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000317 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000318 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000319 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000320 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
321 SourceLocation WhileLoc, ExprArg Cond){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000322 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000323 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000324 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000325 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
326 SourceLocation LParenLoc,
327 StmtArg First, ExprArg Second,
328 ExprArg Third, SourceLocation RParenLoc,
329 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000330 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000331 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000332 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000333 virtual OwningStmtResult ActOnObjCForCollectionStmt(
334 SourceLocation ForColLoc,
335 SourceLocation LParenLoc,
336 StmtArg First, ExprArg Second,
337 SourceLocation RParenLoc, StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000338 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000339 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000340 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000341 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
342 SourceLocation LabelLoc,
343 IdentifierInfo *LabelII) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000344 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000345 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000346 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000347 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
348 SourceLocation StarLoc,
349 ExprArg DestExp) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000350 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000351 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000352 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000353 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
354 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000355 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000356 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000357 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000358 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
359 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000360 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000361 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000362 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000363 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
364 ExprArg RetValExp) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000365 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000366 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000367 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000368 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
369 bool IsSimple,
370 bool IsVolatile,
371 unsigned NumOutputs,
372 unsigned NumInputs,
373 std::string *Names,
374 MultiExprArg Constraints,
375 MultiExprArg Exprs,
376 ExprArg AsmString,
377 MultiExprArg Clobbers,
378 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000379 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000380 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000381 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000382
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000383 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000384 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
385 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000386 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000387 StmtArg CatchList) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000388 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000389 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000390 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000391
392 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
393 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000394 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000395 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000396 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000397
398 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
399 StmtArg Try, StmtArg Catch,
400 StmtArg Finally) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000401 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000402 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000403 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000404
405 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000406 ExprArg Throw,
407 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000408 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000409 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000410 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000411
412 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
413 ExprArg SynchExpr,
414 StmtArg SynchBody) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000415 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000416 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000417 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000418
419 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000420 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Sebastian Redla0fd8652008-12-21 16:41:36 +0000421 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000422 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000423 }
424
425 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000426 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000427 StmtArg HandlerBlock) {
428 llvm::cout << __FUNCTION__ << "\n";
429 return StmtEmpty();
430 }
431
432 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
433 StmtArg TryBlock,
434 MultiStmtArg Handlers) {
435 llvm::cout << __FUNCTION__ << "\n";
436 return StmtEmpty();
437 }
438
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000439 //===--------------------------------------------------------------------===//
440 // Expression Parsing Callbacks.
441 //===--------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000442
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000443 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000444
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000445 /// ActOnIdentifierExpr - Parse an identifier in expression context.
446 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
447 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000448 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
449 IdentifierInfo &II,
450 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000451 const CXXScopeSpec *SS,
452 bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000453 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000454 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000455 }
456
Sebastian Redlcd965b92009-01-18 18:53:16 +0000457 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
458 Scope *S, SourceLocation OperatorLoc,
459 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000460 bool HasTrailingLParen, const CXXScopeSpec &SS,
461 bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000462 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000463 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000464 }
465
Sebastian Redlcd965b92009-01-18 18:53:16 +0000466 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
467 Scope *S, SourceLocation OperatorLoc,
468 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000469 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000470 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000471 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000472 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000473
474 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
475 tok::TokenKind Kind) {
476 llvm::cout << __FUNCTION__ << "\n";
477 return ExprEmpty();
478 }
479
480 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
481 llvm::cout << __FUNCTION__ << "\n";
482 return ExprEmpty();
483 }
484
485 virtual OwningExprResult ActOnNumericConstant(const Token &) {
486 llvm::cout << __FUNCTION__ << "\n";
487 return ExprEmpty();
488 }
489
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000490 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
491 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000492 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
493 unsigned NumToks) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000494 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000495 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000496 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000497
498 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
499 ExprArg Val) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000500 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000501 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000502 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000503
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000504 // Postfix Expressions.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000505 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
506 tok::TokenKind Kind,
507 ExprArg Input) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000508 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000509 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000510 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000511 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
512 SourceLocation LLoc,
513 ExprArg Idx,
514 SourceLocation RLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000515 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000516 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000517 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000518 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
519 SourceLocation OpLoc,
520 tok::TokenKind OpKind,
521 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000522 IdentifierInfo &Member,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000523 DeclPtrTy ImplDecl) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000524 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000525 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000526 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000527
528 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
529 SourceLocation LParenLoc,
530 MultiExprArg Args,
531 SourceLocation *CommaLocs,
532 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000533 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000534 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000535 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000536
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000537 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000538 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
539 tok::TokenKind Op, ExprArg Input) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000540 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000541 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000542 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000543 virtual OwningExprResult
544 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
545 void *TyOrEx, const SourceRange &ArgRange) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000546 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000547 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000548 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000549
550 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
551 TypeTy *Ty,
552 SourceLocation RParen,
553 ExprArg Op) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000554 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000555 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000556 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000557 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
558 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000559 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000560 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000561 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000562 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000563 virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
564 SourceLocation RParenLoc,ExprArg Op){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000565 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000566 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000567 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000568
569 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
570 tok::TokenKind Kind,
571 ExprArg LHS, ExprArg RHS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000572 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000573 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000574 }
575
576 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
577 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000578 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
579 SourceLocation ColonLoc,
580 ExprArg Cond, ExprArg LHS,
581 ExprArg RHS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000582 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000583 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000584 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000585
586 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000587
Sebastian Redlf53597f2009-03-15 17:47:39 +0000588 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
589 SourceLocation LabLoc,
590 IdentifierInfo *LabelII) {// "&&foo"
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000591 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000592 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000593 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000594
595 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
596 StmtArg SubStmt,
597 SourceLocation RPLoc) { // "({..})"
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000598 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000599 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000600 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000601
602 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
603 SourceLocation BuiltinLoc,
604 SourceLocation TypeLoc,
605 TypeTy *Arg1,
606 OffsetOfComponent *CompPtr,
607 unsigned NumComponents,
608 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000609 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000610 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000611 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000612
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000613 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000614 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
615 TypeTy *arg1,TypeTy *arg2,
616 SourceLocation RPLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000617 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000618 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000619 }
620 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000621 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
622 ExprArg cond, ExprArg expr1,
623 ExprArg expr2,
624 SourceLocation RPLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000625 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000626 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000627 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000628
629 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000630 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
631 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000632 SourceLocation RPLoc) {
633 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000634 return ExprEmpty();
635 }
636
637 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
638 llvm::cout << __FUNCTION__ << "\n";
639 return ExprEmpty();
640 }
641
642 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
643 llvm::cout << __FUNCTION__ << "\n";
644 }
645
646 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
647 llvm::cout << __FUNCTION__ << "\n";
648 }
649
650 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
651 llvm::cout << __FUNCTION__ << "\n";
652 }
653
654 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
655 StmtArg Body,
656 Scope *CurScope) {
657 llvm::cout << __FUNCTION__ << "\n";
658 return ExprEmpty();
659 }
660
Chris Lattnerb28317a2009-03-28 19:18:32 +0000661 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
662 IdentifierInfo *Ident,
663 SourceLocation LBrace) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000664 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000665 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000666 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000667
Chris Lattnerb28317a2009-03-28 19:18:32 +0000668 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000669 llvm::cout << __FUNCTION__ << "\n";
670 return;
671 }
672
673#if 0
674 // FIXME: AttrList should be deleted by this function, but the definition
675 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000676 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
677 SourceLocation UsingLoc,
678 SourceLocation NamespcLoc,
679 const CXXScopeSpec &SS,
680 SourceLocation IdentLoc,
681 IdentifierInfo *NamespcName,
682 AttributeList *AttrList) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000683 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000684 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000685 }
686#endif
687
Chris Lattnerb28317a2009-03-28 19:18:32 +0000688 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000689 SourceLocation EqualLoc,
690 ExprArg defarg) {
691 llvm::cout << __FUNCTION__ << "\n";
692 }
693
Chris Lattnerb28317a2009-03-28 19:18:32 +0000694 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000695 SourceLocation EqualLoc) {
696 llvm::cout << __FUNCTION__ << "\n";
697 }
698
Chris Lattnerb28317a2009-03-28 19:18:32 +0000699 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000700 llvm::cout << __FUNCTION__ << "\n";
701 }
702
Chris Lattnerb28317a2009-03-28 19:18:32 +0000703 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000704 SourceLocation LParenLoc,
705 MultiExprArg Exprs,
706 SourceLocation *CommaLocs,
707 SourceLocation RParenLoc) {
708 llvm::cout << __FUNCTION__ << "\n";
709 return;
710 }
711
Chris Lattnerb28317a2009-03-28 19:18:32 +0000712 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
713 DeclPtrTy Method)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000714 {
715 llvm::cout << __FUNCTION__ << "\n";
716 }
717
Chris Lattnerb28317a2009-03-28 19:18:32 +0000718 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000719 llvm::cout << __FUNCTION__ << "\n";
720 }
721
722 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000723 DeclPtrTy Method) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000724 llvm::cout << __FUNCTION__ << "\n";
725 }
726
Chris Lattnerb28317a2009-03-28 19:18:32 +0000727 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
728 ExprArg AssertExpr,
729 ExprArg AssertMessageExpr) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000730 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000731 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000732 }
733
734 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
735 tok::TokenKind Kind,
736 SourceLocation LAngleBracketLoc,
737 TypeTy *Ty,
738 SourceLocation RAngleBracketLoc,
739 SourceLocation LParenLoc,
740 ExprArg Op,
741 SourceLocation RParenLoc) {
742 llvm::cout << __FUNCTION__ << "\n";
743 return ExprEmpty();
744 }
745
746 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
747 SourceLocation LParenLoc,
748 bool isType, void *TyOrExpr,
749 SourceLocation RParenLoc) {
750 llvm::cout << __FUNCTION__ << "\n";
751 return ExprEmpty();
752 }
753
754 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
755 llvm::cout << __FUNCTION__ << "\n";
756 return ExprEmpty();
757 }
758
759 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
760 tok::TokenKind Kind) {
761 llvm::cout << __FUNCTION__ << "\n";
762 return ExprEmpty();
763 }
764
765 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
766 llvm::cout << __FUNCTION__ << "\n";
767 return ExprEmpty();
768 }
769
770 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
771 TypeTy *TypeRep,
772 SourceLocation LParenLoc,
773 MultiExprArg Exprs,
774 SourceLocation *CommaLocs,
775 SourceLocation RParenLoc) {
776 llvm::cout << __FUNCTION__ << "\n";
777 return ExprEmpty();
778 }
779
780 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
781 SourceLocation StartLoc,
782 Declarator &D,
783 SourceLocation EqualLoc,
784 ExprArg AssignExprVal) {
785 llvm::cout << __FUNCTION__ << "\n";
786 return ExprEmpty();
787 }
788
789 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
790 bool UseGlobal,
791 SourceLocation PlacementLParen,
792 MultiExprArg PlacementArgs,
793 SourceLocation PlacementRParen,
794 bool ParenTypeId, Declarator &D,
795 SourceLocation ConstructorLParen,
796 MultiExprArg ConstructorArgs,
797 SourceLocation ConstructorRParen) {
798 llvm::cout << __FUNCTION__ << "\n";
799 return ExprEmpty();
800 }
801
802 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
803 bool UseGlobal, bool ArrayForm,
804 ExprArg Operand) {
805 llvm::cout << __FUNCTION__ << "\n";
806 return ExprEmpty();
807 }
808
809 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
810 SourceLocation KWLoc,
811 SourceLocation LParen,
812 TypeTy *Ty,
813 SourceLocation RParen) {
814 llvm::cout << __FUNCTION__ << "\n";
815 return ExprEmpty();
816 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000817 };
818}
819
Daniel Dunbare10b0f22008-10-31 08:56:51 +0000820MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP) {
821 return new ParserPrintActions(PP);
Reid Spencer5f016e22007-07-11 17:01:13 +0000822}