blob: 43a5b6f20f11cfe6fdd366679d4fcfa83a530967 [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
John McCall0f434ec2009-07-31 02:45:11 +0000196 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagType, TagUseKind TUK,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000197 SourceLocation KWLoc, const CXXScopeSpec &SS,
198 IdentifierInfo *Name, SourceLocation NameLoc,
Douglas Gregor402abb52009-05-28 23:31:59 +0000199 AttributeList *Attr, AccessSpecifier AS,
Douglas Gregorbd1099e2009-07-23 16:36:45 +0000200 MultiTemplateParamsArg TemplateParamLists,
Douglas Gregor402abb52009-05-28 23:31:59 +0000201 bool &Owned) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000202 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
203 // is (struct/union/enum/class).
Eli Friedmanf54fce82009-05-19 01:02:07 +0000204 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000205 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000206 }
207
208 /// Act on @defs() element found when parsing a structure. ClassName is the
209 /// name of the referenced class.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000210 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000211 IdentifierInfo *ClassName,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000212 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000213 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000214 }
215
Chris Lattnerb28317a2009-03-28 19:18:32 +0000216 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
217 SourceLocation DeclStart,
218 Declarator &D, ExprTy *BitfieldWidth) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000219 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000220 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000221 }
222
Chris Lattnerb28317a2009-03-28 19:18:32 +0000223 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
Fariborz Jahanian496b5a82009-06-05 18:16:35 +0000224 DeclPtrTy IntfDecl,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000225 Declarator &D, ExprTy *BitfieldWidth,
226 tok::ObjCKeywordKind visibility) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000227 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000228 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000229 }
230
Chris Lattnerb28317a2009-03-28 19:18:32 +0000231 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
232 DeclPtrTy *Fields, unsigned NumFields,
Daniel Dunbar1bfe1c22008-10-03 02:03:53 +0000233 SourceLocation LBrac, SourceLocation RBrac,
234 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000235 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000236 }
237
Chris Lattnerb28317a2009-03-28 19:18:32 +0000238 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
239 DeclPtrTy LastEnumConstant,
240 SourceLocation IdLoc,IdentifierInfo *Id,
241 SourceLocation EqualLoc, ExprTy *Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000242 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000243 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000244 }
245
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000246 virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
247 SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000248 DeclPtrTy *Elements, unsigned NumElements) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000249 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000250 }
251
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000252 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000253 // Statement Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000254 //===------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000255
256 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000257 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000258 return StmtEmpty();
259 }
260
261 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
262 SourceLocation R,
263 MultiStmtArg Elts,
264 bool isStmtExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000265 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000266 return StmtEmpty();
267 }
Chris Lattner682bf922009-03-29 16:50:03 +0000268 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000269 SourceLocation StartLoc,
270 SourceLocation EndLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000271 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000272 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000273 }
274
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000275 virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000276 Out << __FUNCTION__ << "\n";
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000277 return OwningStmtResult(*this, Expr->release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000278 }
279
280 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
281 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000282 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
283 ExprArg LHSVal,
284 SourceLocation DotDotDotLoc,
285 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000286 SourceLocation ColonLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000287 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000288 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000289 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000290 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
291 SourceLocation ColonLoc,
292 StmtArg SubStmt, Scope *CurScope){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000293 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000294 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000295 }
Sebastian Redlde307472009-01-11 00:38:46 +0000296
297 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
298 IdentifierInfo *II,
299 SourceLocation ColonLoc,
300 StmtArg SubStmt) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000301 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000302 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000303 }
Sebastian Redlde307472009-01-11 00:38:46 +0000304
Anders Carlssona99fad82009-05-17 18:26:53 +0000305 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
306 FullExprArg CondVal, StmtArg ThenVal,
307 SourceLocation ElseLoc,
Sebastian Redlde307472009-01-11 00:38:46 +0000308 StmtArg ElseVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000309 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000310 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000311 }
Sebastian Redlde307472009-01-11 00:38:46 +0000312
313 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000314 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000315 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000316 }
Sebastian Redlde307472009-01-11 00:38:46 +0000317
318 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
319 StmtArg Switch,
320 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000321 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000322 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000323 }
324
Sebastian Redlf05b1522009-01-16 23:28:06 +0000325 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Anders Carlsson7f537c12009-05-17 21:22:26 +0000326 FullExprArg Cond, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000327 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000328 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000329 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000330 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
Chris Lattner98913592009-06-12 23:04:47 +0000331 SourceLocation WhileLoc,
332 SourceLocation LPLoc, ExprArg Cond,
333 SourceLocation RPLoc){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000334 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000335 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000336 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000337 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
338 SourceLocation LParenLoc,
339 StmtArg First, ExprArg Second,
340 ExprArg Third, SourceLocation RParenLoc,
341 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000342 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000343 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000344 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000345 virtual OwningStmtResult ActOnObjCForCollectionStmt(
346 SourceLocation ForColLoc,
347 SourceLocation LParenLoc,
348 StmtArg First, ExprArg Second,
349 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000350 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000351 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000352 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000353 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
354 SourceLocation LabelLoc,
355 IdentifierInfo *LabelII) {
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 ActOnIndirectGotoStmt(SourceLocation GotoLoc,
360 SourceLocation StarLoc,
361 ExprArg DestExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000362 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000363 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000364 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000365 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
366 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000367 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000368 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000369 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000370 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
371 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000372 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000373 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000374 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000375 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
Anders Carlssona0ab25d2009-05-30 21:42:34 +0000376 FullExprArg RetValExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000377 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000378 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000379 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000380 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000381 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000382 bool IsVolatile,
383 unsigned NumOutputs,
384 unsigned NumInputs,
385 std::string *Names,
386 MultiExprArg Constraints,
387 MultiExprArg Exprs,
388 ExprArg AsmString,
389 MultiExprArg Clobbers,
390 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000391 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000392 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000393 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000394
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000395 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000396 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
397 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000398 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000399 StmtArg CatchList) {
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 ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
405 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000406 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000407 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000408 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000409
410 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
411 StmtArg Try, StmtArg Catch,
412 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000413 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000414 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000415 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000416
417 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000418 ExprArg Throw,
419 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000420 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000421 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000422 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000423
424 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
425 ExprArg SynchExpr,
426 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000427 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000428 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000429 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000430
431 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000432 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000433 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000434 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000435 }
436
437 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000438 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000439 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000440 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000441 return StmtEmpty();
442 }
443
444 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
445 StmtArg TryBlock,
446 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000447 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000448 return StmtEmpty();
449 }
450
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000451 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000452 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000453 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000454
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000455 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000456
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000457 /// ActOnIdentifierExpr - Parse an identifier in expression context.
458 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
459 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000460 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
461 IdentifierInfo &II,
462 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000463 const CXXScopeSpec *SS,
464 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000465 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000466 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000467 }
468
Sebastian Redlcd965b92009-01-18 18:53:16 +0000469 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
470 Scope *S, SourceLocation OperatorLoc,
471 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000472 bool HasTrailingLParen, const CXXScopeSpec &SS,
473 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000474 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000475 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000476 }
477
Sebastian Redlcd965b92009-01-18 18:53:16 +0000478 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
479 Scope *S, SourceLocation OperatorLoc,
480 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000481 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000482 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000483 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000484 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000485
486 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
487 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000488 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000489 return ExprEmpty();
490 }
491
492 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000493 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000494 return ExprEmpty();
495 }
496
497 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000498 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000499 return ExprEmpty();
500 }
501
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000502 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
503 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000504 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
505 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000506 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000507 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000508 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000509
510 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
511 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000512 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000513 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000514 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000515
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000516 // Postfix Expressions.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000517 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
518 tok::TokenKind Kind,
519 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000520 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000521 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000522 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000523 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
524 SourceLocation LLoc,
525 ExprArg Idx,
526 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000527 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000528 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000529 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000530 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
531 SourceLocation OpLoc,
532 tok::TokenKind OpKind,
533 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000534 IdentifierInfo &Member,
Douglas Gregorfe85ced2009-08-06 03:17:00 +0000535 DeclPtrTy ImplDecl,
536 const CXXScopeSpec *SS=0) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000537 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000538 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000539 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000540
541 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
542 SourceLocation LParenLoc,
543 MultiExprArg Args,
544 SourceLocation *CommaLocs,
545 SourceLocation RParenLoc) {
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
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000550 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000551 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
552 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000553 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000554 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000555 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000556 virtual OwningExprResult
557 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
558 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000559 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000560 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000561 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000562
563 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
564 TypeTy *Ty,
565 SourceLocation RParen,
566 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000567 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000568 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000569 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000570 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
571 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000572 SourceLocation RParenLoc) {
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 virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
577 SourceLocation RParenLoc,ExprArg Op){
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 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000581
582 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
583 tok::TokenKind Kind,
584 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000585 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000586 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000587 }
588
589 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
590 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000591 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
592 SourceLocation ColonLoc,
593 ExprArg Cond, ExprArg LHS,
594 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000595 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000596 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000597 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000598
599 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000600
Sebastian Redlf53597f2009-03-15 17:47:39 +0000601 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
602 SourceLocation LabLoc,
603 IdentifierInfo *LabelII) {// "&&foo"
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 ActOnStmtExpr(SourceLocation LPLoc,
609 StmtArg SubStmt,
610 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000611 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000612 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000613 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000614
615 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
616 SourceLocation BuiltinLoc,
617 SourceLocation TypeLoc,
618 TypeTy *Arg1,
619 OffsetOfComponent *CompPtr,
620 unsigned NumComponents,
621 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000622 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000623 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000624 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000625
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000626 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000627 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
628 TypeTy *arg1,TypeTy *arg2,
629 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000630 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000631 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000632 }
633 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000634 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
635 ExprArg cond, ExprArg expr1,
636 ExprArg expr2,
637 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000638 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000639 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000640 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000641
642 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000643 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
644 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000645 SourceLocation RPLoc) {
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 OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000651 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000652 return ExprEmpty();
653 }
654
655 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000656 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000657 }
658
659 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000660 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000661 }
662
663 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000664 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000665 }
666
667 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
668 StmtArg Body,
669 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000670 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000671 return ExprEmpty();
672 }
673
Chris Lattnerb28317a2009-03-28 19:18:32 +0000674 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
675 IdentifierInfo *Ident,
676 SourceLocation LBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000677 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000678 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000679 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000680
Chris Lattnerb28317a2009-03-28 19:18:32 +0000681 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000682 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000683 return;
684 }
685
686#if 0
687 // FIXME: AttrList should be deleted by this function, but the definition
688 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000689 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
690 SourceLocation UsingLoc,
691 SourceLocation NamespcLoc,
692 const CXXScopeSpec &SS,
693 SourceLocation IdentLoc,
694 IdentifierInfo *NamespcName,
695 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000696 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000697 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000698 }
699#endif
700
Chris Lattnerb28317a2009-03-28 19:18:32 +0000701 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000702 SourceLocation EqualLoc,
703 ExprArg defarg) {
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 ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Anders Carlsson5e300d12009-06-12 16:51:40 +0000708 SourceLocation EqualLoc,
709 SourceLocation ArgLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000710 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000711 }
712
Chris Lattnerb28317a2009-03-28 19:18:32 +0000713 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000714 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000715 }
716
Chris Lattnerb28317a2009-03-28 19:18:32 +0000717 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000718 SourceLocation LParenLoc,
719 MultiExprArg Exprs,
720 SourceLocation *CommaLocs,
721 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000722 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000723 return;
724 }
725
Chris Lattnerb28317a2009-03-28 19:18:32 +0000726 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
727 DeclPtrTy Method)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000728 {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000729 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000730 }
731
Chris Lattnerb28317a2009-03-28 19:18:32 +0000732 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000733 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000734 }
735
736 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000737 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000738 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000739 }
740
Chris Lattnerb28317a2009-03-28 19:18:32 +0000741 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
742 ExprArg AssertExpr,
743 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000744 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000745 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000746 }
747
748 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
749 tok::TokenKind Kind,
750 SourceLocation LAngleBracketLoc,
751 TypeTy *Ty,
752 SourceLocation RAngleBracketLoc,
753 SourceLocation LParenLoc,
754 ExprArg Op,
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 ActOnCXXTypeid(SourceLocation OpLoc,
761 SourceLocation LParenLoc,
762 bool isType, void *TyOrExpr,
763 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000764 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000765 return ExprEmpty();
766 }
767
768 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
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 ActOnCXXBoolLiteral(SourceLocation OpLoc,
774 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000775 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000776 return ExprEmpty();
777 }
778
779 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000780 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000781 return ExprEmpty();
782 }
783
784 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
785 TypeTy *TypeRep,
786 SourceLocation LParenLoc,
787 MultiExprArg Exprs,
788 SourceLocation *CommaLocs,
789 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000790 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000791 return ExprEmpty();
792 }
793
794 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
795 SourceLocation StartLoc,
796 Declarator &D,
797 SourceLocation EqualLoc,
798 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000799 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000800 return ExprEmpty();
801 }
802
803 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
804 bool UseGlobal,
805 SourceLocation PlacementLParen,
806 MultiExprArg PlacementArgs,
807 SourceLocation PlacementRParen,
808 bool ParenTypeId, Declarator &D,
809 SourceLocation ConstructorLParen,
810 MultiExprArg ConstructorArgs,
811 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000812 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000813 return ExprEmpty();
814 }
815
816 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
817 bool UseGlobal, bool ArrayForm,
818 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000819 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000820 return ExprEmpty();
821 }
822
823 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
824 SourceLocation KWLoc,
825 SourceLocation LParen,
826 TypeTy *Ty,
827 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000828 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000829 return ExprEmpty();
830 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000831 };
832}
833
Eli Friedmanf54fce82009-05-19 01:02:07 +0000834MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
835 llvm::raw_ostream* OS) {
836 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000837}