blob: fbac3c88aa34b23f46478730331b98cbc4107eaa [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
Eli Friedmanb09f6e12009-05-19 04:14:29 +000015#include "clang/Frontend/Utils.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.
Anders Carlssonf5dcd382009-05-30 21:37:25 +0000112 virtual void AddInitializerToDecl(DeclPtrTy Dcl, FullExprArg 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.
Eli Friedmanc1dc6532009-05-29 01:49:24 +0000119 virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec& DS,
120 DeclPtrTy *Group,
Chris Lattner682bf922009-03-29 16:50:03 +0000121 unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000122 Out << __FUNCTION__ << "\n";
Chris Lattner682bf922009-03-29 16:50:03 +0000123 return DeclGroupPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000124 }
125
126 /// ActOnStartOfFunctionDef - This is called at the start of a function
127 /// definition, instead of calling ActOnDeclarator. The Declarator includes
128 /// information about formal arguments that are part of this function.
Chris Lattner682bf922009-03-29 16:50:03 +0000129 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope,
130 Declarator &D){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000131 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000132 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000133 }
134
135 /// ActOnStartOfFunctionDef - This is called at the start of a function
136 /// definition, after the FunctionDecl has already been created.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000137 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000138 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000139 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000140 }
141
Chris Lattnerb28317a2009-03-28 19:18:32 +0000142 virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000143 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000144 }
145
146 /// ActOnFunctionDefBody - This is called when a function body has completed
147 /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000148 virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000149 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000150 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000151 }
152
Chris Lattnerb28317a2009-03-28 19:18:32 +0000153 virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
154 ExprArg AsmString) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000155 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000156 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000157 }
158
159 /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
160 /// no declarator (e.g. "struct foo;") is parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000161 virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000162 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000163 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000164 }
Douglas Gregore79837a2008-12-17 01:46:43 +0000165
166 /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
167 /// contained braces. Lang/StrSize contains the language string that
168 /// was parsed at location Loc. Decls/NumDecls provides the
169 /// declarations parsed inside the linkage specification.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000170 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
171 SourceLocation LBrace,
172 SourceLocation RBrace, const char *Lang,
173 unsigned StrSize,
174 DeclPtrTy *Decls, unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000175 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000176 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000177 }
Douglas Gregore79837a2008-12-17 01:46:43 +0000178
179 /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
180 /// braces. Lang/StrSize contains the language string that was
181 /// parsed at location Loc. D is the declaration parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000182 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
183 unsigned StrSize, DeclPtrTy D) {
184 return DeclPtrTy();
Douglas Gregore79837a2008-12-17 01:46:43 +0000185 }
186
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000187 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000188 // Type Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000189 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000190
Sebastian Redlcee63fb2008-12-02 14:43:59 +0000191 virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000192 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000193 return TypeResult();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000194 }
195
Chris Lattnerb28317a2009-03-28 19:18:32 +0000196 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagType, TagKind TK,
197 SourceLocation KWLoc, const CXXScopeSpec &SS,
198 IdentifierInfo *Name, SourceLocation NameLoc,
Douglas Gregor402abb52009-05-28 23:31:59 +0000199 AttributeList *Attr, AccessSpecifier AS,
200 bool &Owned) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000201 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
202 // is (struct/union/enum/class).
Eli Friedmanf54fce82009-05-19 01:02:07 +0000203 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000204 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000205 }
206
207 /// Act on @defs() element found when parsing a structure. ClassName is the
208 /// name of the referenced class.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000209 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000210 IdentifierInfo *ClassName,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000211 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000212 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000213 }
214
Chris Lattnerb28317a2009-03-28 19:18:32 +0000215 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
216 SourceLocation DeclStart,
217 Declarator &D, ExprTy *BitfieldWidth) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000218 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000219 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000220 }
221
Chris Lattnerb28317a2009-03-28 19:18:32 +0000222 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
223 Declarator &D, ExprTy *BitfieldWidth,
224 tok::ObjCKeywordKind visibility) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000225 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000226 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000227 }
228
Chris Lattnerb28317a2009-03-28 19:18:32 +0000229 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
230 DeclPtrTy *Fields, unsigned NumFields,
Daniel Dunbar1bfe1c22008-10-03 02:03:53 +0000231 SourceLocation LBrac, SourceLocation RBrac,
232 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000233 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000234 }
235
Chris Lattnerb28317a2009-03-28 19:18:32 +0000236 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
237 DeclPtrTy LastEnumConstant,
238 SourceLocation IdLoc,IdentifierInfo *Id,
239 SourceLocation EqualLoc, ExprTy *Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000240 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000241 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000242 }
243
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000244 virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
245 SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000246 DeclPtrTy *Elements, unsigned NumElements) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000247 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000248 }
249
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000250 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000251 // Statement Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000252 //===------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000253
254 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000255 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000256 return StmtEmpty();
257 }
258
259 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
260 SourceLocation R,
261 MultiStmtArg Elts,
262 bool isStmtExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000263 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000264 return StmtEmpty();
265 }
Chris Lattner682bf922009-03-29 16:50:03 +0000266 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000267 SourceLocation StartLoc,
268 SourceLocation EndLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000269 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000270 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000271 }
272
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000273 virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000274 Out << __FUNCTION__ << "\n";
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000275 return OwningStmtResult(*this, Expr->release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000276 }
277
278 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
279 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000280 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
281 ExprArg LHSVal,
282 SourceLocation DotDotDotLoc,
283 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000284 SourceLocation ColonLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000285 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000286 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000287 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000288 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
289 SourceLocation ColonLoc,
290 StmtArg SubStmt, Scope *CurScope){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000291 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000292 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000293 }
Sebastian Redlde307472009-01-11 00:38:46 +0000294
295 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
296 IdentifierInfo *II,
297 SourceLocation ColonLoc,
298 StmtArg SubStmt) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000299 Out << __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
Anders Carlssona99fad82009-05-17 18:26:53 +0000303 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
304 FullExprArg CondVal, StmtArg ThenVal,
305 SourceLocation ElseLoc,
Sebastian Redlde307472009-01-11 00:38:46 +0000306 StmtArg ElseVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000307 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000308 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000309 }
Sebastian Redlde307472009-01-11 00:38:46 +0000310
311 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000312 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000313 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000314 }
Sebastian Redlde307472009-01-11 00:38:46 +0000315
316 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
317 StmtArg Switch,
318 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000319 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000320 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000321 }
322
Sebastian Redlf05b1522009-01-16 23:28:06 +0000323 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Anders Carlsson7f537c12009-05-17 21:22:26 +0000324 FullExprArg Cond, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000325 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000326 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000327 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000328 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
329 SourceLocation WhileLoc, ExprArg Cond){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000330 Out << __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 ActOnForStmt(SourceLocation ForLoc,
334 SourceLocation LParenLoc,
335 StmtArg First, ExprArg Second,
336 ExprArg Third, SourceLocation RParenLoc,
337 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000338 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000339 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000340 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000341 virtual OwningStmtResult ActOnObjCForCollectionStmt(
342 SourceLocation ForColLoc,
343 SourceLocation LParenLoc,
344 StmtArg First, ExprArg Second,
345 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000346 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000347 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000348 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000349 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
350 SourceLocation LabelLoc,
351 IdentifierInfo *LabelII) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000352 Out << __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 ActOnIndirectGotoStmt(SourceLocation GotoLoc,
356 SourceLocation StarLoc,
357 ExprArg DestExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000358 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000359 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000360 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000361 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
362 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000363 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000364 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000365 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000366 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
367 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000368 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000369 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000370 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000371 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
372 ExprArg RetValExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000373 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000374 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000375 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000376 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000377 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000378 bool IsVolatile,
379 unsigned NumOutputs,
380 unsigned NumInputs,
381 std::string *Names,
382 MultiExprArg Constraints,
383 MultiExprArg Exprs,
384 ExprArg AsmString,
385 MultiExprArg Clobbers,
386 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000387 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000388 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000389 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000390
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000391 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000392 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
393 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000394 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000395 StmtArg CatchList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000396 Out << __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 ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
401 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000402 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000403 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000404 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000405
406 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
407 StmtArg Try, StmtArg Catch,
408 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000409 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000410 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000411 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000412
413 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000414 ExprArg Throw,
415 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000416 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000417 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000418 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000419
420 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
421 ExprArg SynchExpr,
422 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000423 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000424 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000425 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000426
427 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000428 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000429 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000430 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000431 }
432
433 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000434 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000435 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000436 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000437 return StmtEmpty();
438 }
439
440 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
441 StmtArg TryBlock,
442 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000443 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000444 return StmtEmpty();
445 }
446
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000447 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000448 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000449 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000450
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000451 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000452
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000453 /// ActOnIdentifierExpr - Parse an identifier in expression context.
454 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
455 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000456 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
457 IdentifierInfo &II,
458 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000459 const CXXScopeSpec *SS,
460 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000461 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000462 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000463 }
464
Sebastian Redlcd965b92009-01-18 18:53:16 +0000465 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
466 Scope *S, SourceLocation OperatorLoc,
467 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000468 bool HasTrailingLParen, const CXXScopeSpec &SS,
469 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000470 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000471 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000472 }
473
Sebastian Redlcd965b92009-01-18 18:53:16 +0000474 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
475 Scope *S, SourceLocation OperatorLoc,
476 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000477 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000478 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000479 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000480 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000481
482 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
483 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000484 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000485 return ExprEmpty();
486 }
487
488 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000489 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000490 return ExprEmpty();
491 }
492
493 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000494 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000495 return ExprEmpty();
496 }
497
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000498 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
499 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000500 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
501 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000502 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000503 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000504 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000505
506 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
507 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000508 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000509 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000510 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000511
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000512 // Postfix Expressions.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000513 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
514 tok::TokenKind Kind,
515 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000516 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000517 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000518 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000519 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
520 SourceLocation LLoc,
521 ExprArg Idx,
522 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000523 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000524 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000525 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000526 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
527 SourceLocation OpLoc,
528 tok::TokenKind OpKind,
529 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000530 IdentifierInfo &Member,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000531 DeclPtrTy ImplDecl) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000532 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000533 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000534 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000535
536 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
537 SourceLocation LParenLoc,
538 MultiExprArg Args,
539 SourceLocation *CommaLocs,
540 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000541 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000542 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000543 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000544
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000545 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000546 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
547 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000548 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000549 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000550 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000551 virtual OwningExprResult
552 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
553 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000554 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000555 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000556 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000557
558 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
559 TypeTy *Ty,
560 SourceLocation RParen,
561 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000562 Out << __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 ActOnInitList(SourceLocation LParenLoc,
566 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000567 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000568 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000569 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000570 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000571 virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
572 SourceLocation RParenLoc,ExprArg Op){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000573 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000574 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000575 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000576
577 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
578 tok::TokenKind Kind,
579 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000580 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000581 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000582 }
583
584 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
585 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000586 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
587 SourceLocation ColonLoc,
588 ExprArg Cond, ExprArg LHS,
589 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000590 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000591 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000592 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000593
594 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000595
Sebastian Redlf53597f2009-03-15 17:47:39 +0000596 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
597 SourceLocation LabLoc,
598 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000599 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000600 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000601 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000602
603 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
604 StmtArg SubStmt,
605 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000606 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000607 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000608 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000609
610 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
611 SourceLocation BuiltinLoc,
612 SourceLocation TypeLoc,
613 TypeTy *Arg1,
614 OffsetOfComponent *CompPtr,
615 unsigned NumComponents,
616 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000617 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000618 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000619 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000620
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000621 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000622 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
623 TypeTy *arg1,TypeTy *arg2,
624 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000625 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000626 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000627 }
628 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000629 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
630 ExprArg cond, ExprArg expr1,
631 ExprArg expr2,
632 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000633 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000634 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000635 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000636
637 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000638 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
639 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000640 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000641 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000642 return ExprEmpty();
643 }
644
645 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000646 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000647 return ExprEmpty();
648 }
649
650 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000651 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000652 }
653
654 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000655 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000656 }
657
658 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000659 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000660 }
661
662 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
663 StmtArg Body,
664 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000665 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000666 return ExprEmpty();
667 }
668
Chris Lattnerb28317a2009-03-28 19:18:32 +0000669 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
670 IdentifierInfo *Ident,
671 SourceLocation LBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000672 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000673 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000674 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000675
Chris Lattnerb28317a2009-03-28 19:18:32 +0000676 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000677 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000678 return;
679 }
680
681#if 0
682 // FIXME: AttrList should be deleted by this function, but the definition
683 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000684 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
685 SourceLocation UsingLoc,
686 SourceLocation NamespcLoc,
687 const CXXScopeSpec &SS,
688 SourceLocation IdentLoc,
689 IdentifierInfo *NamespcName,
690 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000691 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000692 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000693 }
694#endif
695
Chris Lattnerb28317a2009-03-28 19:18:32 +0000696 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000697 SourceLocation EqualLoc,
698 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000699 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000700 }
701
Chris Lattnerb28317a2009-03-28 19:18:32 +0000702 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000703 SourceLocation EqualLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000704 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000705 }
706
Chris Lattnerb28317a2009-03-28 19:18:32 +0000707 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000708 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000709 }
710
Chris Lattnerb28317a2009-03-28 19:18:32 +0000711 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000712 SourceLocation LParenLoc,
713 MultiExprArg Exprs,
714 SourceLocation *CommaLocs,
715 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000716 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000717 return;
718 }
719
Chris Lattnerb28317a2009-03-28 19:18:32 +0000720 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
721 DeclPtrTy Method)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000722 {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000723 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000724 }
725
Chris Lattnerb28317a2009-03-28 19:18:32 +0000726 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000727 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000728 }
729
730 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000731 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000732 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000733 }
734
Chris Lattnerb28317a2009-03-28 19:18:32 +0000735 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
736 ExprArg AssertExpr,
737 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000738 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000739 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000740 }
741
742 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
743 tok::TokenKind Kind,
744 SourceLocation LAngleBracketLoc,
745 TypeTy *Ty,
746 SourceLocation RAngleBracketLoc,
747 SourceLocation LParenLoc,
748 ExprArg Op,
749 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000750 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000751 return ExprEmpty();
752 }
753
754 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
755 SourceLocation LParenLoc,
756 bool isType, void *TyOrExpr,
757 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000758 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000759 return ExprEmpty();
760 }
761
762 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000763 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000764 return ExprEmpty();
765 }
766
767 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
768 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000769 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000770 return ExprEmpty();
771 }
772
773 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000774 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000775 return ExprEmpty();
776 }
777
778 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
779 TypeTy *TypeRep,
780 SourceLocation LParenLoc,
781 MultiExprArg Exprs,
782 SourceLocation *CommaLocs,
783 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000784 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000785 return ExprEmpty();
786 }
787
788 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
789 SourceLocation StartLoc,
790 Declarator &D,
791 SourceLocation EqualLoc,
792 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000793 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000794 return ExprEmpty();
795 }
796
797 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
798 bool UseGlobal,
799 SourceLocation PlacementLParen,
800 MultiExprArg PlacementArgs,
801 SourceLocation PlacementRParen,
802 bool ParenTypeId, Declarator &D,
803 SourceLocation ConstructorLParen,
804 MultiExprArg ConstructorArgs,
805 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000806 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000807 return ExprEmpty();
808 }
809
810 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
811 bool UseGlobal, bool ArrayForm,
812 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000813 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000814 return ExprEmpty();
815 }
816
817 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
818 SourceLocation KWLoc,
819 SourceLocation LParen,
820 TypeTy *Ty,
821 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000822 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000823 return ExprEmpty();
824 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000825 };
826}
827
Eli Friedmanf54fce82009-05-19 01:02:07 +0000828MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
829 llvm::raw_ostream* OS) {
830 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000831}