blob: c5dc979f654b3616ba1f2a7fc27eb8107d554c8b [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,
397 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000398 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000399 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000400 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000401
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000402 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000403 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
404 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000405 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000406 StmtArg CatchList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000407 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000408 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000409 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000410
411 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
412 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000413 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000414 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000415 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000416
417 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
418 StmtArg Try, StmtArg Catch,
419 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000420 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000421 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000422 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000423
424 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000425 ExprArg Throw,
426 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000427 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000428 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000429 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000430
431 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
432 ExprArg SynchExpr,
433 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000434 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000435 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000436 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000437
438 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000439 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000440 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000441 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000442 }
443
444 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000445 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000446 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000447 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000448 return StmtEmpty();
449 }
450
451 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
452 StmtArg TryBlock,
453 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000454 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000455 return StmtEmpty();
456 }
457
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000458 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000459 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000460 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000461
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000462 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000463
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000464 /// ActOnIdentifierExpr - Parse an identifier in expression context.
465 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
466 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000467 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
468 IdentifierInfo &II,
469 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000470 const CXXScopeSpec *SS,
471 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000472 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000473 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000474 }
475
Sebastian Redlcd965b92009-01-18 18:53:16 +0000476 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
477 Scope *S, SourceLocation OperatorLoc,
478 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000479 bool HasTrailingLParen, const CXXScopeSpec &SS,
480 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000481 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000482 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000483 }
484
Sebastian Redlcd965b92009-01-18 18:53:16 +0000485 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
486 Scope *S, SourceLocation OperatorLoc,
487 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000488 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000489 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000490 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000491 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000492
493 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
494 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000495 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000496 return ExprEmpty();
497 }
498
Mike Stump1eb44332009-09-09 15:08:12 +0000499 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
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 ActOnNumericConstant(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
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000509 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
510 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000511 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
512 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000513 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000514 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000515 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000516
517 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
518 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000519 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000520 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000521 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000522
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000523 // Postfix Expressions.
Mike Stump1eb44332009-09-09 15:08:12 +0000524 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
Sebastian Redl0eb23302009-01-19 00:08:26 +0000525 tok::TokenKind Kind,
526 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000527 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000528 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000529 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000530 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
531 SourceLocation LLoc,
532 ExprArg Idx,
533 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000534 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000535 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000536 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000537 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
538 SourceLocation OpLoc,
539 tok::TokenKind OpKind,
540 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000541 IdentifierInfo &Member,
Douglas Gregorfe85ced2009-08-06 03:17:00 +0000542 DeclPtrTy ImplDecl,
543 const CXXScopeSpec *SS=0) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000544 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000545 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000546 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000547
548 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
549 SourceLocation LParenLoc,
550 MultiExprArg Args,
551 SourceLocation *CommaLocs,
552 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000553 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000554 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000555 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000556
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000557 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000558 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
559 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000560 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000561 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000562 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000563 virtual OwningExprResult
564 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
565 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000566 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000567 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000568 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000569
570 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
571 TypeTy *Ty,
572 SourceLocation RParen,
573 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000574 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000575 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000576 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000577 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
578 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000579 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000580 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000581 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000582 }
Mike Stump1eb44332009-09-09 15:08:12 +0000583 virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
Nate Begeman2ef13e52009-08-10 23:49:36 +0000584 TypeTy *Ty, SourceLocation RParenLoc,
585 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000586 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000587 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000588 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000589
590 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
591 tok::TokenKind Kind,
592 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000593 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000594 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000595 }
596
597 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
598 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000599 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
600 SourceLocation ColonLoc,
601 ExprArg Cond, ExprArg LHS,
602 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000603 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000604 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000605 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000606
607 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000608
Sebastian Redlf53597f2009-03-15 17:47:39 +0000609 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
610 SourceLocation LabLoc,
611 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000612 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000613 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000614 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000615
616 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
617 StmtArg SubStmt,
618 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000619 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000620 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000621 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000622
623 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
624 SourceLocation BuiltinLoc,
625 SourceLocation TypeLoc,
626 TypeTy *Arg1,
627 OffsetOfComponent *CompPtr,
628 unsigned NumComponents,
629 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000630 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000631 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000632 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000633
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000634 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000635 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
636 TypeTy *arg1,TypeTy *arg2,
637 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000638 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000639 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000640 }
641 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000642 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
643 ExprArg cond, ExprArg expr1,
644 ExprArg expr2,
645 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000646 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000647 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000648 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000649
650 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000651 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
652 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000653 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000654 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000655 return ExprEmpty();
656 }
657
658 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
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 void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000664 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000665 }
666
667 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000668 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000669 }
670
671 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000672 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000673 }
674
675 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
676 StmtArg Body,
677 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000678 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000679 return ExprEmpty();
680 }
681
Chris Lattnerb28317a2009-03-28 19:18:32 +0000682 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
683 IdentifierInfo *Ident,
684 SourceLocation LBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000685 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000686 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000687 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000688
Chris Lattnerb28317a2009-03-28 19:18:32 +0000689 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000690 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000691 return;
692 }
693
694#if 0
695 // FIXME: AttrList should be deleted by this function, but the definition
696 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000697 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
698 SourceLocation UsingLoc,
699 SourceLocation NamespcLoc,
700 const CXXScopeSpec &SS,
701 SourceLocation IdentLoc,
702 IdentifierInfo *NamespcName,
703 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000704 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000705 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000706 }
707#endif
708
Chris Lattnerb28317a2009-03-28 19:18:32 +0000709 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000710 SourceLocation EqualLoc,
711 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000712 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000713 }
714
Chris Lattnerb28317a2009-03-28 19:18:32 +0000715 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Anders Carlsson5e300d12009-06-12 16:51:40 +0000716 SourceLocation EqualLoc,
717 SourceLocation ArgLoc) {
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 ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000722 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000723 }
724
Chris Lattnerb28317a2009-03-28 19:18:32 +0000725 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000726 SourceLocation LParenLoc,
727 MultiExprArg Exprs,
728 SourceLocation *CommaLocs,
729 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000730 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000731 return;
732 }
733
Chris Lattnerb28317a2009-03-28 19:18:32 +0000734 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
Mike Stump1eb44332009-09-09 15:08:12 +0000735 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000736 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000737 }
738
Chris Lattnerb28317a2009-03-28 19:18:32 +0000739 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000740 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000741 }
742
743 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000744 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000745 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000746 }
747
Chris Lattnerb28317a2009-03-28 19:18:32 +0000748 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
749 ExprArg AssertExpr,
750 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000751 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000752 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000753 }
754
755 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
756 tok::TokenKind Kind,
757 SourceLocation LAngleBracketLoc,
758 TypeTy *Ty,
759 SourceLocation RAngleBracketLoc,
760 SourceLocation LParenLoc,
761 ExprArg Op,
762 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000763 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000764 return ExprEmpty();
765 }
766
767 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
768 SourceLocation LParenLoc,
769 bool isType, void *TyOrExpr,
770 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000771 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000772 return ExprEmpty();
773 }
774
775 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000776 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000777 return ExprEmpty();
778 }
779
780 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
781 tok::TokenKind Kind) {
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 ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000787 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000788 return ExprEmpty();
789 }
790
791 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
792 TypeTy *TypeRep,
793 SourceLocation LParenLoc,
794 MultiExprArg Exprs,
795 SourceLocation *CommaLocs,
796 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000797 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000798 return ExprEmpty();
799 }
800
801 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
802 SourceLocation StartLoc,
803 Declarator &D,
804 SourceLocation EqualLoc,
805 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000806 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000807 return ExprEmpty();
808 }
809
810 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
811 bool UseGlobal,
812 SourceLocation PlacementLParen,
813 MultiExprArg PlacementArgs,
814 SourceLocation PlacementRParen,
815 bool ParenTypeId, Declarator &D,
816 SourceLocation ConstructorLParen,
817 MultiExprArg ConstructorArgs,
818 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000819 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000820 return ExprEmpty();
821 }
822
823 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
824 bool UseGlobal, bool ArrayForm,
825 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000826 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000827 return ExprEmpty();
828 }
829
830 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
831 SourceLocation KWLoc,
832 SourceLocation LParen,
833 TypeTy *Ty,
834 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000835 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000836 return ExprEmpty();
837 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000838 };
839}
840
Eli Friedmanf54fce82009-05-19 01:02:07 +0000841MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
842 llvm::raw_ostream* OS) {
843 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000844}