blob: 2101a85f4113c3e65e016cb657ab133bed781fef [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,
Edward O'Callaghanfee13812009-08-08 14:36:57 +0000248 DeclPtrTy *Elements, unsigned NumElements,
249 Scope *S, AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000250 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000251 }
252
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000253 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000254 // Statement Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000255 //===------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000256
257 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000258 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000259 return StmtEmpty();
260 }
261
262 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
263 SourceLocation R,
264 MultiStmtArg Elts,
265 bool isStmtExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000266 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000267 return StmtEmpty();
268 }
Chris Lattner682bf922009-03-29 16:50:03 +0000269 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000270 SourceLocation StartLoc,
271 SourceLocation EndLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000272 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000273 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000274 }
275
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000276 virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000277 Out << __FUNCTION__ << "\n";
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000278 return OwningStmtResult(*this, Expr->release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000279 }
280
281 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
282 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000283 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
284 ExprArg LHSVal,
285 SourceLocation DotDotDotLoc,
286 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000287 SourceLocation ColonLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000288 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000289 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000290 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000291 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
292 SourceLocation ColonLoc,
293 StmtArg SubStmt, Scope *CurScope){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000294 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000295 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000296 }
Sebastian Redlde307472009-01-11 00:38:46 +0000297
298 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
299 IdentifierInfo *II,
300 SourceLocation ColonLoc,
301 StmtArg SubStmt) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000302 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000303 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000304 }
Sebastian Redlde307472009-01-11 00:38:46 +0000305
Anders Carlssona99fad82009-05-17 18:26:53 +0000306 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
307 FullExprArg CondVal, StmtArg ThenVal,
308 SourceLocation ElseLoc,
Sebastian Redlde307472009-01-11 00:38:46 +0000309 StmtArg ElseVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000310 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000311 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000312 }
Sebastian Redlde307472009-01-11 00:38:46 +0000313
314 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000315 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000316 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000317 }
Sebastian Redlde307472009-01-11 00:38:46 +0000318
319 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
320 StmtArg Switch,
321 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000322 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000323 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000324 }
325
Sebastian Redlf05b1522009-01-16 23:28:06 +0000326 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Anders Carlsson7f537c12009-05-17 21:22:26 +0000327 FullExprArg Cond, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000328 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000329 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000330 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000331 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
Chris Lattner98913592009-06-12 23:04:47 +0000332 SourceLocation WhileLoc,
333 SourceLocation LPLoc, ExprArg Cond,
334 SourceLocation RPLoc){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000335 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000336 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000337 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000338 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
339 SourceLocation LParenLoc,
340 StmtArg First, ExprArg Second,
341 ExprArg Third, SourceLocation RParenLoc,
342 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000343 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000344 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000345 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000346 virtual OwningStmtResult ActOnObjCForCollectionStmt(
347 SourceLocation ForColLoc,
348 SourceLocation LParenLoc,
349 StmtArg First, ExprArg Second,
350 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000351 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000352 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000353 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000354 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
355 SourceLocation LabelLoc,
356 IdentifierInfo *LabelII) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000357 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000358 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000359 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000360 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
361 SourceLocation StarLoc,
362 ExprArg DestExp) {
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 ActOnContinueStmt(SourceLocation ContinueLoc,
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 ActOnBreakStmt(SourceLocation GotoLoc,
372 Scope *CurScope) {
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 Redl4cffe2f2009-01-18 13:19:59 +0000376 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
Anders Carlssona0ab25d2009-05-30 21:42:34 +0000377 FullExprArg RetValExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000378 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000379 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000380 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000381 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000382 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000383 bool IsVolatile,
384 unsigned NumOutputs,
385 unsigned NumInputs,
386 std::string *Names,
387 MultiExprArg Constraints,
388 MultiExprArg Exprs,
389 ExprArg AsmString,
390 MultiExprArg Clobbers,
391 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000392 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000393 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000394 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000395
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000396 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000397 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
398 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000399 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000400 StmtArg CatchList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000401 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000402 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000403 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000404
405 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
406 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000407 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000408 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000409 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000410
411 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
412 StmtArg Try, StmtArg Catch,
413 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000414 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000415 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000416 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000417
418 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000419 ExprArg Throw,
420 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000421 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000422 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000423 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000424
425 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
426 ExprArg SynchExpr,
427 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000428 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000429 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000430 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000431
432 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000433 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000434 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000435 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000436 }
437
438 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000439 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000440 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000441 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000442 return StmtEmpty();
443 }
444
445 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
446 StmtArg TryBlock,
447 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000448 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000449 return StmtEmpty();
450 }
451
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000452 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000453 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000454 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000455
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000456 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000457
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000458 /// ActOnIdentifierExpr - Parse an identifier in expression context.
459 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
460 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000461 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
462 IdentifierInfo &II,
463 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000464 const CXXScopeSpec *SS,
465 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000466 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000467 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000468 }
469
Sebastian Redlcd965b92009-01-18 18:53:16 +0000470 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
471 Scope *S, SourceLocation OperatorLoc,
472 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000473 bool HasTrailingLParen, const CXXScopeSpec &SS,
474 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000475 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000476 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000477 }
478
Sebastian Redlcd965b92009-01-18 18:53:16 +0000479 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
480 Scope *S, SourceLocation OperatorLoc,
481 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000482 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000483 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000484 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000485 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000486
487 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
488 tok::TokenKind Kind) {
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 ActOnCharacterConstant(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
498 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000499 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000500 return ExprEmpty();
501 }
502
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000503 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
504 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000505 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
506 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000507 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000508 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000509 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000510
511 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
512 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000513 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000514 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000515 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000516
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000517 // Postfix Expressions.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000518 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
519 tok::TokenKind Kind,
520 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000521 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000522 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000523 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000524 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
525 SourceLocation LLoc,
526 ExprArg Idx,
527 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000528 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000529 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000530 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000531 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
532 SourceLocation OpLoc,
533 tok::TokenKind OpKind,
534 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000535 IdentifierInfo &Member,
Douglas Gregorfe85ced2009-08-06 03:17:00 +0000536 DeclPtrTy ImplDecl,
537 const CXXScopeSpec *SS=0) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000538 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000539 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000540 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000541
542 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
543 SourceLocation LParenLoc,
544 MultiExprArg Args,
545 SourceLocation *CommaLocs,
546 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000547 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000548 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000549 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000550
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000551 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000552 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
553 tok::TokenKind Op, ExprArg Input) {
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 Redl0eb23302009-01-19 00:08:26 +0000557 virtual OwningExprResult
558 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
559 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000560 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000561 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000562 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000563
564 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
565 TypeTy *Ty,
566 SourceLocation RParen,
567 ExprArg Op) {
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 ActOnInitList(SourceLocation LParenLoc,
572 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000573 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000574 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000575 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000576 }
Nate Begeman2ef13e52009-08-10 23:49:36 +0000577 virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
578 TypeTy *Ty, SourceLocation RParenLoc,
579 ExprArg Op) {
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 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000583
584 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
585 tok::TokenKind Kind,
586 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000587 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000588 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000589 }
590
591 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
592 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000593 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
594 SourceLocation ColonLoc,
595 ExprArg Cond, ExprArg LHS,
596 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000597 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000598 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000599 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000600
601 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000602
Sebastian Redlf53597f2009-03-15 17:47:39 +0000603 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
604 SourceLocation LabLoc,
605 IdentifierInfo *LabelII) {// "&&foo"
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 ActOnStmtExpr(SourceLocation LPLoc,
611 StmtArg SubStmt,
612 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000613 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000614 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000615 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000616
617 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
618 SourceLocation BuiltinLoc,
619 SourceLocation TypeLoc,
620 TypeTy *Arg1,
621 OffsetOfComponent *CompPtr,
622 unsigned NumComponents,
623 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000624 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000625 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000626 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000627
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000628 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000629 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
630 TypeTy *arg1,TypeTy *arg2,
631 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000632 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000633 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000634 }
635 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000636 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
637 ExprArg cond, ExprArg expr1,
638 ExprArg expr2,
639 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000640 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000641 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000642 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000643
644 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000645 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
646 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000647 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000648 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000649 return ExprEmpty();
650 }
651
652 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000653 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000654 return ExprEmpty();
655 }
656
657 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000658 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000659 }
660
661 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000662 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000663 }
664
665 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000666 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000667 }
668
669 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
670 StmtArg Body,
671 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000672 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000673 return ExprEmpty();
674 }
675
Chris Lattnerb28317a2009-03-28 19:18:32 +0000676 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
677 IdentifierInfo *Ident,
678 SourceLocation LBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000679 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000680 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000681 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000682
Chris Lattnerb28317a2009-03-28 19:18:32 +0000683 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000684 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000685 return;
686 }
687
688#if 0
689 // FIXME: AttrList should be deleted by this function, but the definition
690 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000691 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
692 SourceLocation UsingLoc,
693 SourceLocation NamespcLoc,
694 const CXXScopeSpec &SS,
695 SourceLocation IdentLoc,
696 IdentifierInfo *NamespcName,
697 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000698 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000699 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000700 }
701#endif
702
Chris Lattnerb28317a2009-03-28 19:18:32 +0000703 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000704 SourceLocation EqualLoc,
705 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000706 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000707 }
708
Chris Lattnerb28317a2009-03-28 19:18:32 +0000709 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Anders Carlsson5e300d12009-06-12 16:51:40 +0000710 SourceLocation EqualLoc,
711 SourceLocation ArgLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000712 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000713 }
714
Chris Lattnerb28317a2009-03-28 19:18:32 +0000715 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000716 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000717 }
718
Chris Lattnerb28317a2009-03-28 19:18:32 +0000719 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000720 SourceLocation LParenLoc,
721 MultiExprArg Exprs,
722 SourceLocation *CommaLocs,
723 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000724 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000725 return;
726 }
727
Chris Lattnerb28317a2009-03-28 19:18:32 +0000728 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
729 DeclPtrTy Method)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000730 {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000731 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000732 }
733
Chris Lattnerb28317a2009-03-28 19:18:32 +0000734 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000735 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000736 }
737
738 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000739 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000740 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000741 }
742
Chris Lattnerb28317a2009-03-28 19:18:32 +0000743 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
744 ExprArg AssertExpr,
745 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000746 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000747 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000748 }
749
750 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
751 tok::TokenKind Kind,
752 SourceLocation LAngleBracketLoc,
753 TypeTy *Ty,
754 SourceLocation RAngleBracketLoc,
755 SourceLocation LParenLoc,
756 ExprArg Op,
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 ActOnCXXTypeid(SourceLocation OpLoc,
763 SourceLocation LParenLoc,
764 bool isType, void *TyOrExpr,
765 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000766 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000767 return ExprEmpty();
768 }
769
770 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000771 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000772 return ExprEmpty();
773 }
774
775 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
776 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000777 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000778 return ExprEmpty();
779 }
780
781 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000782 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000783 return ExprEmpty();
784 }
785
786 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
787 TypeTy *TypeRep,
788 SourceLocation LParenLoc,
789 MultiExprArg Exprs,
790 SourceLocation *CommaLocs,
791 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000792 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000793 return ExprEmpty();
794 }
795
796 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
797 SourceLocation StartLoc,
798 Declarator &D,
799 SourceLocation EqualLoc,
800 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000801 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000802 return ExprEmpty();
803 }
804
805 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
806 bool UseGlobal,
807 SourceLocation PlacementLParen,
808 MultiExprArg PlacementArgs,
809 SourceLocation PlacementRParen,
810 bool ParenTypeId, Declarator &D,
811 SourceLocation ConstructorLParen,
812 MultiExprArg ConstructorArgs,
813 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000814 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000815 return ExprEmpty();
816 }
817
818 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
819 bool UseGlobal, bool ArrayForm,
820 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000821 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000822 return ExprEmpty();
823 }
824
825 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
826 SourceLocation KWLoc,
827 SourceLocation LParen,
828 TypeTy *Ty,
829 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000830 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000831 return ExprEmpty();
832 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000833 };
834}
835
Eli Friedmanf54fce82009-05-19 01:02:07 +0000836MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
837 llvm::raw_ostream* OS) {
838 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000839}