blob: 55d0d7f4f96b23df95dd7803d290837d44369fa9 [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
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000184 //===--------------------------------------------------------------------===//
185 // Type Parsing Callbacks.
186 //===--------------------------------------------------------------------===//
187
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
Chris Lattnerb28317a2009-03-28 19:18:32 +0000240 virtual void ActOnEnumBody(SourceLocation EnumLoc, DeclPtrTy EnumDecl,
241 DeclPtrTy *Elements, unsigned NumElements) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000242 llvm::cout << __FUNCTION__ << "\n";
243 }
244
245 //===--------------------------------------------------------------------===//
246 // Statement Parsing Callbacks.
247 //===--------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000248
249 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000250 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000251 return StmtEmpty();
252 }
253
254 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
255 SourceLocation R,
256 MultiStmtArg Elts,
257 bool isStmtExpr) {
258 llvm::cout << __FUNCTION__ << "\n";
259 return StmtEmpty();
260 }
Chris Lattner682bf922009-03-29 16:50:03 +0000261 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000262 SourceLocation StartLoc,
263 SourceLocation EndLoc) {
264 llvm::cout << __FUNCTION__ << "\n";
265 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000266 }
267
Sebastian Redla60528c2008-12-21 12:04:03 +0000268 virtual OwningStmtResult ActOnExprStmt(ExprArg Expr) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000269 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000270 return OwningStmtResult(*this, Expr.release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000271 }
272
273 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
274 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000275 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
276 ExprArg LHSVal,
277 SourceLocation DotDotDotLoc,
278 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000279 SourceLocation ColonLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000280 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000281 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000282 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000283 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
284 SourceLocation ColonLoc,
285 StmtArg SubStmt, Scope *CurScope){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000286 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000287 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000288 }
Sebastian Redlde307472009-01-11 00:38:46 +0000289
290 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
291 IdentifierInfo *II,
292 SourceLocation ColonLoc,
293 StmtArg SubStmt) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000294 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000295 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000296 }
Sebastian Redlde307472009-01-11 00:38:46 +0000297
298 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc, ExprArg CondVal,
299 StmtArg ThenVal,SourceLocation ElseLoc,
300 StmtArg ElseVal) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000301 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000302 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000303 }
Sebastian Redlde307472009-01-11 00:38:46 +0000304
305 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000306 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000307 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000308 }
Sebastian Redlde307472009-01-11 00:38:46 +0000309
310 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
311 StmtArg Switch,
312 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000313 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000314 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000315 }
316
Sebastian Redlf05b1522009-01-16 23:28:06 +0000317 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
318 ExprArg Cond, StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000319 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000320 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000321 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000322 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
323 SourceLocation WhileLoc, ExprArg Cond){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000324 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000325 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000326 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000327 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
328 SourceLocation LParenLoc,
329 StmtArg First, ExprArg Second,
330 ExprArg Third, SourceLocation RParenLoc,
331 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000332 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000333 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000334 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000335 virtual OwningStmtResult ActOnObjCForCollectionStmt(
336 SourceLocation ForColLoc,
337 SourceLocation LParenLoc,
338 StmtArg First, ExprArg Second,
339 SourceLocation RParenLoc, StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000340 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000341 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000342 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000343 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
344 SourceLocation LabelLoc,
345 IdentifierInfo *LabelII) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000346 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000347 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000348 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000349 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
350 SourceLocation StarLoc,
351 ExprArg DestExp) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000352 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000353 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000354 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000355 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
356 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000357 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000358 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000359 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000360 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
361 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000362 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000363 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000364 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000365 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
366 ExprArg RetValExp) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000367 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000368 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000369 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000370 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
371 bool IsSimple,
372 bool IsVolatile,
373 unsigned NumOutputs,
374 unsigned NumInputs,
375 std::string *Names,
376 MultiExprArg Constraints,
377 MultiExprArg Exprs,
378 ExprArg AsmString,
379 MultiExprArg Clobbers,
380 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000381 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000382 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000383 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000384
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000385 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000386 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
387 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000388 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000389 StmtArg CatchList) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000390 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000391 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000392 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000393
394 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
395 StmtArg Body) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000396 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000397 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000398 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000399
400 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
401 StmtArg Try, StmtArg Catch,
402 StmtArg Finally) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000403 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000404 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000405 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000406
407 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000408 ExprArg Throw,
409 Scope *CurScope) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000410 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000411 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000412 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000413
414 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
415 ExprArg SynchExpr,
416 StmtArg SynchBody) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000417 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000418 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000419 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000420
421 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000422 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Sebastian Redla0fd8652008-12-21 16:41:36 +0000423 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000424 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000425 }
426
427 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000428 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000429 StmtArg HandlerBlock) {
430 llvm::cout << __FUNCTION__ << "\n";
431 return StmtEmpty();
432 }
433
434 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
435 StmtArg TryBlock,
436 MultiStmtArg Handlers) {
437 llvm::cout << __FUNCTION__ << "\n";
438 return StmtEmpty();
439 }
440
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000441 //===--------------------------------------------------------------------===//
442 // Expression Parsing Callbacks.
443 //===--------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000444
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000445 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000446
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000447 /// ActOnIdentifierExpr - Parse an identifier in expression context.
448 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
449 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000450 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
451 IdentifierInfo &II,
452 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000453 const CXXScopeSpec *SS,
454 bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000455 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000456 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000457 }
458
Sebastian Redlcd965b92009-01-18 18:53:16 +0000459 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
460 Scope *S, SourceLocation OperatorLoc,
461 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000462 bool HasTrailingLParen, const CXXScopeSpec &SS,
463 bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000464 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000465 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000466 }
467
Sebastian Redlcd965b92009-01-18 18:53:16 +0000468 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
469 Scope *S, SourceLocation OperatorLoc,
470 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000471 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000472 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000473 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000474 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000475
476 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
477 tok::TokenKind Kind) {
478 llvm::cout << __FUNCTION__ << "\n";
479 return ExprEmpty();
480 }
481
482 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
483 llvm::cout << __FUNCTION__ << "\n";
484 return ExprEmpty();
485 }
486
487 virtual OwningExprResult ActOnNumericConstant(const Token &) {
488 llvm::cout << __FUNCTION__ << "\n";
489 return ExprEmpty();
490 }
491
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000492 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
493 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000494 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
495 unsigned NumToks) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000496 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000497 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000498 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000499
500 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
501 ExprArg Val) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000502 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000503 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000504 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000505
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000506 // Postfix Expressions.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000507 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
508 tok::TokenKind Kind,
509 ExprArg Input) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000510 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000511 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000512 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000513 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
514 SourceLocation LLoc,
515 ExprArg Idx,
516 SourceLocation RLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000517 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000518 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000519 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000520 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
521 SourceLocation OpLoc,
522 tok::TokenKind OpKind,
523 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000524 IdentifierInfo &Member,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000525 DeclPtrTy ImplDecl) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000526 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000527 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000528 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000529
530 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
531 SourceLocation LParenLoc,
532 MultiExprArg Args,
533 SourceLocation *CommaLocs,
534 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000535 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000536 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000537 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000538
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000539 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000540 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
541 tok::TokenKind Op, ExprArg Input) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000542 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000543 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000544 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000545 virtual OwningExprResult
546 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
547 void *TyOrEx, const SourceRange &ArgRange) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000548 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000549 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000550 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000551
552 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
553 TypeTy *Ty,
554 SourceLocation RParen,
555 ExprArg Op) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000556 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000557 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000558 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000559 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
560 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000561 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000562 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000563 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000564 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000565 virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
566 SourceLocation RParenLoc,ExprArg Op){
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000567 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000568 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000569 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000570
571 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
572 tok::TokenKind Kind,
573 ExprArg LHS, ExprArg RHS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000574 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000575 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000576 }
577
578 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
579 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000580 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
581 SourceLocation ColonLoc,
582 ExprArg Cond, ExprArg LHS,
583 ExprArg RHS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000584 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000585 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000586 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000587
588 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000589
Sebastian Redlf53597f2009-03-15 17:47:39 +0000590 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
591 SourceLocation LabLoc,
592 IdentifierInfo *LabelII) {// "&&foo"
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000593 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000594 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000595 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000596
597 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
598 StmtArg SubStmt,
599 SourceLocation RPLoc) { // "({..})"
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000600 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000601 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000602 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000603
604 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
605 SourceLocation BuiltinLoc,
606 SourceLocation TypeLoc,
607 TypeTy *Arg1,
608 OffsetOfComponent *CompPtr,
609 unsigned NumComponents,
610 SourceLocation RParenLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000611 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000612 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000613 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000614
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000615 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000616 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
617 TypeTy *arg1,TypeTy *arg2,
618 SourceLocation RPLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000619 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000620 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000621 }
622 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000623 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
624 ExprArg cond, ExprArg expr1,
625 ExprArg expr2,
626 SourceLocation RPLoc) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000627 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000628 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000629 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000630
631 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000632 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
633 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000634 SourceLocation RPLoc) {
635 llvm::cout << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000636 return ExprEmpty();
637 }
638
639 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
640 llvm::cout << __FUNCTION__ << "\n";
641 return ExprEmpty();
642 }
643
644 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
645 llvm::cout << __FUNCTION__ << "\n";
646 }
647
648 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
649 llvm::cout << __FUNCTION__ << "\n";
650 }
651
652 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
653 llvm::cout << __FUNCTION__ << "\n";
654 }
655
656 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
657 StmtArg Body,
658 Scope *CurScope) {
659 llvm::cout << __FUNCTION__ << "\n";
660 return ExprEmpty();
661 }
662
Chris Lattnerb28317a2009-03-28 19:18:32 +0000663 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
664 IdentifierInfo *Ident,
665 SourceLocation LBrace) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000666 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000667 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000668 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000669
Chris Lattnerb28317a2009-03-28 19:18:32 +0000670 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000671 llvm::cout << __FUNCTION__ << "\n";
672 return;
673 }
674
675#if 0
676 // FIXME: AttrList should be deleted by this function, but the definition
677 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000678 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
679 SourceLocation UsingLoc,
680 SourceLocation NamespcLoc,
681 const CXXScopeSpec &SS,
682 SourceLocation IdentLoc,
683 IdentifierInfo *NamespcName,
684 AttributeList *AttrList) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000685 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000686 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000687 }
688#endif
689
Chris Lattnerb28317a2009-03-28 19:18:32 +0000690 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000691 SourceLocation EqualLoc,
692 ExprArg defarg) {
693 llvm::cout << __FUNCTION__ << "\n";
694 }
695
Chris Lattnerb28317a2009-03-28 19:18:32 +0000696 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000697 SourceLocation EqualLoc) {
698 llvm::cout << __FUNCTION__ << "\n";
699 }
700
Chris Lattnerb28317a2009-03-28 19:18:32 +0000701 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000702 llvm::cout << __FUNCTION__ << "\n";
703 }
704
Chris Lattnerb28317a2009-03-28 19:18:32 +0000705 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000706 SourceLocation LParenLoc,
707 MultiExprArg Exprs,
708 SourceLocation *CommaLocs,
709 SourceLocation RParenLoc) {
710 llvm::cout << __FUNCTION__ << "\n";
711 return;
712 }
713
Chris Lattnerb28317a2009-03-28 19:18:32 +0000714 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
715 DeclPtrTy Method)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000716 {
717 llvm::cout << __FUNCTION__ << "\n";
718 }
719
Chris Lattnerb28317a2009-03-28 19:18:32 +0000720 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000721 llvm::cout << __FUNCTION__ << "\n";
722 }
723
724 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000725 DeclPtrTy Method) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000726 llvm::cout << __FUNCTION__ << "\n";
727 }
728
Chris Lattnerb28317a2009-03-28 19:18:32 +0000729 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
730 ExprArg AssertExpr,
731 ExprArg AssertMessageExpr) {
Sebastian Redlf53597f2009-03-15 17:47:39 +0000732 llvm::cout << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000733 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000734 }
735
736 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
737 tok::TokenKind Kind,
738 SourceLocation LAngleBracketLoc,
739 TypeTy *Ty,
740 SourceLocation RAngleBracketLoc,
741 SourceLocation LParenLoc,
742 ExprArg Op,
743 SourceLocation RParenLoc) {
744 llvm::cout << __FUNCTION__ << "\n";
745 return ExprEmpty();
746 }
747
748 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
749 SourceLocation LParenLoc,
750 bool isType, void *TyOrExpr,
751 SourceLocation RParenLoc) {
752 llvm::cout << __FUNCTION__ << "\n";
753 return ExprEmpty();
754 }
755
756 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
757 llvm::cout << __FUNCTION__ << "\n";
758 return ExprEmpty();
759 }
760
761 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
762 tok::TokenKind Kind) {
763 llvm::cout << __FUNCTION__ << "\n";
764 return ExprEmpty();
765 }
766
767 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
768 llvm::cout << __FUNCTION__ << "\n";
769 return ExprEmpty();
770 }
771
772 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
773 TypeTy *TypeRep,
774 SourceLocation LParenLoc,
775 MultiExprArg Exprs,
776 SourceLocation *CommaLocs,
777 SourceLocation RParenLoc) {
778 llvm::cout << __FUNCTION__ << "\n";
779 return ExprEmpty();
780 }
781
782 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
783 SourceLocation StartLoc,
784 Declarator &D,
785 SourceLocation EqualLoc,
786 ExprArg AssignExprVal) {
787 llvm::cout << __FUNCTION__ << "\n";
788 return ExprEmpty();
789 }
790
791 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
792 bool UseGlobal,
793 SourceLocation PlacementLParen,
794 MultiExprArg PlacementArgs,
795 SourceLocation PlacementRParen,
796 bool ParenTypeId, Declarator &D,
797 SourceLocation ConstructorLParen,
798 MultiExprArg ConstructorArgs,
799 SourceLocation ConstructorRParen) {
800 llvm::cout << __FUNCTION__ << "\n";
801 return ExprEmpty();
802 }
803
804 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
805 bool UseGlobal, bool ArrayForm,
806 ExprArg Operand) {
807 llvm::cout << __FUNCTION__ << "\n";
808 return ExprEmpty();
809 }
810
811 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
812 SourceLocation KWLoc,
813 SourceLocation LParen,
814 TypeTy *Ty,
815 SourceLocation RParen) {
816 llvm::cout << __FUNCTION__ << "\n";
817 return ExprEmpty();
818 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000819 };
820}
821
Daniel Dunbare10b0f22008-10-31 08:56:51 +0000822MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP) {
823 return new ParserPrintActions(PP);
Reid Spencer5f016e22007-07-11 17:01:13 +0000824}