blob: 95afb908dfa1aa4228177d3d0626b4a678e1afe2 [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,
68 SourceLocation EndProtoLoc,
69 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000070 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000071 return MinimalAction::ActOnStartClassInterface(AtInterfaceLoc,
Mike Stump1eb44332009-09-09 15:08:12 +000072 ClassName, ClassLoc,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000073 SuperName, SuperLoc,
74 ProtoRefs, NumProtocols,
75 EndProtoLoc, AttrList);
76 }
77
Mike Stump1eb44332009-09-09 15:08:12 +000078 /// ActOnForwardClassDeclaration -
79 /// Scope will always be top level file scope.
Chris Lattnerb28317a2009-03-28 19:18:32 +000080 Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
Mike Stump1eb44332009-09-09 15:08:12 +000081 IdentifierInfo **IdentList,
Ted Kremenekc09cba62009-11-17 23:12:20 +000082 SourceLocation *IdentLocs,
Chris Lattnerb28317a2009-03-28 19:18:32 +000083 unsigned NumElts) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000084 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000085 return MinimalAction::ActOnForwardClassDeclaration(AtClassLoc, IdentList,
Ted Kremenekc09cba62009-11-17 23:12:20 +000086 IdentLocs, NumElts);
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000087 }
88
89 // Pure Printing
90
91 /// ActOnParamDeclarator - This callback is invoked when a parameter
92 /// declarator is parsed. This callback only occurs for functions
93 /// with prototypes. S is the function prototype scope for the
94 /// parameters (C++ [basic.scope.proto]).
Chris Lattnerb28317a2009-03-28 19:18:32 +000095 virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000096 Out << __FUNCTION__ << " ";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000097 if (IdentifierInfo *II = D.getIdentifier()) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000098 Out << "'" << II->getName() << "'";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000099 } else {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000100 Out << "<anon>";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000101 }
Eli Friedmanf54fce82009-05-19 01:02:07 +0000102 Out << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000103 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000104 }
Mike Stump1eb44332009-09-09 15:08:12 +0000105
106 /// AddInitializerToDecl - This action is called immediately after
107 /// ParseDeclarator (when an initializer is present). The code is factored
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000108 /// this way to make sure we are able to handle the following:
109 /// void func() { int xx = xx; }
110 /// This allows ActOnDeclarator to register "xx" prior to parsing the
Mike Stump1eb44332009-09-09 15:08:12 +0000111 /// initializer. The declaration above should still result in a warning,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000112 /// since the reference to "xx" is uninitialized.
Anders Carlsson9abf2ae2009-08-16 05:13:48 +0000113 virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000114 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000115 }
116
Chris Lattner682bf922009-03-29 16:50:03 +0000117 /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed,
118 /// this gives the actions implementation a chance to process the group as
119 /// a whole.
Eli Friedmanc1dc6532009-05-29 01:49:24 +0000120 virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec& DS,
121 DeclPtrTy *Group,
Chris Lattner682bf922009-03-29 16:50:03 +0000122 unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000123 Out << __FUNCTION__ << "\n";
Chris Lattner682bf922009-03-29 16:50:03 +0000124 return DeclGroupPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000125 }
126
127 /// ActOnStartOfFunctionDef - This is called at the start of a function
128 /// definition, instead of calling ActOnDeclarator. The Declarator includes
129 /// information about formal arguments that are part of this function.
Chris Lattner682bf922009-03-29 16:50:03 +0000130 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope,
131 Declarator &D){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000132 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000133 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000134 }
135
136 /// ActOnStartOfFunctionDef - This is called at the start of a function
137 /// definition, after the FunctionDecl has already been created.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000138 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000139 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000140 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000141 }
142
Chris Lattnerb28317a2009-03-28 19:18:32 +0000143 virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000144 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000145 }
Mike Stump1eb44332009-09-09 15:08:12 +0000146
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000147 /// ActOnFunctionDefBody - This is called when a function body has completed
148 /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000149 virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000150 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000151 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000152 }
153
Chris Lattnerb28317a2009-03-28 19:18:32 +0000154 virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
155 ExprArg AsmString) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000156 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000157 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000158 }
Mike Stump1eb44332009-09-09 15:08:12 +0000159
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000160 /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
161 /// no declarator (e.g. "struct foo;") is parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000162 virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000163 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000164 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000165 }
Mike Stump1eb44332009-09-09 15:08:12 +0000166
Douglas Gregore79837a2008-12-17 01:46:43 +0000167 /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
168 /// contained braces. Lang/StrSize contains the language string that
169 /// was parsed at location Loc. Decls/NumDecls provides the
170 /// declarations parsed inside the linkage specification.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000171 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
172 SourceLocation LBrace,
173 SourceLocation RBrace, const char *Lang,
Mike Stump1eb44332009-09-09 15:08:12 +0000174 unsigned StrSize,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000175 DeclPtrTy *Decls, unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000176 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000177 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000178 }
Mike Stump1eb44332009-09-09 15:08:12 +0000179
Douglas Gregore79837a2008-12-17 01:46:43 +0000180 /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
181 /// braces. Lang/StrSize contains the language string that was
182 /// parsed at location Loc. D is the declaration parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000183 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
184 unsigned StrSize, DeclPtrTy D) {
185 return DeclPtrTy();
Douglas Gregore79837a2008-12-17 01:46:43 +0000186 }
Mike Stump1eb44332009-09-09 15:08:12 +0000187
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000188 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000189 // Type Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000190 //===------------------------------------------------------------------===//
Mike Stump1eb44332009-09-09 15:08:12 +0000191
Sebastian Redlcee63fb2008-12-02 14:43:59 +0000192 virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000193 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000194 return TypeResult();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000195 }
Mike Stump1eb44332009-09-09 15:08:12 +0000196
Daniel Dunbara4d32822009-09-11 06:34:14 +0000197 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000198 SourceLocation KWLoc, const CXXScopeSpec &SS,
199 IdentifierInfo *Name, SourceLocation NameLoc,
Douglas Gregor402abb52009-05-28 23:31:59 +0000200 AttributeList *Attr, AccessSpecifier AS,
Daniel Dunbara4d32822009-09-11 06:34:14 +0000201 MultiTemplateParamsArg TemplateParameterLists,
202 bool &OwnedDecl, bool &IsDependent) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000203 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
204 // is (struct/union/enum/class).
Eli Friedmanf54fce82009-05-19 01:02:07 +0000205 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000206 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000207 }
Mike Stump1eb44332009-09-09 15:08:12 +0000208
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000209 /// Act on @defs() element found when parsing a structure. ClassName is the
Mike Stump1eb44332009-09-09 15:08:12 +0000210 /// name of the referenced class.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000211 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000212 IdentifierInfo *ClassName,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000213 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000214 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000215 }
216
Mike Stump1eb44332009-09-09 15:08:12 +0000217 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000218 SourceLocation DeclStart,
219 Declarator &D, ExprTy *BitfieldWidth) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000220 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000221 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000222 }
Mike Stump1eb44332009-09-09 15:08:12 +0000223
Chris Lattnerb28317a2009-03-28 19:18:32 +0000224 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
Fariborz Jahanian496b5a82009-06-05 18:16:35 +0000225 DeclPtrTy IntfDecl,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000226 Declarator &D, ExprTy *BitfieldWidth,
227 tok::ObjCKeywordKind visibility) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000228 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000229 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000230 }
Mike Stump1eb44332009-09-09 15:08:12 +0000231
Chris Lattnerb28317a2009-03-28 19:18:32 +0000232 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
Mike Stump1eb44332009-09-09 15:08:12 +0000233 DeclPtrTy *Fields, unsigned NumFields,
Daniel Dunbar1bfe1c22008-10-03 02:03:53 +0000234 SourceLocation LBrac, SourceLocation RBrac,
235 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000236 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000237 }
Mike Stump1eb44332009-09-09 15:08:12 +0000238
Chris Lattnerb28317a2009-03-28 19:18:32 +0000239 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
240 DeclPtrTy LastEnumConstant,
241 SourceLocation IdLoc,IdentifierInfo *Id,
242 SourceLocation EqualLoc, ExprTy *Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000243 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000244 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000245 }
246
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000247 virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
248 SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
Edward O'Callaghanfee13812009-08-08 14:36:57 +0000249 DeclPtrTy *Elements, unsigned NumElements,
250 Scope *S, AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000251 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000252 }
253
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000254 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000255 // Statement Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000256 //===------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000257
258 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000259 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000260 return StmtEmpty();
261 }
262
263 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
264 SourceLocation R,
265 MultiStmtArg Elts,
266 bool isStmtExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000267 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000268 return StmtEmpty();
269 }
Chris Lattner682bf922009-03-29 16:50:03 +0000270 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000271 SourceLocation StartLoc,
272 SourceLocation EndLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000273 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000274 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000275 }
Mike Stump1eb44332009-09-09 15:08:12 +0000276
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000277 virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000278 Out << __FUNCTION__ << "\n";
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000279 return OwningStmtResult(*this, Expr->release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000280 }
Mike Stump1eb44332009-09-09 15:08:12 +0000281
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000282 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
283 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000284 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
285 ExprArg LHSVal,
286 SourceLocation DotDotDotLoc,
287 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000288 SourceLocation ColonLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000289 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000290 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000291 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000292 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
293 SourceLocation ColonLoc,
294 StmtArg SubStmt, Scope *CurScope){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000295 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000296 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000297 }
Sebastian Redlde307472009-01-11 00:38:46 +0000298
299 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
300 IdentifierInfo *II,
301 SourceLocation ColonLoc,
302 StmtArg SubStmt) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000303 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000304 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000305 }
Sebastian Redlde307472009-01-11 00:38:46 +0000306
Mike Stump1eb44332009-09-09 15:08:12 +0000307 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000308 FullExprArg CondVal, DeclPtrTy CondVar,
309 StmtArg ThenVal,
Anders Carlssona99fad82009-05-17 18:26:53 +0000310 SourceLocation ElseLoc,
Sebastian Redlde307472009-01-11 00:38:46 +0000311 StmtArg ElseVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000312 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000313 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000314 }
Sebastian Redlde307472009-01-11 00:38:46 +0000315
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000316 virtual OwningStmtResult ActOnStartOfSwitchStmt(FullExprArg Cond,
317 DeclPtrTy CondVar) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000318 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000319 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000320 }
Sebastian Redlde307472009-01-11 00:38:46 +0000321
322 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
323 StmtArg Switch,
324 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000325 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000326 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000327 }
328
Sebastian Redlf05b1522009-01-16 23:28:06 +0000329 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000330 FullExprArg Cond, DeclPtrTy CondVar,
331 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000332 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000333 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000334 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000335 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
Mike Stump1eb44332009-09-09 15:08:12 +0000336 SourceLocation WhileLoc,
Chris Lattner98913592009-06-12 23:04:47 +0000337 SourceLocation LPLoc, ExprArg Cond,
338 SourceLocation RPLoc){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000339 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000340 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000341 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000342 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
343 SourceLocation LParenLoc,
Douglas Gregor99e9b4d2009-11-25 00:27:52 +0000344 StmtArg First, FullExprArg Second,
345 DeclPtrTy SecondVar,
346 FullExprArg Third,
347 SourceLocation RParenLoc,
Sebastian Redlf05b1522009-01-16 23:28:06 +0000348 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000349 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000350 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000351 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000352 virtual OwningStmtResult ActOnObjCForCollectionStmt(
353 SourceLocation ForColLoc,
354 SourceLocation LParenLoc,
355 StmtArg First, ExprArg Second,
356 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000357 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000358 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000359 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000360 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
361 SourceLocation LabelLoc,
362 IdentifierInfo *LabelII) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000363 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000364 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000365 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000366 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
367 SourceLocation StarLoc,
368 ExprArg DestExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000369 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000370 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000371 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000372 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
373 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000374 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000375 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000376 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000377 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
378 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000379 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000380 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000381 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000382 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
Anders Carlssonf53b4432009-08-18 16:11:00 +0000383 ExprArg RetValExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000384 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000385 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000386 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000387 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000388 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000389 bool IsVolatile,
390 unsigned NumOutputs,
391 unsigned NumInputs,
392 std::string *Names,
393 MultiExprArg Constraints,
394 MultiExprArg Exprs,
395 ExprArg AsmString,
396 MultiExprArg Clobbers,
Mike Stumpc9a82a72010-01-05 00:29:29 +0000397 SourceLocation RParenLoc,
398 bool MSAsm) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000399 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000400 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000401 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000402
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000403 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000404 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
405 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000406 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000407 StmtArg CatchList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000408 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000409 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000410 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000411
412 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
413 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000414 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000415 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000416 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000417
418 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
419 StmtArg Try, StmtArg Catch,
420 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000421 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000422 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000423 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000424
425 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000426 ExprArg Throw,
427 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000428 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000429 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000430 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000431
432 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
433 ExprArg SynchExpr,
434 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000435 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000436 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000437 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000438
439 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000440 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000441 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000442 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000443 }
444
445 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000446 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000447 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000448 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000449 return StmtEmpty();
450 }
451
452 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
453 StmtArg TryBlock,
454 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000455 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000456 return StmtEmpty();
457 }
458
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000459 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000460 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000461 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000462
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000463 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000464
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000465 /// ActOnIdentifierExpr - Parse an identifier in expression context.
466 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
467 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000468 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
469 IdentifierInfo &II,
470 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000471 const CXXScopeSpec *SS,
472 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000473 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000474 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000475 }
476
Sebastian Redlcd965b92009-01-18 18:53:16 +0000477 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
478 Scope *S, SourceLocation OperatorLoc,
479 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000480 bool HasTrailingLParen, const CXXScopeSpec &SS,
481 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000482 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000483 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000484 }
485
Sebastian Redlcd965b92009-01-18 18:53:16 +0000486 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
487 Scope *S, SourceLocation OperatorLoc,
488 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000489 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000490 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000491 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000492 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000493
494 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
495 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000496 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000497 return ExprEmpty();
498 }
499
Mike Stump1eb44332009-09-09 15:08:12 +0000500 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000501 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000502 return ExprEmpty();
503 }
504
Mike Stump1eb44332009-09-09 15:08:12 +0000505 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000506 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000507 return ExprEmpty();
508 }
509
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000510 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
511 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000512 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
513 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000514 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000515 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000516 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000517
518 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
519 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000520 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000521 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000522 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000523
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000524 // Postfix Expressions.
Mike Stump1eb44332009-09-09 15:08:12 +0000525 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
Sebastian Redl0eb23302009-01-19 00:08:26 +0000526 tok::TokenKind Kind,
527 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000528 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000529 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000530 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000531 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
532 SourceLocation LLoc,
533 ExprArg Idx,
534 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000535 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000536 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000537 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000538 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
539 SourceLocation OpLoc,
540 tok::TokenKind OpKind,
541 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000542 IdentifierInfo &Member,
Douglas Gregorfe85ced2009-08-06 03:17:00 +0000543 DeclPtrTy ImplDecl,
544 const CXXScopeSpec *SS=0) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000545 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000546 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000547 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000548
549 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
550 SourceLocation LParenLoc,
551 MultiExprArg Args,
552 SourceLocation *CommaLocs,
553 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000554 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000555 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000556 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000557
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000558 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000559 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
560 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000561 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000562 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000563 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000564 virtual OwningExprResult
565 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
566 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000567 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000568 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000569 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000570
571 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
572 TypeTy *Ty,
573 SourceLocation RParen,
574 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000575 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000576 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000577 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000578 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
579 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000580 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000581 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000582 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000583 }
Mike Stump1eb44332009-09-09 15:08:12 +0000584 virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
Nate Begeman2ef13e52009-08-10 23:49:36 +0000585 TypeTy *Ty, SourceLocation RParenLoc,
586 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000587 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000588 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000589 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000590
591 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
592 tok::TokenKind Kind,
593 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000594 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000595 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000596 }
597
598 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
599 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000600 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
601 SourceLocation ColonLoc,
602 ExprArg Cond, ExprArg LHS,
603 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000604 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000605 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000606 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000607
608 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000609
Sebastian Redlf53597f2009-03-15 17:47:39 +0000610 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
611 SourceLocation LabLoc,
612 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000613 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000614 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000615 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000616
617 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
618 StmtArg SubStmt,
619 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000620 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000621 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000622 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000623
624 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
625 SourceLocation BuiltinLoc,
626 SourceLocation TypeLoc,
627 TypeTy *Arg1,
628 OffsetOfComponent *CompPtr,
629 unsigned NumComponents,
630 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000631 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000632 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000633 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000634
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000635 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000636 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
637 TypeTy *arg1,TypeTy *arg2,
638 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000639 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000640 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000641 }
642 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000643 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
644 ExprArg cond, ExprArg expr1,
645 ExprArg expr2,
646 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000647 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000648 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000649 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000650
651 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000652 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
653 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000654 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000655 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000656 return ExprEmpty();
657 }
658
659 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000660 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000661 return ExprEmpty();
662 }
663
664 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000665 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000666 }
667
668 virtual void ActOnBlockArguments(Declarator &ParamInfo, 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 ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000673 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000674 }
675
676 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
677 StmtArg Body,
678 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000679 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000680 return ExprEmpty();
681 }
682
Chris Lattnerb28317a2009-03-28 19:18:32 +0000683 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
684 IdentifierInfo *Ident,
685 SourceLocation LBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000686 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000687 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000688 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000689
Chris Lattnerb28317a2009-03-28 19:18:32 +0000690 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000691 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000692 return;
693 }
694
695#if 0
696 // FIXME: AttrList should be deleted by this function, but the definition
697 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000698 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
699 SourceLocation UsingLoc,
700 SourceLocation NamespcLoc,
701 const CXXScopeSpec &SS,
702 SourceLocation IdentLoc,
703 IdentifierInfo *NamespcName,
704 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000705 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000706 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000707 }
708#endif
709
Chris Lattnerb28317a2009-03-28 19:18:32 +0000710 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000711 SourceLocation EqualLoc,
712 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000713 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000714 }
715
Chris Lattnerb28317a2009-03-28 19:18:32 +0000716 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Anders Carlsson5e300d12009-06-12 16:51:40 +0000717 SourceLocation EqualLoc,
718 SourceLocation ArgLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000719 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000720 }
721
Chris Lattnerb28317a2009-03-28 19:18:32 +0000722 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000723 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000724 }
725
Chris Lattnerb28317a2009-03-28 19:18:32 +0000726 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000727 SourceLocation LParenLoc,
728 MultiExprArg Exprs,
729 SourceLocation *CommaLocs,
730 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000731 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000732 return;
733 }
734
Chris Lattnerb28317a2009-03-28 19:18:32 +0000735 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
Mike Stump1eb44332009-09-09 15:08:12 +0000736 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000737 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000738 }
739
Chris Lattnerb28317a2009-03-28 19:18:32 +0000740 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000741 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000742 }
743
744 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000745 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000746 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000747 }
748
Chris Lattnerb28317a2009-03-28 19:18:32 +0000749 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
750 ExprArg AssertExpr,
751 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000752 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000753 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000754 }
755
756 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
757 tok::TokenKind Kind,
758 SourceLocation LAngleBracketLoc,
759 TypeTy *Ty,
760 SourceLocation RAngleBracketLoc,
761 SourceLocation LParenLoc,
762 ExprArg Op,
763 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000764 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000765 return ExprEmpty();
766 }
767
768 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
769 SourceLocation LParenLoc,
770 bool isType, void *TyOrExpr,
771 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000772 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000773 return ExprEmpty();
774 }
775
776 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
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 ActOnCXXBoolLiteral(SourceLocation OpLoc,
782 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000783 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000784 return ExprEmpty();
785 }
786
787 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
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 ActOnCXXTypeConstructExpr(SourceRange TypeRange,
793 TypeTy *TypeRep,
794 SourceLocation LParenLoc,
795 MultiExprArg Exprs,
796 SourceLocation *CommaLocs,
797 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000798 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000799 return ExprEmpty();
800 }
801
802 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
803 SourceLocation StartLoc,
804 Declarator &D,
805 SourceLocation EqualLoc,
806 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000807 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000808 return ExprEmpty();
809 }
810
811 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
812 bool UseGlobal,
813 SourceLocation PlacementLParen,
814 MultiExprArg PlacementArgs,
815 SourceLocation PlacementRParen,
816 bool ParenTypeId, Declarator &D,
817 SourceLocation ConstructorLParen,
818 MultiExprArg ConstructorArgs,
819 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000820 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000821 return ExprEmpty();
822 }
823
824 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
825 bool UseGlobal, bool ArrayForm,
826 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000827 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000828 return ExprEmpty();
829 }
830
831 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
832 SourceLocation KWLoc,
833 SourceLocation LParen,
834 TypeTy *Ty,
835 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000836 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000837 return ExprEmpty();
838 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000839 };
840}
841
Eli Friedmanf54fce82009-05-19 01:02:07 +0000842MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
843 llvm::raw_ostream* OS) {
844 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000845}