blob: e5b7d0455cf9c90f6dfd9a747185033d7e68cddb [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"
Eli Friedmanf54fce82009-05-19 01:02:07 +000018#include "llvm/Support/raw_ostream.h"
Reid Spencer5f016e22007-07-11 17:01:13 +000019using namespace clang;
20
21namespace {
22 class ParserPrintActions : public MinimalAction {
Eli Friedmanf54fce82009-05-19 01:02:07 +000023 llvm::raw_ostream& Out;
24
Steve Naroffb4292f22007-10-31 20:55:39 +000025 public:
Eli Friedmanf54fce82009-05-19 01:02:07 +000026 ParserPrintActions(Preprocessor &PP, llvm::raw_ostream& OS)
27 : MinimalAction(PP), Out(OS) {}
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000028
29 // Printing Functions which also must call MinimalAction
30
Steve Naroff08d92e42007-09-15 18:49:24 +000031 /// ActOnDeclarator - This callback is invoked when a declarator is parsed
Reid Spencer5f016e22007-07-11 17:01:13 +000032 /// and 'Init' specifies the initializer if any. This is for things like:
33 /// "int X = 4" or "typedef int foo".
Chris Lattner682bf922009-03-29 16:50:03 +000034 virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000035 Out << __FUNCTION__ << " ";
Reid Spencer5f016e22007-07-11 17:01:13 +000036 if (IdentifierInfo *II = D.getIdentifier()) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000037 Out << "'" << II->getName() << "'";
Reid Spencer5f016e22007-07-11 17:01:13 +000038 } else {
Eli Friedmanf54fce82009-05-19 01:02:07 +000039 Out << "<anon>";
Reid Spencer5f016e22007-07-11 17:01:13 +000040 }
Eli Friedmanf54fce82009-05-19 01:02:07 +000041 Out << "\n";
Reid Spencer5f016e22007-07-11 17:01:13 +000042
43 // Pass up to EmptyActions so that the symbol table is maintained right.
Chris Lattner682bf922009-03-29 16:50:03 +000044 return MinimalAction::ActOnDeclarator(S, D);
Reid Spencer5f016e22007-07-11 17:01:13 +000045 }
Steve Naroff640db422007-10-10 17:45:44 +000046 /// ActOnPopScope - This callback is called immediately before the specified
47 /// scope is popped and deleted.
48 virtual void ActOnPopScope(SourceLocation Loc, Scope *S) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000049 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000050 return MinimalAction::ActOnPopScope(Loc, S);
51 }
52
53 /// ActOnTranslationUnitScope - This callback is called once, immediately
54 /// after creating the translation unit scope (in Parser::Initialize).
55 virtual void ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000056 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000057 MinimalAction::ActOnTranslationUnitScope(Loc, S);
58 }
59
60
Chris Lattnerb28317a2009-03-28 19:18:32 +000061 Action::DeclPtrTy ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
62 IdentifierInfo *ClassName,
63 SourceLocation ClassLoc,
64 IdentifierInfo *SuperName,
65 SourceLocation SuperLoc,
66 const DeclPtrTy *ProtoRefs,
67 unsigned NumProtocols,
68 SourceLocation EndProtoLoc,
69 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000070 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000071 return MinimalAction::ActOnStartClassInterface(AtInterfaceLoc,
72 ClassName, ClassLoc,
73 SuperName, SuperLoc,
74 ProtoRefs, NumProtocols,
75 EndProtoLoc, AttrList);
76 }
77
78 /// ActOnForwardClassDeclaration -
79 /// Scope will always be top level file scope.
Chris Lattnerb28317a2009-03-28 19:18:32 +000080 Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
81 IdentifierInfo **IdentList,
82 unsigned NumElts) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000083 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000084 return MinimalAction::ActOnForwardClassDeclaration(AtClassLoc, IdentList,
85 NumElts);
86 }
87
88 // Pure Printing
89
90 /// ActOnParamDeclarator - This callback is invoked when a parameter
91 /// declarator is parsed. This callback only occurs for functions
92 /// with prototypes. S is the function prototype scope for the
93 /// parameters (C++ [basic.scope.proto]).
Chris Lattnerb28317a2009-03-28 19:18:32 +000094 virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000095 Out << __FUNCTION__ << " ";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000096 if (IdentifierInfo *II = D.getIdentifier()) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000097 Out << "'" << II->getName() << "'";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000098 } else {
Eli Friedmanf54fce82009-05-19 01:02:07 +000099 Out << "<anon>";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000100 }
Eli Friedmanf54fce82009-05-19 01:02:07 +0000101 Out << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000102 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000103 }
104
105 /// AddInitializerToDecl - This action is called immediately after
106 /// ParseDeclarator (when an initializer is present). The code is factored
107 /// this way to make sure we are able to handle the following:
108 /// void func() { int xx = xx; }
109 /// This allows ActOnDeclarator to register "xx" prior to parsing the
110 /// initializer. The declaration above should still result in a warning,
111 /// since the reference to "xx" is uninitialized.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000112 virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000113 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000114 }
115
Chris Lattner682bf922009-03-29 16:50:03 +0000116 /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed,
117 /// this gives the actions implementation a chance to process the group as
118 /// a whole.
119 virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, DeclPtrTy *Group,
120 unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000121 Out << __FUNCTION__ << "\n";
Chris Lattner682bf922009-03-29 16:50:03 +0000122 return DeclGroupPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000123 }
124
125 /// ActOnStartOfFunctionDef - This is called at the start of a function
126 /// definition, instead of calling ActOnDeclarator. The Declarator includes
127 /// information about formal arguments that are part of this function.
Chris Lattner682bf922009-03-29 16:50:03 +0000128 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope,
129 Declarator &D){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000130 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000131 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000132 }
133
134 /// ActOnStartOfFunctionDef - This is called at the start of a function
135 /// definition, after the FunctionDecl has already been created.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000136 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000137 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000138 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000139 }
140
Chris Lattnerb28317a2009-03-28 19:18:32 +0000141 virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000142 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000143 }
144
145 /// ActOnFunctionDefBody - This is called when a function body has completed
146 /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000147 virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000148 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000149 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000150 }
151
Chris Lattnerb28317a2009-03-28 19:18:32 +0000152 virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
153 ExprArg AsmString) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000154 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000155 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000156 }
157
158 /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
159 /// no declarator (e.g. "struct foo;") is parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000160 virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000161 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000162 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000163 }
Douglas Gregore79837a2008-12-17 01:46:43 +0000164
165 /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
166 /// contained braces. Lang/StrSize contains the language string that
167 /// was parsed at location Loc. Decls/NumDecls provides the
168 /// declarations parsed inside the linkage specification.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000169 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
170 SourceLocation LBrace,
171 SourceLocation RBrace, const char *Lang,
172 unsigned StrSize,
173 DeclPtrTy *Decls, unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000174 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000175 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000176 }
Douglas Gregore79837a2008-12-17 01:46:43 +0000177
178 /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
179 /// braces. Lang/StrSize contains the language string that was
180 /// parsed at location Loc. D is the declaration parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000181 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
182 unsigned StrSize, DeclPtrTy D) {
183 return DeclPtrTy();
Douglas Gregore79837a2008-12-17 01:46:43 +0000184 }
185
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000186 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000187 // Type Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000188 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000189
Sebastian Redlcee63fb2008-12-02 14:43:59 +0000190 virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000191 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000192 return TypeResult();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000193 }
194
Chris Lattnerb28317a2009-03-28 19:18:32 +0000195 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagType, TagKind TK,
196 SourceLocation KWLoc, const CXXScopeSpec &SS,
197 IdentifierInfo *Name, SourceLocation NameLoc,
198 AttributeList *Attr, AccessSpecifier AS) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000199 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
200 // is (struct/union/enum/class).
Eli Friedmanf54fce82009-05-19 01:02:07 +0000201 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000202 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000203 }
204
205 /// Act on @defs() element found when parsing a structure. ClassName is the
206 /// name of the referenced class.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000207 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000208 IdentifierInfo *ClassName,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000209 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000210 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000211 }
212
Chris Lattnerb28317a2009-03-28 19:18:32 +0000213 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
214 SourceLocation DeclStart,
215 Declarator &D, ExprTy *BitfieldWidth) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000216 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000217 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000218 }
219
Chris Lattnerb28317a2009-03-28 19:18:32 +0000220 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
221 Declarator &D, ExprTy *BitfieldWidth,
222 tok::ObjCKeywordKind visibility) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000223 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000224 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000225 }
226
Chris Lattnerb28317a2009-03-28 19:18:32 +0000227 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
228 DeclPtrTy *Fields, unsigned NumFields,
Daniel Dunbar1bfe1c22008-10-03 02:03:53 +0000229 SourceLocation LBrac, SourceLocation RBrac,
230 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000231 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000232 }
233
Chris Lattnerb28317a2009-03-28 19:18:32 +0000234 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
235 DeclPtrTy LastEnumConstant,
236 SourceLocation IdLoc,IdentifierInfo *Id,
237 SourceLocation EqualLoc, ExprTy *Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000238 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000239 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000240 }
241
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000242 virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
243 SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000244 DeclPtrTy *Elements, unsigned NumElements) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000245 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000246 }
247
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000248 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000249 // Statement Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000250 //===------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000251
252 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000253 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000254 return StmtEmpty();
255 }
256
257 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
258 SourceLocation R,
259 MultiStmtArg Elts,
260 bool isStmtExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000261 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000262 return StmtEmpty();
263 }
Chris Lattner682bf922009-03-29 16:50:03 +0000264 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000265 SourceLocation StartLoc,
266 SourceLocation EndLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000267 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000268 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000269 }
270
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000271 virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000272 Out << __FUNCTION__ << "\n";
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000273 return OwningStmtResult(*this, Expr->release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000274 }
275
276 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
277 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000278 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
279 ExprArg LHSVal,
280 SourceLocation DotDotDotLoc,
281 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000282 SourceLocation ColonLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000283 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000284 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000285 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000286 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
287 SourceLocation ColonLoc,
288 StmtArg SubStmt, Scope *CurScope){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000289 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000290 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000291 }
Sebastian Redlde307472009-01-11 00:38:46 +0000292
293 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
294 IdentifierInfo *II,
295 SourceLocation ColonLoc,
296 StmtArg SubStmt) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000297 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000298 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000299 }
Sebastian Redlde307472009-01-11 00:38:46 +0000300
Anders Carlssona99fad82009-05-17 18:26:53 +0000301 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
302 FullExprArg CondVal, StmtArg ThenVal,
303 SourceLocation ElseLoc,
Sebastian Redlde307472009-01-11 00:38:46 +0000304 StmtArg ElseVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000305 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000306 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000307 }
Sebastian Redlde307472009-01-11 00:38:46 +0000308
309 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000310 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000311 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000312 }
Sebastian Redlde307472009-01-11 00:38:46 +0000313
314 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
315 StmtArg Switch,
316 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000317 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000318 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000319 }
320
Sebastian Redlf05b1522009-01-16 23:28:06 +0000321 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Anders Carlsson7f537c12009-05-17 21:22:26 +0000322 FullExprArg Cond, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000323 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000324 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000325 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000326 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
327 SourceLocation WhileLoc, ExprArg Cond){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000328 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000329 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000330 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000331 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
332 SourceLocation LParenLoc,
333 StmtArg First, ExprArg Second,
334 ExprArg Third, SourceLocation RParenLoc,
335 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000336 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000337 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000338 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000339 virtual OwningStmtResult ActOnObjCForCollectionStmt(
340 SourceLocation ForColLoc,
341 SourceLocation LParenLoc,
342 StmtArg First, ExprArg Second,
343 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000344 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000345 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000346 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000347 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
348 SourceLocation LabelLoc,
349 IdentifierInfo *LabelII) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000350 Out << __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 ActOnIndirectGotoStmt(SourceLocation GotoLoc,
354 SourceLocation StarLoc,
355 ExprArg DestExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000356 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000357 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000358 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000359 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
360 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000361 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000362 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000363 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000364 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
365 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000366 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000367 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000368 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000369 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
370 ExprArg RetValExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000371 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000372 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000373 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000374 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000375 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000376 bool IsVolatile,
377 unsigned NumOutputs,
378 unsigned NumInputs,
379 std::string *Names,
380 MultiExprArg Constraints,
381 MultiExprArg Exprs,
382 ExprArg AsmString,
383 MultiExprArg Clobbers,
384 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000385 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000386 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000387 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000388
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000389 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000390 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
391 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000392 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000393 StmtArg CatchList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000394 Out << __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 ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
399 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000400 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000401 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000402 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000403
404 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
405 StmtArg Try, StmtArg Catch,
406 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000407 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000408 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000409 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000410
411 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000412 ExprArg Throw,
413 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000414 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000415 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000416 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000417
418 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
419 ExprArg SynchExpr,
420 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000421 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000422 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000423 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000424
425 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000426 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000427 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000428 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000429 }
430
431 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000432 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000433 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000434 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000435 return StmtEmpty();
436 }
437
438 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
439 StmtArg TryBlock,
440 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000441 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000442 return StmtEmpty();
443 }
444
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000445 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000446 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000447 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000448
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000449 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000450
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000451 /// ActOnIdentifierExpr - Parse an identifier in expression context.
452 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
453 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000454 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
455 IdentifierInfo &II,
456 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000457 const CXXScopeSpec *SS,
458 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000459 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000460 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000461 }
462
Sebastian Redlcd965b92009-01-18 18:53:16 +0000463 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
464 Scope *S, SourceLocation OperatorLoc,
465 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000466 bool HasTrailingLParen, const CXXScopeSpec &SS,
467 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000468 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000469 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000470 }
471
Sebastian Redlcd965b92009-01-18 18:53:16 +0000472 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
473 Scope *S, SourceLocation OperatorLoc,
474 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000475 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000476 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000477 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000478 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000479
480 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
481 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000482 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000483 return ExprEmpty();
484 }
485
486 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000487 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000488 return ExprEmpty();
489 }
490
491 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000492 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000493 return ExprEmpty();
494 }
495
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000496 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
497 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000498 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
499 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000500 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000501 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000502 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000503
504 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
505 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000506 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000507 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000508 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000509
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000510 // Postfix Expressions.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000511 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
512 tok::TokenKind Kind,
513 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000514 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000515 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000516 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000517 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
518 SourceLocation LLoc,
519 ExprArg Idx,
520 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000521 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000522 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000523 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000524 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
525 SourceLocation OpLoc,
526 tok::TokenKind OpKind,
527 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000528 IdentifierInfo &Member,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000529 DeclPtrTy ImplDecl) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000530 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000531 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000532 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000533
534 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
535 SourceLocation LParenLoc,
536 MultiExprArg Args,
537 SourceLocation *CommaLocs,
538 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000539 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000540 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000541 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000542
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000543 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000544 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
545 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000546 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000547 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000548 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000549 virtual OwningExprResult
550 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
551 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000552 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000553 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000554 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000555
556 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
557 TypeTy *Ty,
558 SourceLocation RParen,
559 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000560 Out << __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 ActOnInitList(SourceLocation LParenLoc,
564 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000565 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000566 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000567 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000568 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000569 virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
570 SourceLocation RParenLoc,ExprArg Op){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000571 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000572 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000573 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000574
575 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
576 tok::TokenKind Kind,
577 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000578 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000579 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000580 }
581
582 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
583 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000584 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
585 SourceLocation ColonLoc,
586 ExprArg Cond, ExprArg LHS,
587 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000588 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000589 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000590 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000591
592 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000593
Sebastian Redlf53597f2009-03-15 17:47:39 +0000594 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
595 SourceLocation LabLoc,
596 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000597 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000598 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000599 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000600
601 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
602 StmtArg SubStmt,
603 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000604 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000605 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000606 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000607
608 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
609 SourceLocation BuiltinLoc,
610 SourceLocation TypeLoc,
611 TypeTy *Arg1,
612 OffsetOfComponent *CompPtr,
613 unsigned NumComponents,
614 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000615 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000616 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000617 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000618
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000619 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000620 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
621 TypeTy *arg1,TypeTy *arg2,
622 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000623 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000624 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000625 }
626 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000627 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
628 ExprArg cond, ExprArg expr1,
629 ExprArg expr2,
630 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000631 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000632 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000633 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000634
635 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000636 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
637 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000638 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000639 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000640 return ExprEmpty();
641 }
642
643 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000644 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000645 return ExprEmpty();
646 }
647
648 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000649 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000650 }
651
652 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000653 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000654 }
655
656 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000657 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000658 }
659
660 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
661 StmtArg Body,
662 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000663 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000664 return ExprEmpty();
665 }
666
Chris Lattnerb28317a2009-03-28 19:18:32 +0000667 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
668 IdentifierInfo *Ident,
669 SourceLocation LBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000670 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000671 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000672 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000673
Chris Lattnerb28317a2009-03-28 19:18:32 +0000674 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000675 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000676 return;
677 }
678
679#if 0
680 // FIXME: AttrList should be deleted by this function, but the definition
681 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000682 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
683 SourceLocation UsingLoc,
684 SourceLocation NamespcLoc,
685 const CXXScopeSpec &SS,
686 SourceLocation IdentLoc,
687 IdentifierInfo *NamespcName,
688 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000689 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000690 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000691 }
692#endif
693
Chris Lattnerb28317a2009-03-28 19:18:32 +0000694 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000695 SourceLocation EqualLoc,
696 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000697 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000698 }
699
Chris Lattnerb28317a2009-03-28 19:18:32 +0000700 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000701 SourceLocation EqualLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000702 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000703 }
704
Chris Lattnerb28317a2009-03-28 19:18:32 +0000705 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000706 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000707 }
708
Chris Lattnerb28317a2009-03-28 19:18:32 +0000709 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000710 SourceLocation LParenLoc,
711 MultiExprArg Exprs,
712 SourceLocation *CommaLocs,
713 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000714 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000715 return;
716 }
717
Chris Lattnerb28317a2009-03-28 19:18:32 +0000718 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
719 DeclPtrTy Method)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000720 {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000721 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000722 }
723
Chris Lattnerb28317a2009-03-28 19:18:32 +0000724 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000725 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000726 }
727
728 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000729 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000730 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000731 }
732
Chris Lattnerb28317a2009-03-28 19:18:32 +0000733 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
734 ExprArg AssertExpr,
735 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000736 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000737 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000738 }
739
740 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
741 tok::TokenKind Kind,
742 SourceLocation LAngleBracketLoc,
743 TypeTy *Ty,
744 SourceLocation RAngleBracketLoc,
745 SourceLocation LParenLoc,
746 ExprArg Op,
747 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000748 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000749 return ExprEmpty();
750 }
751
752 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
753 SourceLocation LParenLoc,
754 bool isType, void *TyOrExpr,
755 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000756 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000757 return ExprEmpty();
758 }
759
760 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000761 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000762 return ExprEmpty();
763 }
764
765 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
766 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000767 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000768 return ExprEmpty();
769 }
770
771 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000772 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000773 return ExprEmpty();
774 }
775
776 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
777 TypeTy *TypeRep,
778 SourceLocation LParenLoc,
779 MultiExprArg Exprs,
780 SourceLocation *CommaLocs,
781 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000782 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000783 return ExprEmpty();
784 }
785
786 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
787 SourceLocation StartLoc,
788 Declarator &D,
789 SourceLocation EqualLoc,
790 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000791 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000792 return ExprEmpty();
793 }
794
795 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
796 bool UseGlobal,
797 SourceLocation PlacementLParen,
798 MultiExprArg PlacementArgs,
799 SourceLocation PlacementRParen,
800 bool ParenTypeId, Declarator &D,
801 SourceLocation ConstructorLParen,
802 MultiExprArg ConstructorArgs,
803 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000804 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000805 return ExprEmpty();
806 }
807
808 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
809 bool UseGlobal, bool ArrayForm,
810 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000811 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000812 return ExprEmpty();
813 }
814
815 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
816 SourceLocation KWLoc,
817 SourceLocation LParen,
818 TypeTy *Ty,
819 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000820 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000821 return ExprEmpty();
822 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000823 };
824}
825
Eli Friedmanf54fce82009-05-19 01:02:07 +0000826MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
827 llvm::raw_ostream* OS) {
828 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000829}