blob: 4df5c5263c7eedd99294652346ce1796b691a0ba [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.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000164 virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000165 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000166 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000167 }
Mike Stump1eb44332009-09-09 15:08:12 +0000168
Douglas Gregore79837a2008-12-17 01:46:43 +0000169 /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
170 /// contained braces. Lang/StrSize contains the language string that
171 /// was parsed at location Loc. Decls/NumDecls provides the
172 /// declarations parsed inside the linkage specification.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000173 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
174 SourceLocation LBrace,
175 SourceLocation RBrace, const char *Lang,
Mike Stump1eb44332009-09-09 15:08:12 +0000176 unsigned StrSize,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000177 DeclPtrTy *Decls, unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000178 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000179 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000180 }
Mike Stump1eb44332009-09-09 15:08:12 +0000181
Douglas Gregore79837a2008-12-17 01:46:43 +0000182 /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
183 /// braces. Lang/StrSize contains the language string that was
184 /// parsed at location Loc. D is the declaration parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000185 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
186 unsigned StrSize, DeclPtrTy D) {
187 return DeclPtrTy();
Douglas Gregore79837a2008-12-17 01:46:43 +0000188 }
Mike Stump1eb44332009-09-09 15:08:12 +0000189
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000190 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000191 // Type Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000192 //===------------------------------------------------------------------===//
Mike Stump1eb44332009-09-09 15:08:12 +0000193
Sebastian Redlcee63fb2008-12-02 14:43:59 +0000194 virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000195 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000196 return TypeResult();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000197 }
Mike Stump1eb44332009-09-09 15:08:12 +0000198
Daniel Dunbara4d32822009-09-11 06:34:14 +0000199 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
Jeffrey Yasskin9ab14542010-04-08 16:38:48 +0000200 SourceLocation KWLoc, CXXScopeSpec &SS,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000201 IdentifierInfo *Name, SourceLocation NameLoc,
Douglas Gregor402abb52009-05-28 23:31:59 +0000202 AttributeList *Attr, AccessSpecifier AS,
Daniel Dunbara4d32822009-09-11 06:34:14 +0000203 MultiTemplateParamsArg TemplateParameterLists,
204 bool &OwnedDecl, bool &IsDependent) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000205 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
206 // is (struct/union/enum/class).
Eli Friedmanf54fce82009-05-19 01:02:07 +0000207 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000208 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000209 }
Mike Stump1eb44332009-09-09 15:08:12 +0000210
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000211 /// Act on @defs() element found when parsing a structure. ClassName is the
Mike Stump1eb44332009-09-09 15:08:12 +0000212 /// name of the referenced class.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000213 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000214 IdentifierInfo *ClassName,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000215 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000216 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000217 }
218
Mike Stump1eb44332009-09-09 15:08:12 +0000219 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000220 SourceLocation DeclStart,
221 Declarator &D, ExprTy *BitfieldWidth) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000222 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000223 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000224 }
Mike Stump1eb44332009-09-09 15:08:12 +0000225
Chris Lattnerb28317a2009-03-28 19:18:32 +0000226 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
Fariborz Jahanian496b5a82009-06-05 18:16:35 +0000227 DeclPtrTy IntfDecl,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000228 Declarator &D, ExprTy *BitfieldWidth,
229 tok::ObjCKeywordKind visibility) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000230 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000231 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000232 }
Mike Stump1eb44332009-09-09 15:08:12 +0000233
Chris Lattnerb28317a2009-03-28 19:18:32 +0000234 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
Mike Stump1eb44332009-09-09 15:08:12 +0000235 DeclPtrTy *Fields, unsigned NumFields,
Daniel Dunbar1bfe1c22008-10-03 02:03:53 +0000236 SourceLocation LBrac, SourceLocation RBrac,
237 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000238 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000239 }
Mike Stump1eb44332009-09-09 15:08:12 +0000240
Chris Lattnerb28317a2009-03-28 19:18:32 +0000241 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
242 DeclPtrTy LastEnumConstant,
243 SourceLocation IdLoc,IdentifierInfo *Id,
244 SourceLocation EqualLoc, ExprTy *Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000245 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000246 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000247 }
248
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000249 virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
250 SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
Edward O'Callaghanfee13812009-08-08 14:36:57 +0000251 DeclPtrTy *Elements, unsigned NumElements,
252 Scope *S, AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000253 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000254 }
255
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000256 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000257 // Statement Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000258 //===------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000259
260 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000261 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000262 return StmtEmpty();
263 }
264
265 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
266 SourceLocation R,
267 MultiStmtArg Elts,
268 bool isStmtExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000269 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000270 return StmtEmpty();
271 }
Chris Lattner682bf922009-03-29 16:50:03 +0000272 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000273 SourceLocation StartLoc,
274 SourceLocation EndLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000275 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000276 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000277 }
Mike Stump1eb44332009-09-09 15:08:12 +0000278
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000279 virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000280 Out << __FUNCTION__ << "\n";
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000281 return OwningStmtResult(*this, Expr->release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000282 }
Mike Stump1eb44332009-09-09 15:08:12 +0000283
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000284 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
285 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000286 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
287 ExprArg LHSVal,
288 SourceLocation DotDotDotLoc,
289 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000290 SourceLocation ColonLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000291 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000292 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000293 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000294 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
295 SourceLocation ColonLoc,
296 StmtArg SubStmt, Scope *CurScope){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000297 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000298 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000299 }
Sebastian Redlde307472009-01-11 00:38:46 +0000300
301 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
302 IdentifierInfo *II,
303 SourceLocation ColonLoc,
304 StmtArg SubStmt) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000305 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000306 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000307 }
Sebastian Redlde307472009-01-11 00:38:46 +0000308
Mike Stump1eb44332009-09-09 15:08:12 +0000309 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000310 FullExprArg CondVal, DeclPtrTy CondVar,
311 StmtArg ThenVal,
Anders Carlssona99fad82009-05-17 18:26:53 +0000312 SourceLocation ElseLoc,
Sebastian Redlde307472009-01-11 00:38:46 +0000313 StmtArg ElseVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000314 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000315 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000316 }
Sebastian Redlde307472009-01-11 00:38:46 +0000317
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000318 virtual OwningStmtResult ActOnStartOfSwitchStmt(FullExprArg Cond,
319 DeclPtrTy CondVar) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000320 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000321 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000322 }
Sebastian Redlde307472009-01-11 00:38:46 +0000323
324 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
325 StmtArg Switch,
326 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000327 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000328 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000329 }
330
Sebastian Redlf05b1522009-01-16 23:28:06 +0000331 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000332 FullExprArg Cond, DeclPtrTy CondVar,
333 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000334 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000335 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000336 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000337 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
Mike Stump1eb44332009-09-09 15:08:12 +0000338 SourceLocation WhileLoc,
Chris Lattner98913592009-06-12 23:04:47 +0000339 SourceLocation LPLoc, ExprArg Cond,
340 SourceLocation RPLoc){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000341 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000342 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000343 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000344 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
345 SourceLocation LParenLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000346 StmtArg First, FullExprArg Second,
347 DeclPtrTy SecondVar,
348 FullExprArg Third,
349 SourceLocation RParenLoc,
Sebastian Redlf05b1522009-01-16 23:28:06 +0000350 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 Redlf05b1522009-01-16 23:28:06 +0000354 virtual OwningStmtResult ActOnObjCForCollectionStmt(
355 SourceLocation ForColLoc,
356 SourceLocation LParenLoc,
357 StmtArg First, ExprArg Second,
358 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000359 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000360 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000361 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000362 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
363 SourceLocation LabelLoc,
364 IdentifierInfo *LabelII) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000365 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000366 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000367 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000368 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
369 SourceLocation StarLoc,
370 ExprArg DestExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000371 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000372 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000373 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000374 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
375 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000376 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000377 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000378 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000379 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
380 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000381 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000382 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000383 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000384 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
Anders Carlssonf53b4432009-08-18 16:11:00 +0000385 ExprArg RetValExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000386 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000387 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000388 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000389 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000390 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000391 bool IsVolatile,
392 unsigned NumOutputs,
393 unsigned NumInputs,
Anders Carlssonff93dbd2010-01-30 22:25:16 +0000394 IdentifierInfo **Names,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000395 MultiExprArg Constraints,
396 MultiExprArg Exprs,
397 ExprArg AsmString,
398 MultiExprArg Clobbers,
Mike Stumpc9a82a72010-01-05 00:29:29 +0000399 SourceLocation RParenLoc,
400 bool MSAsm) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000401 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000402 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000403 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000404
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000405 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000406 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
407 SourceLocation RParen,
Benjamin Kramerd9d3a1c2010-04-24 08:26:17 +0000408 DeclPtrTy Parm,
409 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000410 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000411 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000412 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000413
414 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
415 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000416 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000417 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000418 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000419
420 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
Benjamin Kramerd9d3a1c2010-04-24 08:26:17 +0000421 StmtArg Try,
422 MultiStmtArg CatchStmts,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000423 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000424 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000425 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000426 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000427
428 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000429 ExprArg Throw,
430 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000431 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000432 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000433 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000434
435 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
436 ExprArg SynchExpr,
437 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000438 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000439 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000440 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000441
442 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000443 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000444 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000445 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000446 }
447
448 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000449 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000450 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000451 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000452 return StmtEmpty();
453 }
454
455 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
456 StmtArg TryBlock,
457 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000458 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000459 return StmtEmpty();
460 }
461
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000462 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000463 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000464 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000465
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000466 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000467
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000468 /// ActOnIdentifierExpr - Parse an identifier in expression context.
469 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
470 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000471 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
472 IdentifierInfo &II,
473 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000474 const CXXScopeSpec *SS,
475 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000476 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000477 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000478 }
479
Sebastian Redlcd965b92009-01-18 18:53:16 +0000480 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
481 Scope *S, SourceLocation OperatorLoc,
482 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000483 bool HasTrailingLParen, const CXXScopeSpec &SS,
484 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000485 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000486 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000487 }
488
Sebastian Redlcd965b92009-01-18 18:53:16 +0000489 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
490 Scope *S, SourceLocation OperatorLoc,
491 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000492 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000493 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000494 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000495 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000496
497 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
498 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000499 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000500 return ExprEmpty();
501 }
502
Mike Stump1eb44332009-09-09 15:08:12 +0000503 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000504 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000505 return ExprEmpty();
506 }
507
Mike Stump1eb44332009-09-09 15:08:12 +0000508 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000509 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000510 return ExprEmpty();
511 }
512
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000513 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
514 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000515 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
516 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000517 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000518 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000519 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000520
521 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
522 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000523 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000524 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000525 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000526
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000527 // Postfix Expressions.
Mike Stump1eb44332009-09-09 15:08:12 +0000528 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
Sebastian Redl0eb23302009-01-19 00:08:26 +0000529 tok::TokenKind Kind,
530 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000531 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000532 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000533 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000534 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
535 SourceLocation LLoc,
536 ExprArg Idx,
537 SourceLocation RLoc) {
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 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
542 SourceLocation OpLoc,
543 tok::TokenKind OpKind,
544 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000545 IdentifierInfo &Member,
Douglas Gregorfe85ced2009-08-06 03:17:00 +0000546 DeclPtrTy ImplDecl,
547 const CXXScopeSpec *SS=0) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000548 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000549 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000550 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000551
552 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
553 SourceLocation LParenLoc,
554 MultiExprArg Args,
555 SourceLocation *CommaLocs,
556 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000557 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000558 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000559 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000560
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000561 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000562 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
563 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000564 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000565 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000566 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000567 virtual OwningExprResult
568 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
569 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000570 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000571 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000572 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000573
574 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
575 TypeTy *Ty,
576 SourceLocation RParen,
577 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000578 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000579 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000580 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000581 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
582 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000583 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000584 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000585 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000586 }
Mike Stump1eb44332009-09-09 15:08:12 +0000587 virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
Nate Begeman2ef13e52009-08-10 23:49:36 +0000588 TypeTy *Ty, SourceLocation RParenLoc,
589 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000590 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000591 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000592 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000593
594 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
595 tok::TokenKind Kind,
596 ExprArg LHS, 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 }
600
601 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
602 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000603 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
604 SourceLocation ColonLoc,
605 ExprArg Cond, ExprArg LHS,
606 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000607 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000608 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000609 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000610
611 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000612
Sebastian Redlf53597f2009-03-15 17:47:39 +0000613 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
614 SourceLocation LabLoc,
615 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000616 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000617 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000618 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000619
620 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
621 StmtArg SubStmt,
622 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000623 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000624 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000625 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000626
627 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
628 SourceLocation BuiltinLoc,
629 SourceLocation TypeLoc,
630 TypeTy *Arg1,
631 OffsetOfComponent *CompPtr,
632 unsigned NumComponents,
633 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000634 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000635 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000636 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000637
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000638 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000639 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
640 TypeTy *arg1,TypeTy *arg2,
641 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000642 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000643 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000644 }
645 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000646 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
647 ExprArg cond, ExprArg expr1,
648 ExprArg expr2,
649 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000650 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000651 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000652 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000653
654 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000655 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
656 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000657 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000658 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000659 return ExprEmpty();
660 }
661
662 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000663 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000664 return ExprEmpty();
665 }
666
667 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000668 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000669 }
670
671 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000672 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000673 }
674
675 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000676 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000677 }
678
679 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
680 StmtArg Body,
681 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000682 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000683 return ExprEmpty();
684 }
685
Chris Lattnerb28317a2009-03-28 19:18:32 +0000686 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
687 IdentifierInfo *Ident,
Anders Carlsson2a3503d2010-02-07 01:09:23 +0000688 SourceLocation LBrace,
689 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000690 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000691 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000692 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000693
Chris Lattnerb28317a2009-03-28 19:18:32 +0000694 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000695 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000696 return;
697 }
698
699#if 0
700 // FIXME: AttrList should be deleted by this function, but the definition
701 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000702 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
703 SourceLocation UsingLoc,
704 SourceLocation NamespcLoc,
705 const CXXScopeSpec &SS,
706 SourceLocation IdentLoc,
707 IdentifierInfo *NamespcName,
708 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000709 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000710 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000711 }
712#endif
713
Chris Lattnerb28317a2009-03-28 19:18:32 +0000714 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000715 SourceLocation EqualLoc,
716 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000717 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000718 }
719
Chris Lattnerb28317a2009-03-28 19:18:32 +0000720 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Anders Carlsson5e300d12009-06-12 16:51:40 +0000721 SourceLocation EqualLoc,
722 SourceLocation ArgLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000723 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000724 }
725
Chris Lattnerb28317a2009-03-28 19:18:32 +0000726 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000727 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000728 }
729
Chris Lattnerb28317a2009-03-28 19:18:32 +0000730 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000731 SourceLocation LParenLoc,
732 MultiExprArg Exprs,
733 SourceLocation *CommaLocs,
734 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000735 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000736 return;
737 }
738
Chris Lattnerb28317a2009-03-28 19:18:32 +0000739 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
Mike Stump1eb44332009-09-09 15:08:12 +0000740 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000741 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000742 }
743
Chris Lattnerb28317a2009-03-28 19:18:32 +0000744 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000745 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000746 }
747
748 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000749 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000750 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000751 }
752
Chris Lattnerb28317a2009-03-28 19:18:32 +0000753 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
754 ExprArg AssertExpr,
755 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000756 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000757 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000758 }
759
760 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
761 tok::TokenKind Kind,
762 SourceLocation LAngleBracketLoc,
763 TypeTy *Ty,
764 SourceLocation RAngleBracketLoc,
765 SourceLocation LParenLoc,
766 ExprArg Op,
767 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000768 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000769 return ExprEmpty();
770 }
771
772 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
773 SourceLocation LParenLoc,
774 bool isType, void *TyOrExpr,
775 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000776 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000777 return ExprEmpty();
778 }
779
780 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000781 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000782 return ExprEmpty();
783 }
784
785 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
786 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000787 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000788 return ExprEmpty();
789 }
790
791 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
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 ActOnCXXTypeConstructExpr(SourceRange TypeRange,
797 TypeTy *TypeRep,
798 SourceLocation LParenLoc,
799 MultiExprArg Exprs,
800 SourceLocation *CommaLocs,
801 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000802 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000803 return ExprEmpty();
804 }
805
806 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
807 SourceLocation StartLoc,
808 Declarator &D,
809 SourceLocation EqualLoc,
810 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000811 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000812 return ExprEmpty();
813 }
814
815 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
816 bool UseGlobal,
817 SourceLocation PlacementLParen,
818 MultiExprArg PlacementArgs,
819 SourceLocation PlacementRParen,
820 bool ParenTypeId, Declarator &D,
821 SourceLocation ConstructorLParen,
822 MultiExprArg ConstructorArgs,
823 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000824 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000825 return ExprEmpty();
826 }
827
828 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
829 bool UseGlobal, bool ArrayForm,
830 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000831 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000832 return ExprEmpty();
833 }
834
835 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
836 SourceLocation KWLoc,
837 SourceLocation LParen,
838 TypeTy *Ty,
839 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000840 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000841 return ExprEmpty();
842 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000843 };
844}
845
Eli Friedmanf54fce82009-05-19 01:02:07 +0000846MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
847 llvm::raw_ostream* OS) {
848 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000849}