blob: 73530ef58d86c487c558d2f8339078c29765be7a [file] [log] [blame]
Chris Lattner4b009652007-07-25 00:24:17 +00001//===--- PrintParserActions.cpp - Implement -parse-print-callbacks mode ---===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner959e5be2007-12-29 19:59:25 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Chris Lattner4b009652007-07-25 00:24:17 +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 Friedman7e1d6372009-05-19 04:14:29 +000015#include "clang/Frontend/Utils.h"
Chris Lattner4b009652007-07-25 00:24:17 +000016#include "clang/Parse/Action.h"
17#include "clang/Parse/DeclSpec.h"
Eli Friedman4ae15b92009-05-19 01:02:07 +000018#include "llvm/Support/raw_ostream.h"
Chris Lattner4b009652007-07-25 00:24:17 +000019using namespace clang;
20
21namespace {
22 class ParserPrintActions : public MinimalAction {
Eli Friedman4ae15b92009-05-19 01:02:07 +000023 llvm::raw_ostream& Out;
24
Steve Naroffebeb4282007-10-31 20:55:39 +000025 public:
Eli Friedman4ae15b92009-05-19 01:02:07 +000026 ParserPrintActions(Preprocessor &PP, llvm::raw_ostream& OS)
27 : MinimalAction(PP), Out(OS) {}
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +000028
29 // Printing Functions which also must call MinimalAction
30
Steve Naroff0acc9c92007-09-15 18:49:24 +000031 /// ActOnDeclarator - This callback is invoked when a declarator is parsed
Chris Lattner4b009652007-07-25 00:24:17 +000032 /// and 'Init' specifies the initializer if any. This is for things like:
33 /// "int X = 4" or "typedef int foo".
Chris Lattnera17991f2009-03-29 16:50:03 +000034 virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D) {
Eli Friedman4ae15b92009-05-19 01:02:07 +000035 Out << __FUNCTION__ << " ";
Chris Lattner4b009652007-07-25 00:24:17 +000036 if (IdentifierInfo *II = D.getIdentifier()) {
Eli Friedman4ae15b92009-05-19 01:02:07 +000037 Out << "'" << II->getName() << "'";
Chris Lattner4b009652007-07-25 00:24:17 +000038 } else {
Eli Friedman4ae15b92009-05-19 01:02:07 +000039 Out << "<anon>";
Chris Lattner4b009652007-07-25 00:24:17 +000040 }
Eli Friedman4ae15b92009-05-19 01:02:07 +000041 Out << "\n";
Chris Lattner4b009652007-07-25 00:24:17 +000042
43 // Pass up to EmptyActions so that the symbol table is maintained right.
Chris Lattnera17991f2009-03-29 16:50:03 +000044 return MinimalAction::ActOnDeclarator(S, D);
Chris Lattner4b009652007-07-25 00:24:17 +000045 }
Steve Naroffbd5c5fb2007-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 Friedman4ae15b92009-05-19 01:02:07 +000049 Out << __FUNCTION__ << "\n";
Daniel Dunbar6a4d56d2008-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 Friedman4ae15b92009-05-19 01:02:07 +000056 Out << __FUNCTION__ << "\n";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +000057 MinimalAction::ActOnTranslationUnitScope(Loc, S);
58 }
59
60
Chris Lattner5261d0c2009-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 Friedman4ae15b92009-05-19 01:02:07 +000070 Out << __FUNCTION__ << "\n";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +000071 return MinimalAction::ActOnStartClassInterface(AtInterfaceLoc,
72 ClassName, ClassLoc,
73 SuperName, SuperLoc,
74 ProtoRefs, NumProtocols,
75 EndProtoLoc, AttrList);
76 }
77
78 /// ActOnForwardClassDeclaration -
79 /// Scope will always be top level file scope.
Chris Lattner5261d0c2009-03-28 19:18:32 +000080 Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
81 IdentifierInfo **IdentList,
82 unsigned NumElts) {
Eli Friedman4ae15b92009-05-19 01:02:07 +000083 Out << __FUNCTION__ << "\n";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +000084 return MinimalAction::ActOnForwardClassDeclaration(AtClassLoc, IdentList,
85 NumElts);
86 }
87
88 // Pure Printing
89
90 /// ActOnParamDeclarator - This callback is invoked when a parameter
91 /// declarator is parsed. This callback only occurs for functions
92 /// with prototypes. S is the function prototype scope for the
93 /// parameters (C++ [basic.scope.proto]).
Chris Lattner5261d0c2009-03-28 19:18:32 +000094 virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
Eli Friedman4ae15b92009-05-19 01:02:07 +000095 Out << __FUNCTION__ << " ";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +000096 if (IdentifierInfo *II = D.getIdentifier()) {
Eli Friedman4ae15b92009-05-19 01:02:07 +000097 Out << "'" << II->getName() << "'";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +000098 } else {
Eli Friedman4ae15b92009-05-19 01:02:07 +000099 Out << "<anon>";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000100 }
Eli Friedman4ae15b92009-05-19 01:02:07 +0000101 Out << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000102 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000103 }
104
105 /// AddInitializerToDecl - This action is called immediately after
106 /// ParseDeclarator (when an initializer is present). The code is factored
107 /// this way to make sure we are able to handle the following:
108 /// void func() { int xx = xx; }
109 /// This allows ActOnDeclarator to register "xx" prior to parsing the
110 /// initializer. The declaration above should still result in a warning,
111 /// since the reference to "xx" is uninitialized.
Chris Lattner5261d0c2009-03-28 19:18:32 +0000112 virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000113 Out << __FUNCTION__ << "\n";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000114 }
115
Chris Lattnera17991f2009-03-29 16:50:03 +0000116 /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed,
117 /// this gives the actions implementation a chance to process the group as
118 /// a whole.
119 virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, DeclPtrTy *Group,
120 unsigned NumDecls) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000121 Out << __FUNCTION__ << "\n";
Chris Lattnera17991f2009-03-29 16:50:03 +0000122 return DeclGroupPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000123 }
124
125 /// ActOnStartOfFunctionDef - This is called at the start of a function
126 /// definition, instead of calling ActOnDeclarator. The Declarator includes
127 /// information about formal arguments that are part of this function.
Chris Lattnera17991f2009-03-29 16:50:03 +0000128 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope,
129 Declarator &D){
Eli Friedman4ae15b92009-05-19 01:02:07 +0000130 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000131 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000132 }
133
134 /// ActOnStartOfFunctionDef - This is called at the start of a function
135 /// definition, after the FunctionDecl has already been created.
Chris Lattner5261d0c2009-03-28 19:18:32 +0000136 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000137 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000138 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000139 }
140
Chris Lattner5261d0c2009-03-28 19:18:32 +0000141 virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000142 Out << __FUNCTION__ << "\n";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000143 }
144
145 /// ActOnFunctionDefBody - This is called when a function body has completed
146 /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef.
Chris Lattner5261d0c2009-03-28 19:18:32 +0000147 virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000148 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000149 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000150 }
151
Chris Lattner5261d0c2009-03-28 19:18:32 +0000152 virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
153 ExprArg AsmString) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000154 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000155 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000156 }
157
158 /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
159 /// no declarator (e.g. "struct foo;") is parsed.
Chris Lattner5261d0c2009-03-28 19:18:32 +0000160 virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000161 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000162 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000163 }
Douglas Gregor4b0a0442008-12-17 01:46:43 +0000164
165 /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
166 /// contained braces. Lang/StrSize contains the language string that
167 /// was parsed at location Loc. Decls/NumDecls provides the
168 /// declarations parsed inside the linkage specification.
Chris Lattner5261d0c2009-03-28 19:18:32 +0000169 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
170 SourceLocation LBrace,
171 SourceLocation RBrace, const char *Lang,
172 unsigned StrSize,
173 DeclPtrTy *Decls, unsigned NumDecls) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000174 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000175 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000176 }
Douglas Gregor4b0a0442008-12-17 01:46:43 +0000177
178 /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
179 /// braces. Lang/StrSize contains the language string that was
180 /// parsed at location Loc. D is the declaration parsed.
Chris Lattner5261d0c2009-03-28 19:18:32 +0000181 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
182 unsigned StrSize, DeclPtrTy D) {
183 return DeclPtrTy();
Douglas Gregor4b0a0442008-12-17 01:46:43 +0000184 }
185
Mike Stump155750e2009-05-16 07:06:02 +0000186 //===------------------------------------------------------------------===//
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000187 // Type Parsing Callbacks.
Mike Stump155750e2009-05-16 07:06:02 +0000188 //===------------------------------------------------------------------===//
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000189
Sebastian Redl66df3ef2008-12-02 14:43:59 +0000190 virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000191 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000192 return TypeResult();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000193 }
194
Chris Lattner5261d0c2009-03-28 19:18:32 +0000195 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagType, TagKind TK,
196 SourceLocation KWLoc, const CXXScopeSpec &SS,
197 IdentifierInfo *Name, SourceLocation NameLoc,
Douglas Gregor71f06032009-05-28 23:31:59 +0000198 AttributeList *Attr, AccessSpecifier AS,
199 bool &Owned) {
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000200 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
201 // is (struct/union/enum/class).
Eli Friedman4ae15b92009-05-19 01:02:07 +0000202 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000203 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000204 }
205
206 /// Act on @defs() element found when parsing a structure. ClassName is the
207 /// name of the referenced class.
Chris Lattner5261d0c2009-03-28 19:18:32 +0000208 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000209 IdentifierInfo *ClassName,
Chris Lattner5261d0c2009-03-28 19:18:32 +0000210 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000211 Out << __FUNCTION__ << "\n";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000212 }
213
Chris Lattner5261d0c2009-03-28 19:18:32 +0000214 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
215 SourceLocation DeclStart,
216 Declarator &D, ExprTy *BitfieldWidth) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000217 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000218 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000219 }
220
Chris Lattner5261d0c2009-03-28 19:18:32 +0000221 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
222 Declarator &D, ExprTy *BitfieldWidth,
223 tok::ObjCKeywordKind visibility) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000224 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000225 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000226 }
227
Chris Lattner5261d0c2009-03-28 19:18:32 +0000228 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
229 DeclPtrTy *Fields, unsigned NumFields,
Daniel Dunbarf3944442008-10-03 02:03:53 +0000230 SourceLocation LBrac, SourceLocation RBrac,
231 AttributeList *AttrList) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000232 Out << __FUNCTION__ << "\n";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000233 }
234
Chris Lattner5261d0c2009-03-28 19:18:32 +0000235 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
236 DeclPtrTy LastEnumConstant,
237 SourceLocation IdLoc,IdentifierInfo *Id,
238 SourceLocation EqualLoc, ExprTy *Val) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000239 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000240 return DeclPtrTy();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000241 }
242
Mike Stump155750e2009-05-16 07:06:02 +0000243 virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
244 SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
Chris Lattner5261d0c2009-03-28 19:18:32 +0000245 DeclPtrTy *Elements, unsigned NumElements) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000246 Out << __FUNCTION__ << "\n";
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000247 }
248
Mike Stump155750e2009-05-16 07:06:02 +0000249 //===------------------------------------------------------------------===//
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000250 // Statement Parsing Callbacks.
Mike Stump155750e2009-05-16 07:06:02 +0000251 //===------------------------------------------------------------------===//
Sebastian Redl76b9ddb2008-12-21 12:04:03 +0000252
253 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000254 Out << __FUNCTION__ << "\n";
Sebastian Redl76b9ddb2008-12-21 12:04:03 +0000255 return StmtEmpty();
256 }
257
258 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
259 SourceLocation R,
260 MultiStmtArg Elts,
261 bool isStmtExpr) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000262 Out << __FUNCTION__ << "\n";
Sebastian Redl76b9ddb2008-12-21 12:04:03 +0000263 return StmtEmpty();
264 }
Chris Lattnera17991f2009-03-29 16:50:03 +0000265 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redl76b9ddb2008-12-21 12:04:03 +0000266 SourceLocation StartLoc,
267 SourceLocation EndLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000268 Out << __FUNCTION__ << "\n";
Sebastian Redl76b9ddb2008-12-21 12:04:03 +0000269 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000270 }
271
Anders Carlsson18ca4772009-05-17 21:11:30 +0000272 virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000273 Out << __FUNCTION__ << "\n";
Anders Carlsson18ca4772009-05-17 21:11:30 +0000274 return OwningStmtResult(*this, Expr->release());
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000275 }
276
277 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
278 /// which can specify an RHS value.
Sebastian Redl0a23e8f2008-12-28 16:13:43 +0000279 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
280 ExprArg LHSVal,
281 SourceLocation DotDotDotLoc,
282 ExprArg RHSVal,
Chris Lattnerdaac6942009-03-04 04:23:07 +0000283 SourceLocation ColonLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000284 Out << __FUNCTION__ << "\n";
Sebastian Redl0a23e8f2008-12-28 16:13:43 +0000285 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000286 }
Sebastian Redl0a23e8f2008-12-28 16:13:43 +0000287 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
288 SourceLocation ColonLoc,
289 StmtArg SubStmt, Scope *CurScope){
Eli Friedman4ae15b92009-05-19 01:02:07 +0000290 Out << __FUNCTION__ << "\n";
Sebastian Redl0a23e8f2008-12-28 16:13:43 +0000291 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000292 }
Sebastian Redl2437ec62009-01-11 00:38:46 +0000293
294 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
295 IdentifierInfo *II,
296 SourceLocation ColonLoc,
297 StmtArg SubStmt) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000298 Out << __FUNCTION__ << "\n";
Sebastian Redl2437ec62009-01-11 00:38:46 +0000299 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000300 }
Sebastian Redl2437ec62009-01-11 00:38:46 +0000301
Anders Carlssone4d37892009-05-17 18:26:53 +0000302 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
303 FullExprArg CondVal, StmtArg ThenVal,
304 SourceLocation ElseLoc,
Sebastian Redl2437ec62009-01-11 00:38:46 +0000305 StmtArg ElseVal) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000306 Out << __FUNCTION__ << "\n";
Sebastian Redl2437ec62009-01-11 00:38:46 +0000307 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000308 }
Sebastian Redl2437ec62009-01-11 00:38:46 +0000309
310 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000311 Out << __FUNCTION__ << "\n";
Sebastian Redl2437ec62009-01-11 00:38:46 +0000312 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000313 }
Sebastian Redl2437ec62009-01-11 00:38:46 +0000314
315 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
316 StmtArg Switch,
317 StmtArg Body) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000318 Out << __FUNCTION__ << "\n";
Sebastian Redl2437ec62009-01-11 00:38:46 +0000319 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000320 }
321
Sebastian Redl19c74d32009-01-16 23:28:06 +0000322 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Anders Carlsson3ee2dae2009-05-17 21:22:26 +0000323 FullExprArg Cond, StmtArg Body) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000324 Out << __FUNCTION__ << "\n";
Sebastian Redl19c74d32009-01-16 23:28:06 +0000325 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000326 }
Sebastian Redl19c74d32009-01-16 23:28:06 +0000327 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
328 SourceLocation WhileLoc, ExprArg Cond){
Eli Friedman4ae15b92009-05-19 01:02:07 +0000329 Out << __FUNCTION__ << "\n";
Sebastian Redl19c74d32009-01-16 23:28:06 +0000330 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000331 }
Sebastian Redl19c74d32009-01-16 23:28:06 +0000332 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
333 SourceLocation LParenLoc,
334 StmtArg First, ExprArg Second,
335 ExprArg Third, SourceLocation RParenLoc,
336 StmtArg Body) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000337 Out << __FUNCTION__ << "\n";
Sebastian Redl19c74d32009-01-16 23:28:06 +0000338 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000339 }
Sebastian Redl19c74d32009-01-16 23:28:06 +0000340 virtual OwningStmtResult ActOnObjCForCollectionStmt(
341 SourceLocation ForColLoc,
342 SourceLocation LParenLoc,
343 StmtArg First, ExprArg Second,
344 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000345 Out << __FUNCTION__ << "\n";
Sebastian Redl19c74d32009-01-16 23:28:06 +0000346 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000347 }
Sebastian Redl539eb572009-01-18 13:19:59 +0000348 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
349 SourceLocation LabelLoc,
350 IdentifierInfo *LabelII) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000351 Out << __FUNCTION__ << "\n";
Sebastian Redl539eb572009-01-18 13:19:59 +0000352 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000353 }
Sebastian Redl539eb572009-01-18 13:19:59 +0000354 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
355 SourceLocation StarLoc,
356 ExprArg DestExp) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000357 Out << __FUNCTION__ << "\n";
Sebastian Redl539eb572009-01-18 13:19:59 +0000358 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000359 }
Sebastian Redl539eb572009-01-18 13:19:59 +0000360 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
361 Scope *CurScope) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000362 Out << __FUNCTION__ << "\n";
Sebastian Redl539eb572009-01-18 13:19:59 +0000363 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000364 }
Sebastian Redl539eb572009-01-18 13:19:59 +0000365 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
366 Scope *CurScope) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000367 Out << __FUNCTION__ << "\n";
Sebastian Redl539eb572009-01-18 13:19:59 +0000368 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000369 }
Sebastian Redl539eb572009-01-18 13:19:59 +0000370 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
371 ExprArg RetValExp) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000372 Out << __FUNCTION__ << "\n";
Sebastian Redl539eb572009-01-18 13:19:59 +0000373 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000374 }
Sebastian Redlc6b86332009-01-18 16:53:17 +0000375 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stump155750e2009-05-16 07:06:02 +0000376 bool IsSimple,
Sebastian Redlc6b86332009-01-18 16:53:17 +0000377 bool IsVolatile,
378 unsigned NumOutputs,
379 unsigned NumInputs,
380 std::string *Names,
381 MultiExprArg Constraints,
382 MultiExprArg Exprs,
383 ExprArg AsmString,
384 MultiExprArg Clobbers,
385 SourceLocation RParenLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000386 Out << __FUNCTION__ << "\n";
Sebastian Redlc6b86332009-01-18 16:53:17 +0000387 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000388 }
Sebastian Redlc6b86332009-01-18 16:53:17 +0000389
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000390 // Objective-c statements
Sebastian Redlb3860a72009-01-18 17:43:11 +0000391 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
392 SourceLocation RParen,
Chris Lattner5261d0c2009-03-28 19:18:32 +0000393 DeclPtrTy Parm, StmtArg Body,
Sebastian Redlb3860a72009-01-18 17:43:11 +0000394 StmtArg CatchList) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000395 Out << __FUNCTION__ << "\n";
Sebastian Redlb3860a72009-01-18 17:43:11 +0000396 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000397 }
Sebastian Redlb3860a72009-01-18 17:43:11 +0000398
399 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
400 StmtArg Body) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000401 Out << __FUNCTION__ << "\n";
Sebastian Redlb3860a72009-01-18 17:43:11 +0000402 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000403 }
Sebastian Redlb3860a72009-01-18 17:43:11 +0000404
405 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
406 StmtArg Try, StmtArg Catch,
407 StmtArg Finally) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000408 Out << __FUNCTION__ << "\n";
Sebastian Redlb3860a72009-01-18 17:43:11 +0000409 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000410 }
Sebastian Redlb3860a72009-01-18 17:43:11 +0000411
412 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroff590fe482009-02-11 20:05:44 +0000413 ExprArg Throw,
414 Scope *CurScope) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000415 Out << __FUNCTION__ << "\n";
Sebastian Redlb3860a72009-01-18 17:43:11 +0000416 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000417 }
Sebastian Redlb3860a72009-01-18 17:43:11 +0000418
419 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
420 ExprArg SynchExpr,
421 StmtArg SynchBody) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000422 Out << __FUNCTION__ << "\n";
Sebastian Redlb3860a72009-01-18 17:43:11 +0000423 return StmtEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000424 }
Sebastian Redlb12ac332008-12-21 16:41:36 +0000425
426 // C++ Statements
Chris Lattner5261d0c2009-03-28 19:18:32 +0000427 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000428 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000429 return DeclPtrTy();
Sebastian Redlb12ac332008-12-21 16:41:36 +0000430 }
431
432 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattner5261d0c2009-03-28 19:18:32 +0000433 DeclPtrTy ExceptionDecl,
Sebastian Redlb12ac332008-12-21 16:41:36 +0000434 StmtArg HandlerBlock) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000435 Out << __FUNCTION__ << "\n";
Sebastian Redlb12ac332008-12-21 16:41:36 +0000436 return StmtEmpty();
437 }
438
439 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
440 StmtArg TryBlock,
441 MultiStmtArg Handlers) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000442 Out << __FUNCTION__ << "\n";
Sebastian Redlb12ac332008-12-21 16:41:36 +0000443 return StmtEmpty();
444 }
445
Mike Stump155750e2009-05-16 07:06:02 +0000446 //===------------------------------------------------------------------===//
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000447 // Expression Parsing Callbacks.
Mike Stump155750e2009-05-16 07:06:02 +0000448 //===------------------------------------------------------------------===//
Sebastian Redlcd883f72009-01-18 18:53:16 +0000449
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000450 // Primary Expressions.
Sebastian Redlcd883f72009-01-18 18:53:16 +0000451
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000452 /// ActOnIdentifierExpr - Parse an identifier in expression context.
453 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
454 /// token immediately after it.
Sebastian Redlcd883f72009-01-18 18:53:16 +0000455 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
456 IdentifierInfo &II,
457 bool HasTrailingLParen,
Sebastian Redl0c9da212009-02-03 20:19:35 +0000458 const CXXScopeSpec *SS,
459 bool isAddressOfOperand) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000460 Out << __FUNCTION__ << "\n";
Sebastian Redlcd883f72009-01-18 18:53:16 +0000461 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000462 }
463
Sebastian Redlcd883f72009-01-18 18:53:16 +0000464 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
465 Scope *S, SourceLocation OperatorLoc,
466 OverloadedOperatorKind Op,
Sebastian Redl0c9da212009-02-03 20:19:35 +0000467 bool HasTrailingLParen, const CXXScopeSpec &SS,
468 bool isAddressOfOperand) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000469 Out << __FUNCTION__ << "\n";
Sebastian Redlcd883f72009-01-18 18:53:16 +0000470 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000471 }
472
Sebastian Redlcd883f72009-01-18 18:53:16 +0000473 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
474 Scope *S, SourceLocation OperatorLoc,
475 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redl0c9da212009-02-03 20:19:35 +0000476 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000477 Out << __FUNCTION__ << "\n";
Sebastian Redlcd883f72009-01-18 18:53:16 +0000478 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000479 }
Sebastian Redlcd883f72009-01-18 18:53:16 +0000480
481 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
482 tok::TokenKind Kind) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000483 Out << __FUNCTION__ << "\n";
Sebastian Redlcd883f72009-01-18 18:53:16 +0000484 return ExprEmpty();
485 }
486
487 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000488 Out << __FUNCTION__ << "\n";
Sebastian Redlcd883f72009-01-18 18:53:16 +0000489 return ExprEmpty();
490 }
491
492 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000493 Out << __FUNCTION__ << "\n";
Sebastian Redlcd883f72009-01-18 18:53:16 +0000494 return ExprEmpty();
495 }
496
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000497 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
498 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd883f72009-01-18 18:53:16 +0000499 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
500 unsigned NumToks) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000501 Out << __FUNCTION__ << "\n";
Sebastian Redlcd883f72009-01-18 18:53:16 +0000502 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000503 }
Sebastian Redlcd883f72009-01-18 18:53:16 +0000504
505 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
506 ExprArg Val) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000507 Out << __FUNCTION__ << "\n";
Sebastian Redl81db6682009-02-05 15:02:23 +0000508 return move(Val); // Default impl returns operand.
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000509 }
Sebastian Redlcd883f72009-01-18 18:53:16 +0000510
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000511 // Postfix Expressions.
Sebastian Redl8b769972009-01-19 00:08:26 +0000512 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
513 tok::TokenKind Kind,
514 ExprArg Input) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000515 Out << __FUNCTION__ << "\n";
Sebastian Redl8b769972009-01-19 00:08:26 +0000516 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000517 }
Sebastian Redl8b769972009-01-19 00:08:26 +0000518 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
519 SourceLocation LLoc,
520 ExprArg Idx,
521 SourceLocation RLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000522 Out << __FUNCTION__ << "\n";
Sebastian Redl8b769972009-01-19 00:08:26 +0000523 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000524 }
Sebastian Redl8b769972009-01-19 00:08:26 +0000525 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
526 SourceLocation OpLoc,
527 tok::TokenKind OpKind,
528 SourceLocation MemberLoc,
Fariborz Jahanian0cc2ac12009-03-04 22:30:12 +0000529 IdentifierInfo &Member,
Chris Lattner5261d0c2009-03-28 19:18:32 +0000530 DeclPtrTy ImplDecl) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000531 Out << __FUNCTION__ << "\n";
Sebastian Redl8b769972009-01-19 00:08:26 +0000532 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000533 }
Sebastian Redl8b769972009-01-19 00:08:26 +0000534
535 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
536 SourceLocation LParenLoc,
537 MultiExprArg Args,
538 SourceLocation *CommaLocs,
539 SourceLocation RParenLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000540 Out << __FUNCTION__ << "\n";
Sebastian Redl8b769972009-01-19 00:08:26 +0000541 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000542 }
Sebastian Redl8b769972009-01-19 00:08:26 +0000543
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000544 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl8b769972009-01-19 00:08:26 +0000545 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
546 tok::TokenKind Op, ExprArg Input) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000547 Out << __FUNCTION__ << "\n";
Sebastian Redl8b769972009-01-19 00:08:26 +0000548 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000549 }
Sebastian Redl8b769972009-01-19 00:08:26 +0000550 virtual OwningExprResult
551 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
552 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000553 Out << __FUNCTION__ << "\n";
Sebastian Redl8b769972009-01-19 00:08:26 +0000554 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000555 }
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000556
557 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
558 TypeTy *Ty,
559 SourceLocation RParen,
560 ExprArg Op) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000561 Out << __FUNCTION__ << "\n";
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000562 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000563 }
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000564 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
565 MultiExprArg InitList,
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000566 SourceLocation RParenLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000567 Out << __FUNCTION__ << "\n";
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000568 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000569 }
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000570 virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
571 SourceLocation RParenLoc,ExprArg Op){
Eli Friedman4ae15b92009-05-19 01:02:07 +0000572 Out << __FUNCTION__ << "\n";
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000573 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000574 }
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000575
576 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
577 tok::TokenKind Kind,
578 ExprArg LHS, ExprArg RHS) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000579 Out << __FUNCTION__ << "\n";
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000580 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000581 }
582
583 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
584 /// in the case of a the GNU conditional expr extension.
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000585 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
586 SourceLocation ColonLoc,
587 ExprArg Cond, ExprArg LHS,
588 ExprArg RHS) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000589 Out << __FUNCTION__ << "\n";
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000590 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000591 }
Sebastian Redl5457c5e2009-01-19 22:31:54 +0000592
593 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000594
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000595 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
596 SourceLocation LabLoc,
597 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedman4ae15b92009-05-19 01:02:07 +0000598 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000599 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000600 }
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000601
602 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
603 StmtArg SubStmt,
604 SourceLocation RPLoc) { // "({..})"
Eli Friedman4ae15b92009-05-19 01:02:07 +0000605 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000606 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000607 }
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000608
609 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
610 SourceLocation BuiltinLoc,
611 SourceLocation TypeLoc,
612 TypeTy *Arg1,
613 OffsetOfComponent *CompPtr,
614 unsigned NumComponents,
615 SourceLocation RParenLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000616 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000617 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000618 }
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000619
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000620 // __builtin_types_compatible_p(type1, type2)
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000621 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
622 TypeTy *arg1,TypeTy *arg2,
623 SourceLocation RPLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000624 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000625 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000626 }
627 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000628 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
629 ExprArg cond, ExprArg expr1,
630 ExprArg expr2,
631 SourceLocation RPLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000632 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000633 return ExprEmpty();
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000634 }
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000635
636 // __builtin_va_arg(expr, type)
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000637 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
638 ExprArg expr, TypeTy *type,
Daniel Dunbar6a4d56d2008-08-01 00:41:12 +0000639 SourceLocation RPLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000640 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000641 return ExprEmpty();
642 }
643
644 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000645 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000646 return ExprEmpty();
647 }
648
649 virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000650 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000651 }
652
653 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000654 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000655 }
656
657 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000658 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000659 }
660
661 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
662 StmtArg Body,
663 Scope *CurScope) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000664 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000665 return ExprEmpty();
666 }
667
Chris Lattner5261d0c2009-03-28 19:18:32 +0000668 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
669 IdentifierInfo *Ident,
670 SourceLocation LBrace) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000671 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000672 return DeclPtrTy();
Chris Lattner4b009652007-07-25 00:24:17 +0000673 }
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000674
Chris Lattner5261d0c2009-03-28 19:18:32 +0000675 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000676 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000677 return;
678 }
679
680#if 0
681 // FIXME: AttrList should be deleted by this function, but the definition
682 // would have to be available.
Chris Lattner5261d0c2009-03-28 19:18:32 +0000683 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
684 SourceLocation UsingLoc,
685 SourceLocation NamespcLoc,
686 const CXXScopeSpec &SS,
687 SourceLocation IdentLoc,
688 IdentifierInfo *NamespcName,
689 AttributeList *AttrList) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000690 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000691 return DeclPtrTy();
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000692 }
693#endif
694
Chris Lattner5261d0c2009-03-28 19:18:32 +0000695 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000696 SourceLocation EqualLoc,
697 ExprArg defarg) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000698 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000699 }
700
Chris Lattner5261d0c2009-03-28 19:18:32 +0000701 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000702 SourceLocation EqualLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000703 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000704 }
705
Chris Lattner5261d0c2009-03-28 19:18:32 +0000706 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000707 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000708 }
709
Chris Lattner5261d0c2009-03-28 19:18:32 +0000710 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000711 SourceLocation LParenLoc,
712 MultiExprArg Exprs,
713 SourceLocation *CommaLocs,
714 SourceLocation RParenLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000715 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000716 return;
717 }
718
Chris Lattner5261d0c2009-03-28 19:18:32 +0000719 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
720 DeclPtrTy Method)
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000721 {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000722 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000723 }
724
Chris Lattner5261d0c2009-03-28 19:18:32 +0000725 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000726 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000727 }
728
729 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattner5261d0c2009-03-28 19:18:32 +0000730 DeclPtrTy Method) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000731 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000732 }
733
Chris Lattner5261d0c2009-03-28 19:18:32 +0000734 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
735 ExprArg AssertExpr,
736 ExprArg AssertMessageExpr) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000737 Out << __FUNCTION__ << "\n";
Chris Lattner5261d0c2009-03-28 19:18:32 +0000738 return DeclPtrTy();
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000739 }
740
741 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
742 tok::TokenKind Kind,
743 SourceLocation LAngleBracketLoc,
744 TypeTy *Ty,
745 SourceLocation RAngleBracketLoc,
746 SourceLocation LParenLoc,
747 ExprArg Op,
748 SourceLocation RParenLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000749 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000750 return ExprEmpty();
751 }
752
753 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
754 SourceLocation LParenLoc,
755 bool isType, void *TyOrExpr,
756 SourceLocation RParenLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000757 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000758 return ExprEmpty();
759 }
760
761 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000762 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000763 return ExprEmpty();
764 }
765
766 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
767 tok::TokenKind Kind) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000768 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000769 return ExprEmpty();
770 }
771
772 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000773 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000774 return ExprEmpty();
775 }
776
777 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
778 TypeTy *TypeRep,
779 SourceLocation LParenLoc,
780 MultiExprArg Exprs,
781 SourceLocation *CommaLocs,
782 SourceLocation RParenLoc) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000783 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000784 return ExprEmpty();
785 }
786
787 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
788 SourceLocation StartLoc,
789 Declarator &D,
790 SourceLocation EqualLoc,
791 ExprArg AssignExprVal) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000792 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000793 return ExprEmpty();
794 }
795
796 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
797 bool UseGlobal,
798 SourceLocation PlacementLParen,
799 MultiExprArg PlacementArgs,
800 SourceLocation PlacementRParen,
801 bool ParenTypeId, Declarator &D,
802 SourceLocation ConstructorLParen,
803 MultiExprArg ConstructorArgs,
804 SourceLocation ConstructorRParen) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000805 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000806 return ExprEmpty();
807 }
808
809 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
810 bool UseGlobal, bool ArrayForm,
811 ExprArg Operand) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000812 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000813 return ExprEmpty();
814 }
815
816 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
817 SourceLocation KWLoc,
818 SourceLocation LParen,
819 TypeTy *Ty,
820 SourceLocation RParen) {
Eli Friedman4ae15b92009-05-19 01:02:07 +0000821 Out << __FUNCTION__ << "\n";
Sebastian Redl76bb8ec2009-03-15 17:47:39 +0000822 return ExprEmpty();
823 }
Chris Lattner4b009652007-07-25 00:24:17 +0000824 };
825}
826
Eli Friedman4ae15b92009-05-19 01:02:07 +0000827MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
828 llvm::raw_ostream* OS) {
829 return new ParserPrintActions(PP, *OS);
Chris Lattner4b009652007-07-25 00:24:17 +0000830}