blob: deb5498b906ed21ba15bcba1c8a4bad15224fdcd [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,
Anders Carlssona99fad82009-05-17 18:26:53 +0000308 FullExprArg CondVal, StmtArg ThenVal,
309 SourceLocation ElseLoc,
Sebastian Redlde307472009-01-11 00:38:46 +0000310 StmtArg ElseVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000311 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000312 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000313 }
Sebastian Redlde307472009-01-11 00:38:46 +0000314
315 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000316 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000317 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000318 }
Sebastian Redlde307472009-01-11 00:38:46 +0000319
320 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
321 StmtArg Switch,
322 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000323 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000324 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000325 }
326
Sebastian Redlf05b1522009-01-16 23:28:06 +0000327 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Anders Carlsson7f537c12009-05-17 21:22:26 +0000328 FullExprArg Cond, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000329 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000330 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000331 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000332 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
Mike Stump1eb44332009-09-09 15:08:12 +0000333 SourceLocation WhileLoc,
Chris Lattner98913592009-06-12 23:04:47 +0000334 SourceLocation LPLoc, ExprArg Cond,
335 SourceLocation RPLoc){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000336 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000337 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000338 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000339 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
340 SourceLocation LParenLoc,
341 StmtArg First, ExprArg Second,
342 ExprArg Third, SourceLocation RParenLoc,
343 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000344 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000345 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000346 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000347 virtual OwningStmtResult ActOnObjCForCollectionStmt(
348 SourceLocation ForColLoc,
349 SourceLocation LParenLoc,
350 StmtArg First, ExprArg Second,
351 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000352 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000353 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000354 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000355 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
356 SourceLocation LabelLoc,
357 IdentifierInfo *LabelII) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000358 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000359 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000360 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000361 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
362 SourceLocation StarLoc,
363 ExprArg DestExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000364 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000365 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000366 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000367 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
368 Scope *CurScope) {
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 ActOnBreakStmt(SourceLocation GotoLoc,
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 ActOnReturnStmt(SourceLocation ReturnLoc,
Anders Carlssonf53b4432009-08-18 16:11:00 +0000378 ExprArg RetValExp) {
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 Redl3037ed02009-01-18 16:53:17 +0000382 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000383 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000384 bool IsVolatile,
385 unsigned NumOutputs,
386 unsigned NumInputs,
387 std::string *Names,
388 MultiExprArg Constraints,
389 MultiExprArg Exprs,
390 ExprArg AsmString,
391 MultiExprArg Clobbers,
392 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000393 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000394 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000395 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000396
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000397 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000398 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
399 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000400 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000401 StmtArg CatchList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000402 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000403 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000404 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000405
406 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
407 StmtArg Body) {
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 ActOnObjCAtTryStmt(SourceLocation AtLoc,
413 StmtArg Try, StmtArg Catch,
414 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000415 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000416 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000417 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000418
419 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000420 ExprArg Throw,
421 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000422 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000423 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000424 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000425
426 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
427 ExprArg SynchExpr,
428 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000429 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000430 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000431 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000432
433 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000434 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000435 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000436 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000437 }
438
439 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000440 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000441 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000442 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000443 return StmtEmpty();
444 }
445
446 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
447 StmtArg TryBlock,
448 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000449 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000450 return StmtEmpty();
451 }
452
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000453 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000454 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000455 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000456
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000457 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000458
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000459 /// ActOnIdentifierExpr - Parse an identifier in expression context.
460 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
461 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000462 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
463 IdentifierInfo &II,
464 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000465 const CXXScopeSpec *SS,
466 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000467 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000468 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000469 }
470
Sebastian Redlcd965b92009-01-18 18:53:16 +0000471 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
472 Scope *S, SourceLocation OperatorLoc,
473 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000474 bool HasTrailingLParen, const CXXScopeSpec &SS,
475 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000476 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000477 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000478 }
479
Sebastian Redlcd965b92009-01-18 18:53:16 +0000480 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
481 Scope *S, SourceLocation OperatorLoc,
482 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000483 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000484 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000485 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000486 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000487
488 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
489 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000490 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000491 return ExprEmpty();
492 }
493
Mike Stump1eb44332009-09-09 15:08:12 +0000494 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
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 ActOnNumericConstant(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
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000504 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
505 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000506 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
507 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000508 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000509 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000510 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000511
512 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
513 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000514 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000515 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000516 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000517
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000518 // Postfix Expressions.
Mike Stump1eb44332009-09-09 15:08:12 +0000519 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
Sebastian Redl0eb23302009-01-19 00:08:26 +0000520 tok::TokenKind Kind,
521 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000522 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000523 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000524 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000525 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
526 SourceLocation LLoc,
527 ExprArg Idx,
528 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000529 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000530 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000531 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000532 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
533 SourceLocation OpLoc,
534 tok::TokenKind OpKind,
535 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000536 IdentifierInfo &Member,
Douglas Gregorfe85ced2009-08-06 03:17:00 +0000537 DeclPtrTy ImplDecl,
538 const CXXScopeSpec *SS=0) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000539 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000540 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000541 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000542
543 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
544 SourceLocation LParenLoc,
545 MultiExprArg Args,
546 SourceLocation *CommaLocs,
547 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000548 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000549 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000550 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000551
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000552 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000553 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
554 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000555 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000556 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000557 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000558 virtual OwningExprResult
559 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
560 void *TyOrEx, const SourceRange &ArgRange) {
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 Redlb8a6aca2009-01-19 22:31:54 +0000564
565 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
566 TypeTy *Ty,
567 SourceLocation RParen,
568 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000569 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000570 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000571 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000572 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
573 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000574 SourceLocation RParenLoc) {
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 }
Mike Stump1eb44332009-09-09 15:08:12 +0000578 virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
Nate Begeman2ef13e52009-08-10 23:49:36 +0000579 TypeTy *Ty, SourceLocation RParenLoc,
580 ExprArg Op) {
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 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000584
585 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
586 tok::TokenKind Kind,
587 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000588 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000589 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000590 }
591
592 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
593 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000594 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
595 SourceLocation ColonLoc,
596 ExprArg Cond, ExprArg LHS,
597 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000598 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000599 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000600 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000601
602 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000603
Sebastian Redlf53597f2009-03-15 17:47:39 +0000604 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
605 SourceLocation LabLoc,
606 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000607 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000608 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000609 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000610
611 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
612 StmtArg SubStmt,
613 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000614 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000615 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000616 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000617
618 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
619 SourceLocation BuiltinLoc,
620 SourceLocation TypeLoc,
621 TypeTy *Arg1,
622 OffsetOfComponent *CompPtr,
623 unsigned NumComponents,
624 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000625 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000626 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000627 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000628
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000629 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000630 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
631 TypeTy *arg1,TypeTy *arg2,
632 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000633 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000634 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000635 }
636 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000637 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
638 ExprArg cond, ExprArg expr1,
639 ExprArg expr2,
640 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000641 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000642 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000643 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000644
645 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000646 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
647 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000648 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000649 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000650 return ExprEmpty();
651 }
652
653 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
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 void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000659 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000660 }
661
662 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000663 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000664 }
665
666 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000667 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000668 }
669
670 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
671 StmtArg Body,
672 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000673 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000674 return ExprEmpty();
675 }
676
Chris Lattnerb28317a2009-03-28 19:18:32 +0000677 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
678 IdentifierInfo *Ident,
679 SourceLocation LBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000680 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000681 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000682 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000683
Chris Lattnerb28317a2009-03-28 19:18:32 +0000684 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000685 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000686 return;
687 }
688
689#if 0
690 // FIXME: AttrList should be deleted by this function, but the definition
691 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000692 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
693 SourceLocation UsingLoc,
694 SourceLocation NamespcLoc,
695 const CXXScopeSpec &SS,
696 SourceLocation IdentLoc,
697 IdentifierInfo *NamespcName,
698 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000699 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000700 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000701 }
702#endif
703
Chris Lattnerb28317a2009-03-28 19:18:32 +0000704 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000705 SourceLocation EqualLoc,
706 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000707 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000708 }
709
Chris Lattnerb28317a2009-03-28 19:18:32 +0000710 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Anders Carlsson5e300d12009-06-12 16:51:40 +0000711 SourceLocation EqualLoc,
712 SourceLocation ArgLoc) {
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 ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000717 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000718 }
719
Chris Lattnerb28317a2009-03-28 19:18:32 +0000720 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000721 SourceLocation LParenLoc,
722 MultiExprArg Exprs,
723 SourceLocation *CommaLocs,
724 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000725 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000726 return;
727 }
728
Chris Lattnerb28317a2009-03-28 19:18:32 +0000729 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
Mike Stump1eb44332009-09-09 15:08:12 +0000730 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000731 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000732 }
733
Chris Lattnerb28317a2009-03-28 19:18:32 +0000734 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000735 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000736 }
737
738 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000739 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000740 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000741 }
742
Chris Lattnerb28317a2009-03-28 19:18:32 +0000743 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
744 ExprArg AssertExpr,
745 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000746 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000747 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000748 }
749
750 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
751 tok::TokenKind Kind,
752 SourceLocation LAngleBracketLoc,
753 TypeTy *Ty,
754 SourceLocation RAngleBracketLoc,
755 SourceLocation LParenLoc,
756 ExprArg Op,
757 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000758 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000759 return ExprEmpty();
760 }
761
762 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
763 SourceLocation LParenLoc,
764 bool isType, void *TyOrExpr,
765 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000766 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000767 return ExprEmpty();
768 }
769
770 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
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 ActOnCXXBoolLiteral(SourceLocation OpLoc,
776 tok::TokenKind Kind) {
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 ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
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 ActOnCXXTypeConstructExpr(SourceRange TypeRange,
787 TypeTy *TypeRep,
788 SourceLocation LParenLoc,
789 MultiExprArg Exprs,
790 SourceLocation *CommaLocs,
791 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000792 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000793 return ExprEmpty();
794 }
795
796 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
797 SourceLocation StartLoc,
798 Declarator &D,
799 SourceLocation EqualLoc,
800 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000801 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000802 return ExprEmpty();
803 }
804
805 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
806 bool UseGlobal,
807 SourceLocation PlacementLParen,
808 MultiExprArg PlacementArgs,
809 SourceLocation PlacementRParen,
810 bool ParenTypeId, Declarator &D,
811 SourceLocation ConstructorLParen,
812 MultiExprArg ConstructorArgs,
813 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000814 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000815 return ExprEmpty();
816 }
817
818 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
819 bool UseGlobal, bool ArrayForm,
820 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000821 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000822 return ExprEmpty();
823 }
824
825 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
826 SourceLocation KWLoc,
827 SourceLocation LParen,
828 TypeTy *Ty,
829 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000830 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000831 return ExprEmpty();
832 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000833 };
834}
835
Eli Friedmanf54fce82009-05-19 01:02:07 +0000836MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
837 llvm::raw_ostream* OS) {
838 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000839}