blob: 258d352452ee9a8487f21b152bb80ffce4608d96 [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 Gregor586596f2010-05-06 17:25:47 +0000318 virtual OwningStmtResult ActOnStartOfSwitchStmt(SourceLocation SwitchLoc,
319 ExprArg Cond,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000320 DeclPtrTy CondVar) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000321 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000322 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000323 }
Sebastian Redlde307472009-01-11 00:38:46 +0000324
325 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
326 StmtArg Switch,
327 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000328 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000329 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000330 }
331
Sebastian Redlf05b1522009-01-16 23:28:06 +0000332 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000333 FullExprArg Cond, DeclPtrTy CondVar,
334 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000335 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000336 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000337 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000338 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
Mike Stump1eb44332009-09-09 15:08:12 +0000339 SourceLocation WhileLoc,
Chris Lattner98913592009-06-12 23:04:47 +0000340 SourceLocation LPLoc, ExprArg Cond,
341 SourceLocation RPLoc){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000342 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000343 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000344 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000345 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
346 SourceLocation LParenLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000347 StmtArg First, FullExprArg Second,
348 DeclPtrTy SecondVar,
349 FullExprArg Third,
350 SourceLocation RParenLoc,
Sebastian Redlf05b1522009-01-16 23:28:06 +0000351 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000352 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000353 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000354 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000355 virtual OwningStmtResult ActOnObjCForCollectionStmt(
356 SourceLocation ForColLoc,
357 SourceLocation LParenLoc,
358 StmtArg First, ExprArg Second,
359 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000360 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000361 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000362 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000363 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
364 SourceLocation LabelLoc,
365 IdentifierInfo *LabelII) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000366 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000367 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000368 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000369 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
370 SourceLocation StarLoc,
371 ExprArg DestExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000372 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000373 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000374 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000375 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
376 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000377 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000378 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000379 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000380 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
381 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000382 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000383 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000384 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000385 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
Anders Carlssonf53b4432009-08-18 16:11:00 +0000386 ExprArg RetValExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000387 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000388 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000389 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000390 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000391 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000392 bool IsVolatile,
393 unsigned NumOutputs,
394 unsigned NumInputs,
Anders Carlssonff93dbd2010-01-30 22:25:16 +0000395 IdentifierInfo **Names,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000396 MultiExprArg Constraints,
397 MultiExprArg Exprs,
398 ExprArg AsmString,
399 MultiExprArg Clobbers,
Mike Stumpc9a82a72010-01-05 00:29:29 +0000400 SourceLocation RParenLoc,
401 bool MSAsm) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000402 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000403 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000404 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000405
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000406 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000407 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
408 SourceLocation RParen,
Benjamin Kramerd9d3a1c2010-04-24 08:26:17 +0000409 DeclPtrTy Parm,
410 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000411 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000412 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000413 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000414
415 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
416 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000417 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000418 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000419 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000420
421 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
Benjamin Kramerd9d3a1c2010-04-24 08:26:17 +0000422 StmtArg Try,
423 MultiStmtArg CatchStmts,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000424 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000425 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000426 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000427 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000428
429 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000430 ExprArg Throw,
431 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000432 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000433 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000434 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000435
436 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
437 ExprArg SynchExpr,
438 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000439 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000440 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000441 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000442
443 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000444 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000445 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000446 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000447 }
448
449 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000450 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000451 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000452 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000453 return StmtEmpty();
454 }
455
456 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
457 StmtArg TryBlock,
458 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000459 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000460 return StmtEmpty();
461 }
462
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000463 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000464 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000465 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000466
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000467 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000468
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000469 /// ActOnIdentifierExpr - Parse an identifier in expression context.
470 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
471 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000472 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
473 IdentifierInfo &II,
474 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000475 const CXXScopeSpec *SS,
476 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000477 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000478 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000479 }
480
Sebastian Redlcd965b92009-01-18 18:53:16 +0000481 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
482 Scope *S, SourceLocation OperatorLoc,
483 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000484 bool HasTrailingLParen, const CXXScopeSpec &SS,
485 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000486 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000487 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000488 }
489
Sebastian Redlcd965b92009-01-18 18:53:16 +0000490 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
491 Scope *S, SourceLocation OperatorLoc,
492 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000493 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000494 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000495 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000496 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000497
498 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
499 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000500 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000501 return ExprEmpty();
502 }
503
Mike Stump1eb44332009-09-09 15:08:12 +0000504 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000505 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000506 return ExprEmpty();
507 }
508
Mike Stump1eb44332009-09-09 15:08:12 +0000509 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000510 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000511 return ExprEmpty();
512 }
513
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000514 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
515 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000516 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
517 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000518 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000519 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000520 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000521
522 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
523 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000524 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000525 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000526 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000527
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000528 // Postfix Expressions.
Mike Stump1eb44332009-09-09 15:08:12 +0000529 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
Sebastian Redl0eb23302009-01-19 00:08:26 +0000530 tok::TokenKind Kind,
531 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000532 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000533 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000534 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000535 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
536 SourceLocation LLoc,
537 ExprArg Idx,
538 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000539 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000540 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000541 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000542 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
543 SourceLocation OpLoc,
544 tok::TokenKind OpKind,
545 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000546 IdentifierInfo &Member,
Douglas Gregorfe85ced2009-08-06 03:17:00 +0000547 DeclPtrTy ImplDecl,
548 const CXXScopeSpec *SS=0) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000549 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000550 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000551 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000552
553 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
554 SourceLocation LParenLoc,
555 MultiExprArg Args,
556 SourceLocation *CommaLocs,
557 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000558 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000559 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000560 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000561
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000562 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000563 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
564 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000565 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000566 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000567 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000568 virtual OwningExprResult
569 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
570 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000571 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000572 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000573 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000574
575 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
576 TypeTy *Ty,
577 SourceLocation RParen,
578 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000579 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000580 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000581 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000582 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
583 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000584 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000585 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000586 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000587 }
Mike Stump1eb44332009-09-09 15:08:12 +0000588 virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
Nate Begeman2ef13e52009-08-10 23:49:36 +0000589 TypeTy *Ty, SourceLocation RParenLoc,
590 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000591 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000592 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000593 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000594
595 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
596 tok::TokenKind Kind,
597 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000598 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000599 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000600 }
601
602 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
603 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000604 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
605 SourceLocation ColonLoc,
606 ExprArg Cond, ExprArg LHS,
607 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000608 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000609 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000610 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000611
612 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000613
Sebastian Redlf53597f2009-03-15 17:47:39 +0000614 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
615 SourceLocation LabLoc,
616 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000617 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000618 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000619 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000620
621 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
622 StmtArg SubStmt,
623 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000624 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000625 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000626 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000627
628 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
629 SourceLocation BuiltinLoc,
630 SourceLocation TypeLoc,
631 TypeTy *Arg1,
632 OffsetOfComponent *CompPtr,
633 unsigned NumComponents,
634 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000635 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000636 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000637 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000638
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000639 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000640 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
641 TypeTy *arg1,TypeTy *arg2,
642 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000643 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000644 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000645 }
646 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000647 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
648 ExprArg cond, ExprArg expr1,
649 ExprArg expr2,
650 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000651 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000652 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000653 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000654
655 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000656 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
657 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000658 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000659 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000660 return ExprEmpty();
661 }
662
663 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000664 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000665 return ExprEmpty();
666 }
667
668 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000669 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000670 }
671
672 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000673 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000674 }
675
676 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000677 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000678 }
679
680 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
681 StmtArg Body,
682 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000683 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000684 return ExprEmpty();
685 }
686
Chris Lattnerb28317a2009-03-28 19:18:32 +0000687 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
688 IdentifierInfo *Ident,
Anders Carlsson2a3503d2010-02-07 01:09:23 +0000689 SourceLocation LBrace,
690 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000691 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000692 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000693 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000694
Chris Lattnerb28317a2009-03-28 19:18:32 +0000695 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000696 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000697 return;
698 }
699
700#if 0
701 // FIXME: AttrList should be deleted by this function, but the definition
702 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000703 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
704 SourceLocation UsingLoc,
705 SourceLocation NamespcLoc,
706 const CXXScopeSpec &SS,
707 SourceLocation IdentLoc,
708 IdentifierInfo *NamespcName,
709 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000710 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000711 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000712 }
713#endif
714
Chris Lattnerb28317a2009-03-28 19:18:32 +0000715 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000716 SourceLocation EqualLoc,
717 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000718 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000719 }
720
Chris Lattnerb28317a2009-03-28 19:18:32 +0000721 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Anders Carlsson5e300d12009-06-12 16:51:40 +0000722 SourceLocation EqualLoc,
723 SourceLocation ArgLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000724 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000725 }
726
Chris Lattnerb28317a2009-03-28 19:18:32 +0000727 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000728 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000729 }
730
Chris Lattnerb28317a2009-03-28 19:18:32 +0000731 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000732 SourceLocation LParenLoc,
733 MultiExprArg Exprs,
734 SourceLocation *CommaLocs,
735 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000736 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000737 return;
738 }
739
Chris Lattnerb28317a2009-03-28 19:18:32 +0000740 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
Mike Stump1eb44332009-09-09 15:08:12 +0000741 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000742 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000743 }
744
Chris Lattnerb28317a2009-03-28 19:18:32 +0000745 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000746 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000747 }
748
749 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000750 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000751 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000752 }
753
Chris Lattnerb28317a2009-03-28 19:18:32 +0000754 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
755 ExprArg AssertExpr,
756 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000757 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000758 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000759 }
760
761 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
762 tok::TokenKind Kind,
763 SourceLocation LAngleBracketLoc,
764 TypeTy *Ty,
765 SourceLocation RAngleBracketLoc,
766 SourceLocation LParenLoc,
767 ExprArg Op,
768 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000769 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000770 return ExprEmpty();
771 }
772
773 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
774 SourceLocation LParenLoc,
775 bool isType, void *TyOrExpr,
776 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000777 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000778 return ExprEmpty();
779 }
780
781 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000782 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000783 return ExprEmpty();
784 }
785
786 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
787 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000788 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000789 return ExprEmpty();
790 }
791
792 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000793 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000794 return ExprEmpty();
795 }
796
797 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
798 TypeTy *TypeRep,
799 SourceLocation LParenLoc,
800 MultiExprArg Exprs,
801 SourceLocation *CommaLocs,
802 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000803 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000804 return ExprEmpty();
805 }
806
807 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
808 SourceLocation StartLoc,
809 Declarator &D,
810 SourceLocation EqualLoc,
811 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000812 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000813 return ExprEmpty();
814 }
815
816 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
817 bool UseGlobal,
818 SourceLocation PlacementLParen,
819 MultiExprArg PlacementArgs,
820 SourceLocation PlacementRParen,
821 bool ParenTypeId, Declarator &D,
822 SourceLocation ConstructorLParen,
823 MultiExprArg ConstructorArgs,
824 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000825 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000826 return ExprEmpty();
827 }
828
829 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
830 bool UseGlobal, bool ArrayForm,
831 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000832 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000833 return ExprEmpty();
834 }
835
836 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
837 SourceLocation KWLoc,
838 SourceLocation LParen,
839 TypeTy *Ty,
840 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000841 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000842 return ExprEmpty();
843 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000844 };
845}
846
Eli Friedmanf54fce82009-05-19 01:02:07 +0000847MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
848 llvm::raw_ostream* OS) {
849 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000850}