blob: a91dd8d55e9212ebbc375e1ee550158ad6c2be22 [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,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000200 SourceLocation KWLoc, const CXXScopeSpec &SS,
201 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,
394 std::string *Names,
395 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,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000408 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000409 StmtArg CatchList) {
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,
421 StmtArg Try, StmtArg Catch,
422 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000423 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000424 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000425 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000426
427 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000428 ExprArg Throw,
429 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000430 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000431 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000432 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000433
434 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
435 ExprArg SynchExpr,
436 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000437 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000438 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000439 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000440
441 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000442 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000443 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000444 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000445 }
446
447 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000448 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000449 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000450 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000451 return StmtEmpty();
452 }
453
454 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
455 StmtArg TryBlock,
456 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000457 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000458 return StmtEmpty();
459 }
460
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000461 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000462 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000463 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000464
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000465 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000466
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000467 /// ActOnIdentifierExpr - Parse an identifier in expression context.
468 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
469 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000470 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
471 IdentifierInfo &II,
472 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000473 const CXXScopeSpec *SS,
474 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000475 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000476 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000477 }
478
Sebastian Redlcd965b92009-01-18 18:53:16 +0000479 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
480 Scope *S, SourceLocation OperatorLoc,
481 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000482 bool HasTrailingLParen, const CXXScopeSpec &SS,
483 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000484 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000485 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000486 }
487
Sebastian Redlcd965b92009-01-18 18:53:16 +0000488 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
489 Scope *S, SourceLocation OperatorLoc,
490 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000491 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000492 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000493 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000494 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000495
496 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
497 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000498 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000499 return ExprEmpty();
500 }
501
Mike Stump1eb44332009-09-09 15:08:12 +0000502 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000503 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000504 return ExprEmpty();
505 }
506
Mike Stump1eb44332009-09-09 15:08:12 +0000507 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000508 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000509 return ExprEmpty();
510 }
511
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000512 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
513 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000514 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
515 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000516 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000517 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000518 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000519
520 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
521 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000522 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000523 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000524 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000525
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000526 // Postfix Expressions.
Mike Stump1eb44332009-09-09 15:08:12 +0000527 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
Sebastian Redl0eb23302009-01-19 00:08:26 +0000528 tok::TokenKind Kind,
529 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000530 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000531 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000532 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000533 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
534 SourceLocation LLoc,
535 ExprArg Idx,
536 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000537 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000538 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000539 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000540 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
541 SourceLocation OpLoc,
542 tok::TokenKind OpKind,
543 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000544 IdentifierInfo &Member,
Douglas Gregorfe85ced2009-08-06 03:17:00 +0000545 DeclPtrTy ImplDecl,
546 const CXXScopeSpec *SS=0) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000547 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000548 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000549 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000550
551 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
552 SourceLocation LParenLoc,
553 MultiExprArg Args,
554 SourceLocation *CommaLocs,
555 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000556 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000557 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000558 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000559
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000560 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000561 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
562 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000563 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000564 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000565 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000566 virtual OwningExprResult
567 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
568 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000569 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000570 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000571 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000572
573 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
574 TypeTy *Ty,
575 SourceLocation RParen,
576 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000577 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000578 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000579 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000580 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
581 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000582 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000583 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000584 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000585 }
Mike Stump1eb44332009-09-09 15:08:12 +0000586 virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
Nate Begeman2ef13e52009-08-10 23:49:36 +0000587 TypeTy *Ty, SourceLocation RParenLoc,
588 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000589 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000590 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000591 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000592
593 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
594 tok::TokenKind Kind,
595 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000596 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000597 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000598 }
599
600 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
601 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000602 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
603 SourceLocation ColonLoc,
604 ExprArg Cond, ExprArg LHS,
605 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000606 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000607 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000608 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000609
610 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000611
Sebastian Redlf53597f2009-03-15 17:47:39 +0000612 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
613 SourceLocation LabLoc,
614 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000615 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000616 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000617 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000618
619 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
620 StmtArg SubStmt,
621 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000622 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000623 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000624 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000625
626 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
627 SourceLocation BuiltinLoc,
628 SourceLocation TypeLoc,
629 TypeTy *Arg1,
630 OffsetOfComponent *CompPtr,
631 unsigned NumComponents,
632 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000633 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000634 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000635 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000636
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000637 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000638 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
639 TypeTy *arg1,TypeTy *arg2,
640 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000641 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000642 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000643 }
644 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000645 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
646 ExprArg cond, ExprArg expr1,
647 ExprArg expr2,
648 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000649 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000650 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000651 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000652
653 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000654 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
655 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000656 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000657 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000658 return ExprEmpty();
659 }
660
661 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000662 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000663 return ExprEmpty();
664 }
665
666 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000667 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000668 }
669
670 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000671 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000672 }
673
674 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000675 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000676 }
677
678 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
679 StmtArg Body,
680 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000681 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000682 return ExprEmpty();
683 }
684
Chris Lattnerb28317a2009-03-28 19:18:32 +0000685 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
686 IdentifierInfo *Ident,
687 SourceLocation LBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000688 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000689 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000690 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000691
Chris Lattnerb28317a2009-03-28 19:18:32 +0000692 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000693 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000694 return;
695 }
696
697#if 0
698 // FIXME: AttrList should be deleted by this function, but the definition
699 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000700 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
701 SourceLocation UsingLoc,
702 SourceLocation NamespcLoc,
703 const CXXScopeSpec &SS,
704 SourceLocation IdentLoc,
705 IdentifierInfo *NamespcName,
706 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000707 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000708 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000709 }
710#endif
711
Chris Lattnerb28317a2009-03-28 19:18:32 +0000712 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000713 SourceLocation EqualLoc,
714 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000715 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000716 }
717
Chris Lattnerb28317a2009-03-28 19:18:32 +0000718 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Anders Carlsson5e300d12009-06-12 16:51:40 +0000719 SourceLocation EqualLoc,
720 SourceLocation ArgLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000721 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000722 }
723
Chris Lattnerb28317a2009-03-28 19:18:32 +0000724 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
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 AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000729 SourceLocation LParenLoc,
730 MultiExprArg Exprs,
731 SourceLocation *CommaLocs,
732 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000733 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000734 return;
735 }
736
Chris Lattnerb28317a2009-03-28 19:18:32 +0000737 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
Mike Stump1eb44332009-09-09 15:08:12 +0000738 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000739 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000740 }
741
Chris Lattnerb28317a2009-03-28 19:18:32 +0000742 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000743 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000744 }
745
746 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000747 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000748 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000749 }
750
Chris Lattnerb28317a2009-03-28 19:18:32 +0000751 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
752 ExprArg AssertExpr,
753 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000754 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000755 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000756 }
757
758 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
759 tok::TokenKind Kind,
760 SourceLocation LAngleBracketLoc,
761 TypeTy *Ty,
762 SourceLocation RAngleBracketLoc,
763 SourceLocation LParenLoc,
764 ExprArg Op,
765 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000766 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000767 return ExprEmpty();
768 }
769
770 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
771 SourceLocation LParenLoc,
772 bool isType, void *TyOrExpr,
773 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000774 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000775 return ExprEmpty();
776 }
777
778 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000779 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000780 return ExprEmpty();
781 }
782
783 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
784 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000785 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000786 return ExprEmpty();
787 }
788
789 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000790 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000791 return ExprEmpty();
792 }
793
794 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
795 TypeTy *TypeRep,
796 SourceLocation LParenLoc,
797 MultiExprArg Exprs,
798 SourceLocation *CommaLocs,
799 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000800 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000801 return ExprEmpty();
802 }
803
804 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
805 SourceLocation StartLoc,
806 Declarator &D,
807 SourceLocation EqualLoc,
808 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000809 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000810 return ExprEmpty();
811 }
812
813 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
814 bool UseGlobal,
815 SourceLocation PlacementLParen,
816 MultiExprArg PlacementArgs,
817 SourceLocation PlacementRParen,
818 bool ParenTypeId, Declarator &D,
819 SourceLocation ConstructorLParen,
820 MultiExprArg ConstructorArgs,
821 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000822 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000823 return ExprEmpty();
824 }
825
826 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
827 bool UseGlobal, bool ArrayForm,
828 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000829 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000830 return ExprEmpty();
831 }
832
833 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
834 SourceLocation KWLoc,
835 SourceLocation LParen,
836 TypeTy *Ty,
837 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000838 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000839 return ExprEmpty();
840 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000841 };
842}
843
Eli Friedmanf54fce82009-05-19 01:02:07 +0000844MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
845 llvm::raw_ostream* OS) {
846 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000847}