blob: b032233b3d3ba40966829ee5743e36efcad52164 [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";
Mike Stump1eb44332009-09-09 15:08:12 +000042
Reid Spencer5f016e22007-07-11 17:01:13 +000043 // 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,
Douglas Gregor18df52b2010-01-16 15:02:53 +000068 const SourceLocation *ProtoLocs,
Chris Lattnerb28317a2009-03-28 19:18:32 +000069 SourceLocation EndProtoLoc,
70 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000071 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000072 return MinimalAction::ActOnStartClassInterface(AtInterfaceLoc,
Mike Stump1eb44332009-09-09 15:08:12 +000073 ClassName, ClassLoc,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000074 SuperName, SuperLoc,
75 ProtoRefs, NumProtocols,
Douglas Gregor18df52b2010-01-16 15:02:53 +000076 ProtoLocs, EndProtoLoc,
77 AttrList);
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000078 }
79
Mike Stump1eb44332009-09-09 15:08:12 +000080 /// ActOnForwardClassDeclaration -
81 /// Scope will always be top level file scope.
Chris Lattnerb28317a2009-03-28 19:18:32 +000082 Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
Mike Stump1eb44332009-09-09 15:08:12 +000083 IdentifierInfo **IdentList,
Ted Kremenekc09cba62009-11-17 23:12:20 +000084 SourceLocation *IdentLocs,
Chris Lattnerb28317a2009-03-28 19:18:32 +000085 unsigned NumElts) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000086 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000087 return MinimalAction::ActOnForwardClassDeclaration(AtClassLoc, IdentList,
Ted Kremenekc09cba62009-11-17 23:12:20 +000088 IdentLocs, NumElts);
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000089 }
90
91 // Pure Printing
92
93 /// ActOnParamDeclarator - This callback is invoked when a parameter
94 /// declarator is parsed. This callback only occurs for functions
95 /// with prototypes. S is the function prototype scope for the
96 /// parameters (C++ [basic.scope.proto]).
Chris Lattnerb28317a2009-03-28 19:18:32 +000097 virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000098 Out << __FUNCTION__ << " ";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000099 if (IdentifierInfo *II = D.getIdentifier()) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000100 Out << "'" << II->getName() << "'";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000101 } else {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000102 Out << "<anon>";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000103 }
Eli Friedmanf54fce82009-05-19 01:02:07 +0000104 Out << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000105 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000106 }
Mike Stump1eb44332009-09-09 15:08:12 +0000107
108 /// AddInitializerToDecl - This action is called immediately after
109 /// ParseDeclarator (when an initializer is present). The code is factored
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000110 /// this way to make sure we are able to handle the following:
111 /// void func() { int xx = xx; }
112 /// This allows ActOnDeclarator to register "xx" prior to parsing the
Mike Stump1eb44332009-09-09 15:08:12 +0000113 /// initializer. The declaration above should still result in a warning,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000114 /// since the reference to "xx" is uninitialized.
Anders Carlsson9abf2ae2009-08-16 05:13:48 +0000115 virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000116 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000117 }
118
Chris Lattner682bf922009-03-29 16:50:03 +0000119 /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed,
120 /// this gives the actions implementation a chance to process the group as
121 /// a whole.
Eli Friedmanc1dc6532009-05-29 01:49:24 +0000122 virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec& DS,
123 DeclPtrTy *Group,
Chris Lattner682bf922009-03-29 16:50:03 +0000124 unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000125 Out << __FUNCTION__ << "\n";
Chris Lattner682bf922009-03-29 16:50:03 +0000126 return DeclGroupPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000127 }
128
129 /// ActOnStartOfFunctionDef - This is called at the start of a function
130 /// definition, instead of calling ActOnDeclarator. The Declarator includes
131 /// information about formal arguments that are part of this function.
Chris Lattner682bf922009-03-29 16:50:03 +0000132 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope,
133 Declarator &D){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000134 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000135 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000136 }
137
138 /// ActOnStartOfFunctionDef - This is called at the start of a function
139 /// definition, after the FunctionDecl has already been created.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000140 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000141 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000142 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000143 }
144
Chris Lattnerb28317a2009-03-28 19:18:32 +0000145 virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000146 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000147 }
Mike Stump1eb44332009-09-09 15:08:12 +0000148
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000149 /// ActOnFunctionDefBody - This is called when a function body has completed
150 /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000151 virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000152 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000153 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000154 }
155
Chris Lattnerb28317a2009-03-28 19:18:32 +0000156 virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
157 ExprArg AsmString) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000158 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000159 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000160 }
Mike Stump1eb44332009-09-09 15:08:12 +0000161
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000162 /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
163 /// no declarator (e.g. "struct foo;") is parsed.
John McCallaec03712010-05-21 20:45:30 +0000164 virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
165 DeclSpec &DS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000166 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000167 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000168 }
Mike Stump1eb44332009-09-09 15:08:12 +0000169
Douglas Gregore79837a2008-12-17 01:46:43 +0000170 /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
171 /// contained braces. Lang/StrSize contains the language string that
172 /// was parsed at location Loc. Decls/NumDecls provides the
173 /// declarations parsed inside the linkage specification.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000174 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
175 SourceLocation LBrace,
176 SourceLocation RBrace, const char *Lang,
Mike Stump1eb44332009-09-09 15:08:12 +0000177 unsigned StrSize,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000178 DeclPtrTy *Decls, unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000179 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000180 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000181 }
Mike Stump1eb44332009-09-09 15:08:12 +0000182
Douglas Gregore79837a2008-12-17 01:46:43 +0000183 /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
184 /// braces. Lang/StrSize contains the language string that was
185 /// parsed at location Loc. D is the declaration parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000186 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
187 unsigned StrSize, DeclPtrTy D) {
188 return DeclPtrTy();
Douglas Gregore79837a2008-12-17 01:46:43 +0000189 }
Mike Stump1eb44332009-09-09 15:08:12 +0000190
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000191 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000192 // Type Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000193 //===------------------------------------------------------------------===//
Mike Stump1eb44332009-09-09 15:08:12 +0000194
Sebastian Redlcee63fb2008-12-02 14:43:59 +0000195 virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000196 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000197 return TypeResult();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000198 }
Mike Stump1eb44332009-09-09 15:08:12 +0000199
Daniel Dunbara4d32822009-09-11 06:34:14 +0000200 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
Jeffrey Yasskin9ab14542010-04-08 16:38:48 +0000201 SourceLocation KWLoc, CXXScopeSpec &SS,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000202 IdentifierInfo *Name, SourceLocation NameLoc,
Douglas Gregor402abb52009-05-28 23:31:59 +0000203 AttributeList *Attr, AccessSpecifier AS,
Daniel Dunbara4d32822009-09-11 06:34:14 +0000204 MultiTemplateParamsArg TemplateParameterLists,
205 bool &OwnedDecl, bool &IsDependent) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000206 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
207 // is (struct/union/enum/class).
Eli Friedmanf54fce82009-05-19 01:02:07 +0000208 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000209 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000210 }
Mike Stump1eb44332009-09-09 15:08:12 +0000211
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000212 /// Act on @defs() element found when parsing a structure. ClassName is the
Mike Stump1eb44332009-09-09 15:08:12 +0000213 /// name of the referenced class.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000214 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000215 IdentifierInfo *ClassName,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000216 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000217 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000218 }
219
Mike Stump1eb44332009-09-09 15:08:12 +0000220 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000221 SourceLocation DeclStart,
222 Declarator &D, ExprTy *BitfieldWidth) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000223 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000224 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000225 }
Mike Stump1eb44332009-09-09 15:08:12 +0000226
Chris Lattnerb28317a2009-03-28 19:18:32 +0000227 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
Fariborz Jahanian496b5a82009-06-05 18:16:35 +0000228 DeclPtrTy IntfDecl,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000229 Declarator &D, ExprTy *BitfieldWidth,
230 tok::ObjCKeywordKind visibility) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000231 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000232 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000233 }
Mike Stump1eb44332009-09-09 15:08:12 +0000234
Chris Lattnerb28317a2009-03-28 19:18:32 +0000235 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
Mike Stump1eb44332009-09-09 15:08:12 +0000236 DeclPtrTy *Fields, unsigned NumFields,
Daniel Dunbar1bfe1c22008-10-03 02:03:53 +0000237 SourceLocation LBrac, SourceLocation RBrac,
238 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000239 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000240 }
Mike Stump1eb44332009-09-09 15:08:12 +0000241
Chris Lattnerb28317a2009-03-28 19:18:32 +0000242 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
243 DeclPtrTy LastEnumConstant,
244 SourceLocation IdLoc,IdentifierInfo *Id,
245 SourceLocation EqualLoc, ExprTy *Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000246 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000247 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000248 }
249
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000250 virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
251 SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
Edward O'Callaghanfee13812009-08-08 14:36:57 +0000252 DeclPtrTy *Elements, unsigned NumElements,
253 Scope *S, AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000254 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000255 }
256
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000257 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000258 // Statement Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000259 //===------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000260
261 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000262 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000263 return StmtEmpty();
264 }
265
266 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
267 SourceLocation R,
268 MultiStmtArg Elts,
269 bool isStmtExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000270 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000271 return StmtEmpty();
272 }
Chris Lattner682bf922009-03-29 16:50:03 +0000273 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000274 SourceLocation StartLoc,
275 SourceLocation EndLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000276 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000277 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000278 }
Mike Stump1eb44332009-09-09 15:08:12 +0000279
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000280 virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000281 Out << __FUNCTION__ << "\n";
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000282 return OwningStmtResult(*this, Expr->release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000283 }
Mike Stump1eb44332009-09-09 15:08:12 +0000284
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000285 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
286 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000287 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
288 ExprArg LHSVal,
289 SourceLocation DotDotDotLoc,
290 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000291 SourceLocation ColonLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000292 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000293 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000294 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000295 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
296 SourceLocation ColonLoc,
297 StmtArg SubStmt, Scope *CurScope){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000298 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000299 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000300 }
Sebastian Redlde307472009-01-11 00:38:46 +0000301
302 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
303 IdentifierInfo *II,
304 SourceLocation ColonLoc,
305 StmtArg SubStmt) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000306 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000307 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000308 }
Sebastian Redlde307472009-01-11 00:38:46 +0000309
Mike Stump1eb44332009-09-09 15:08:12 +0000310 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000311 FullExprArg CondVal, DeclPtrTy CondVar,
312 StmtArg ThenVal,
Anders Carlssona99fad82009-05-17 18:26:53 +0000313 SourceLocation ElseLoc,
Sebastian Redlde307472009-01-11 00:38:46 +0000314 StmtArg ElseVal) {
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
Douglas Gregor586596f2010-05-06 17:25:47 +0000319 virtual OwningStmtResult ActOnStartOfSwitchStmt(SourceLocation SwitchLoc,
320 ExprArg Cond,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000321 DeclPtrTy CondVar) {
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 }
Sebastian Redlde307472009-01-11 00:38:46 +0000325
326 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
327 StmtArg Switch,
328 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000329 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000330 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000331 }
332
Sebastian Redlf05b1522009-01-16 23:28:06 +0000333 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000334 FullExprArg Cond, DeclPtrTy CondVar,
335 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000336 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000337 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000338 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000339 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
Mike Stump1eb44332009-09-09 15:08:12 +0000340 SourceLocation WhileLoc,
Chris Lattner98913592009-06-12 23:04:47 +0000341 SourceLocation LPLoc, ExprArg Cond,
342 SourceLocation RPLoc){
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 ActOnForStmt(SourceLocation ForLoc,
347 SourceLocation LParenLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000348 StmtArg First, FullExprArg Second,
349 DeclPtrTy SecondVar,
350 FullExprArg Third,
351 SourceLocation RParenLoc,
Sebastian Redlf05b1522009-01-16 23:28:06 +0000352 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000353 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000354 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000355 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000356 virtual OwningStmtResult ActOnObjCForCollectionStmt(
357 SourceLocation ForColLoc,
358 SourceLocation LParenLoc,
359 StmtArg First, ExprArg Second,
360 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000361 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000362 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000363 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000364 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
365 SourceLocation LabelLoc,
366 IdentifierInfo *LabelII) {
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 ActOnIndirectGotoStmt(SourceLocation GotoLoc,
371 SourceLocation StarLoc,
372 ExprArg DestExp) {
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 ActOnContinueStmt(SourceLocation ContinueLoc,
377 Scope *CurScope) {
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 Redl4cffe2f2009-01-18 13:19:59 +0000381 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
382 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000383 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000384 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000385 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000386 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
Anders Carlssonf53b4432009-08-18 16:11:00 +0000387 ExprArg RetValExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000388 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000389 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000390 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000391 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000392 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000393 bool IsVolatile,
394 unsigned NumOutputs,
395 unsigned NumInputs,
Anders Carlssonff93dbd2010-01-30 22:25:16 +0000396 IdentifierInfo **Names,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000397 MultiExprArg Constraints,
398 MultiExprArg Exprs,
399 ExprArg AsmString,
400 MultiExprArg Clobbers,
Mike Stumpc9a82a72010-01-05 00:29:29 +0000401 SourceLocation RParenLoc,
402 bool MSAsm) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000403 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000404 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000405 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000406
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000407 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000408 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
409 SourceLocation RParen,
Benjamin Kramerd9d3a1c2010-04-24 08:26:17 +0000410 DeclPtrTy Parm,
411 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000412 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000413 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000414 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000415
416 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
417 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000418 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000419 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000420 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000421
422 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
Benjamin Kramerd9d3a1c2010-04-24 08:26:17 +0000423 StmtArg Try,
424 MultiStmtArg CatchStmts,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000425 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000426 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000427 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000428 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000429
430 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000431 ExprArg Throw,
432 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000433 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000434 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000435 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000436
437 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
438 ExprArg SynchExpr,
439 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000440 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000441 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000442 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000443
444 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000445 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000446 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000447 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000448 }
449
450 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000451 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000452 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000453 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000454 return StmtEmpty();
455 }
456
457 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
458 StmtArg TryBlock,
459 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000460 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000461 return StmtEmpty();
462 }
463
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000464 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000465 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000466 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000467
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000468 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000469
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000470 /// ActOnIdentifierExpr - Parse an identifier in expression context.
471 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
472 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000473 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
474 IdentifierInfo &II,
475 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000476 const CXXScopeSpec *SS,
477 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000478 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000479 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000480 }
481
Sebastian Redlcd965b92009-01-18 18:53:16 +0000482 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
483 Scope *S, SourceLocation OperatorLoc,
484 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000485 bool HasTrailingLParen, const CXXScopeSpec &SS,
486 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000487 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000488 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000489 }
490
Sebastian Redlcd965b92009-01-18 18:53:16 +0000491 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
492 Scope *S, SourceLocation OperatorLoc,
493 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000494 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000495 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000496 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000497 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000498
499 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
500 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000501 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000502 return ExprEmpty();
503 }
504
Mike Stump1eb44332009-09-09 15:08:12 +0000505 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000506 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000507 return ExprEmpty();
508 }
509
Mike Stump1eb44332009-09-09 15:08:12 +0000510 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000511 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000512 return ExprEmpty();
513 }
514
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000515 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
516 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000517 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
518 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000519 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000520 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000521 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000522
523 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
524 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000525 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000526 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000527 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000528
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000529 // Postfix Expressions.
Mike Stump1eb44332009-09-09 15:08:12 +0000530 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
Sebastian Redl0eb23302009-01-19 00:08:26 +0000531 tok::TokenKind Kind,
532 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000533 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000534 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000535 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000536 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
537 SourceLocation LLoc,
538 ExprArg Idx,
539 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000540 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000541 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000542 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000543 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
544 SourceLocation OpLoc,
545 tok::TokenKind OpKind,
546 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000547 IdentifierInfo &Member,
Douglas Gregorfe85ced2009-08-06 03:17:00 +0000548 DeclPtrTy ImplDecl,
549 const CXXScopeSpec *SS=0) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000550 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000551 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000552 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000553
554 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
555 SourceLocation LParenLoc,
556 MultiExprArg Args,
557 SourceLocation *CommaLocs,
558 SourceLocation RParenLoc) {
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 Redl0eb23302009-01-19 00:08:26 +0000562
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000563 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000564 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
565 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000566 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000567 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000568 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000569 virtual OwningExprResult
570 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
571 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000572 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000573 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000574 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000575
576 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
577 TypeTy *Ty,
578 SourceLocation RParen,
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 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
584 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000585 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000586 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000587 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000588 }
Mike Stump1eb44332009-09-09 15:08:12 +0000589 virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
Nate Begeman2ef13e52009-08-10 23:49:36 +0000590 TypeTy *Ty, SourceLocation RParenLoc,
591 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000592 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000593 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000594 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000595
596 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
597 tok::TokenKind Kind,
598 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000599 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000600 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000601 }
602
603 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
604 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000605 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
606 SourceLocation ColonLoc,
607 ExprArg Cond, ExprArg LHS,
608 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000609 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000610 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000611 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000612
613 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000614
Sebastian Redlf53597f2009-03-15 17:47:39 +0000615 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
616 SourceLocation LabLoc,
617 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000618 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000619 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000620 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000621
622 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
623 StmtArg SubStmt,
624 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000625 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000626 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000627 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000628
629 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
630 SourceLocation BuiltinLoc,
631 SourceLocation TypeLoc,
632 TypeTy *Arg1,
633 OffsetOfComponent *CompPtr,
634 unsigned NumComponents,
635 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000636 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000637 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000638 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000639
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000640 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000641 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
642 TypeTy *arg1,TypeTy *arg2,
643 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000644 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000645 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000646 }
647 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000648 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
649 ExprArg cond, ExprArg expr1,
650 ExprArg expr2,
651 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000652 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000653 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000654 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000655
656 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000657 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
658 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000659 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000660 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000661 return ExprEmpty();
662 }
663
664 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000665 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000666 return ExprEmpty();
667 }
668
669 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000670 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000671 }
672
673 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000674 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000675 }
676
677 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000678 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000679 }
680
681 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
682 StmtArg Body,
683 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000684 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000685 return ExprEmpty();
686 }
687
Chris Lattnerb28317a2009-03-28 19:18:32 +0000688 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
689 IdentifierInfo *Ident,
Anders Carlsson2a3503d2010-02-07 01:09:23 +0000690 SourceLocation LBrace,
691 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000692 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000693 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000694 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000695
Chris Lattnerb28317a2009-03-28 19:18:32 +0000696 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000697 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000698 return;
699 }
700
701#if 0
702 // FIXME: AttrList should be deleted by this function, but the definition
703 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000704 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
705 SourceLocation UsingLoc,
706 SourceLocation NamespcLoc,
707 const CXXScopeSpec &SS,
708 SourceLocation IdentLoc,
709 IdentifierInfo *NamespcName,
710 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000711 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000712 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000713 }
714#endif
715
Chris Lattnerb28317a2009-03-28 19:18:32 +0000716 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000717 SourceLocation EqualLoc,
718 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000719 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000720 }
721
Chris Lattnerb28317a2009-03-28 19:18:32 +0000722 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Anders Carlsson5e300d12009-06-12 16:51:40 +0000723 SourceLocation EqualLoc,
724 SourceLocation ArgLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000725 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000726 }
727
Chris Lattnerb28317a2009-03-28 19:18:32 +0000728 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
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 AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000733 SourceLocation LParenLoc,
734 MultiExprArg Exprs,
735 SourceLocation *CommaLocs,
736 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000737 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000738 return;
739 }
740
Chris Lattnerb28317a2009-03-28 19:18:32 +0000741 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
Mike Stump1eb44332009-09-09 15:08:12 +0000742 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000743 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000744 }
745
Chris Lattnerb28317a2009-03-28 19:18:32 +0000746 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000747 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000748 }
749
750 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000751 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000752 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000753 }
754
Chris Lattnerb28317a2009-03-28 19:18:32 +0000755 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
756 ExprArg AssertExpr,
757 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000758 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000759 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000760 }
761
762 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
763 tok::TokenKind Kind,
764 SourceLocation LAngleBracketLoc,
765 TypeTy *Ty,
766 SourceLocation RAngleBracketLoc,
767 SourceLocation LParenLoc,
768 ExprArg Op,
769 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000770 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000771 return ExprEmpty();
772 }
773
774 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
775 SourceLocation LParenLoc,
776 bool isType, void *TyOrExpr,
777 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000778 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000779 return ExprEmpty();
780 }
781
782 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000783 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000784 return ExprEmpty();
785 }
786
787 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
788 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000789 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000790 return ExprEmpty();
791 }
792
793 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000794 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000795 return ExprEmpty();
796 }
797
798 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
799 TypeTy *TypeRep,
800 SourceLocation LParenLoc,
801 MultiExprArg Exprs,
802 SourceLocation *CommaLocs,
803 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000804 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000805 return ExprEmpty();
806 }
807
808 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
809 SourceLocation StartLoc,
810 Declarator &D,
811 SourceLocation EqualLoc,
812 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000813 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000814 return ExprEmpty();
815 }
816
817 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
818 bool UseGlobal,
819 SourceLocation PlacementLParen,
820 MultiExprArg PlacementArgs,
821 SourceLocation PlacementRParen,
822 bool ParenTypeId, Declarator &D,
823 SourceLocation ConstructorLParen,
824 MultiExprArg ConstructorArgs,
825 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000826 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000827 return ExprEmpty();
828 }
829
830 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
831 bool UseGlobal, bool ArrayForm,
832 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000833 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000834 return ExprEmpty();
835 }
836
837 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
838 SourceLocation KWLoc,
839 SourceLocation LParen,
840 TypeTy *Ty,
841 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000842 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000843 return ExprEmpty();
844 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000845 };
846}
847
Eli Friedmanf54fce82009-05-19 01:02:07 +0000848MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
849 llvm::raw_ostream* OS) {
850 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000851}