blob: 170ab5e33f5a3ed1ca9bb5ff0f48a51d48aa9c96 [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";
Reid Spencer5f016e22007-07-11 17:01:13 +000042
43 // 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,
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 Lattnerb28317a2009-03-28 19:18:32 +000080 Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
81 IdentifierInfo **IdentList,
82 unsigned NumElts) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000083 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-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 Lattnerb28317a2009-03-28 19:18:32 +000094 virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000095 Out << __FUNCTION__ << " ";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000096 if (IdentifierInfo *II = D.getIdentifier()) {
Eli Friedmanf54fce82009-05-19 01:02:07 +000097 Out << "'" << II->getName() << "'";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +000098 } else {
Eli Friedmanf54fce82009-05-19 01:02:07 +000099 Out << "<anon>";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000100 }
Eli Friedmanf54fce82009-05-19 01:02:07 +0000101 Out << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000102 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-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.
Anders Carlssonf5dcd382009-05-30 21:37:25 +0000112 virtual void AddInitializerToDecl(DeclPtrTy Dcl, FullExprArg Init) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000113 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000114 }
115
Chris Lattner682bf922009-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.
Eli Friedmanc1dc6532009-05-29 01:49:24 +0000119 virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec& DS,
120 DeclPtrTy *Group,
Chris Lattner682bf922009-03-29 16:50:03 +0000121 unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000122 Out << __FUNCTION__ << "\n";
Chris Lattner682bf922009-03-29 16:50:03 +0000123 return DeclGroupPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000124 }
125
126 /// ActOnStartOfFunctionDef - This is called at the start of a function
127 /// definition, instead of calling ActOnDeclarator. The Declarator includes
128 /// information about formal arguments that are part of this function.
Chris Lattner682bf922009-03-29 16:50:03 +0000129 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope,
130 Declarator &D){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000131 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000132 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000133 }
134
135 /// ActOnStartOfFunctionDef - This is called at the start of a function
136 /// definition, after the FunctionDecl has already been created.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000137 virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000138 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000139 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000140 }
141
Chris Lattnerb28317a2009-03-28 19:18:32 +0000142 virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000143 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000144 }
145
146 /// ActOnFunctionDefBody - This is called when a function body has completed
147 /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000148 virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000149 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000150 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000151 }
152
Chris Lattnerb28317a2009-03-28 19:18:32 +0000153 virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
154 ExprArg AsmString) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000155 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000156 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000157 }
158
159 /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
160 /// no declarator (e.g. "struct foo;") is parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000161 virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000162 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000163 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000164 }
Douglas Gregore79837a2008-12-17 01:46:43 +0000165
166 /// ActOnLinkageSpec - Parsed a C++ linkage-specification that
167 /// contained braces. Lang/StrSize contains the language string that
168 /// was parsed at location Loc. Decls/NumDecls provides the
169 /// declarations parsed inside the linkage specification.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000170 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
171 SourceLocation LBrace,
172 SourceLocation RBrace, const char *Lang,
173 unsigned StrSize,
174 DeclPtrTy *Decls, unsigned NumDecls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000175 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000176 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000177 }
Douglas Gregore79837a2008-12-17 01:46:43 +0000178
179 /// ActOnLinkageSpec - Parsed a C++ linkage-specification without
180 /// braces. Lang/StrSize contains the language string that was
181 /// parsed at location Loc. D is the declaration parsed.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000182 virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
183 unsigned StrSize, DeclPtrTy D) {
184 return DeclPtrTy();
Douglas Gregore79837a2008-12-17 01:46:43 +0000185 }
186
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000187 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000188 // Type Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000189 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000190
Sebastian Redlcee63fb2008-12-02 14:43:59 +0000191 virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000192 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000193 return TypeResult();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000194 }
195
Chris Lattnerb28317a2009-03-28 19:18:32 +0000196 virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagType, TagKind TK,
197 SourceLocation KWLoc, const CXXScopeSpec &SS,
198 IdentifierInfo *Name, SourceLocation NameLoc,
Douglas Gregor402abb52009-05-28 23:31:59 +0000199 AttributeList *Attr, AccessSpecifier AS,
200 bool &Owned) {
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000201 // TagType is an instance of DeclSpec::TST, indicating what kind of tag this
202 // is (struct/union/enum/class).
Eli Friedmanf54fce82009-05-19 01:02:07 +0000203 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000204 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000205 }
206
207 /// Act on @defs() element found when parsing a structure. ClassName is the
208 /// name of the referenced class.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000209 virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000210 IdentifierInfo *ClassName,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000211 llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000212 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000213 }
214
Chris Lattnerb28317a2009-03-28 19:18:32 +0000215 virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
216 SourceLocation DeclStart,
217 Declarator &D, ExprTy *BitfieldWidth) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000218 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000219 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000220 }
221
Chris Lattnerb28317a2009-03-28 19:18:32 +0000222 virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
Fariborz Jahanian496b5a82009-06-05 18:16:35 +0000223 DeclPtrTy IntfDecl,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000224 Declarator &D, ExprTy *BitfieldWidth,
225 tok::ObjCKeywordKind visibility) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000226 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000227 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000228 }
229
Chris Lattnerb28317a2009-03-28 19:18:32 +0000230 virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
231 DeclPtrTy *Fields, unsigned NumFields,
Daniel Dunbar1bfe1c22008-10-03 02:03:53 +0000232 SourceLocation LBrac, SourceLocation RBrac,
233 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000234 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000235 }
236
Chris Lattnerb28317a2009-03-28 19:18:32 +0000237 virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
238 DeclPtrTy LastEnumConstant,
239 SourceLocation IdLoc,IdentifierInfo *Id,
240 SourceLocation EqualLoc, ExprTy *Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000241 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000242 return DeclPtrTy();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000243 }
244
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000245 virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
246 SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000247 DeclPtrTy *Elements, unsigned NumElements) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000248 Out << __FUNCTION__ << "\n";
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000249 }
250
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000251 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000252 // Statement Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000253 //===------------------------------------------------------------------===//
Sebastian Redla60528c2008-12-21 12:04:03 +0000254
255 virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000256 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000257 return StmtEmpty();
258 }
259
260 virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
261 SourceLocation R,
262 MultiStmtArg Elts,
263 bool isStmtExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000264 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000265 return StmtEmpty();
266 }
Chris Lattner682bf922009-03-29 16:50:03 +0000267 virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
Sebastian Redla60528c2008-12-21 12:04:03 +0000268 SourceLocation StartLoc,
269 SourceLocation EndLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000270 Out << __FUNCTION__ << "\n";
Sebastian Redla60528c2008-12-21 12:04:03 +0000271 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000272 }
273
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000274 virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000275 Out << __FUNCTION__ << "\n";
Anders Carlsson6b1d2832009-05-17 21:11:30 +0000276 return OwningStmtResult(*this, Expr->release());
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000277 }
278
279 /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
280 /// which can specify an RHS value.
Sebastian Redl117054a2008-12-28 16:13:43 +0000281 virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
282 ExprArg LHSVal,
283 SourceLocation DotDotDotLoc,
284 ExprArg RHSVal,
Chris Lattner24e1e702009-03-04 04:23:07 +0000285 SourceLocation ColonLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000286 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000287 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000288 }
Sebastian Redl117054a2008-12-28 16:13:43 +0000289 virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
290 SourceLocation ColonLoc,
291 StmtArg SubStmt, Scope *CurScope){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000292 Out << __FUNCTION__ << "\n";
Sebastian Redl117054a2008-12-28 16:13:43 +0000293 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000294 }
Sebastian Redlde307472009-01-11 00:38:46 +0000295
296 virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
297 IdentifierInfo *II,
298 SourceLocation ColonLoc,
299 StmtArg SubStmt) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000300 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000301 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000302 }
Sebastian Redlde307472009-01-11 00:38:46 +0000303
Anders Carlssona99fad82009-05-17 18:26:53 +0000304 virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
305 FullExprArg CondVal, StmtArg ThenVal,
306 SourceLocation ElseLoc,
Sebastian Redlde307472009-01-11 00:38:46 +0000307 StmtArg ElseVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000308 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000309 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000310 }
Sebastian Redlde307472009-01-11 00:38:46 +0000311
312 virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000313 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000314 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000315 }
Sebastian Redlde307472009-01-11 00:38:46 +0000316
317 virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
318 StmtArg Switch,
319 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000320 Out << __FUNCTION__ << "\n";
Sebastian Redlde307472009-01-11 00:38:46 +0000321 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000322 }
323
Sebastian Redlf05b1522009-01-16 23:28:06 +0000324 virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
Anders Carlsson7f537c12009-05-17 21:22:26 +0000325 FullExprArg Cond, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000326 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000327 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000328 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000329 virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
Chris Lattner98913592009-06-12 23:04:47 +0000330 SourceLocation WhileLoc,
331 SourceLocation LPLoc, ExprArg Cond,
332 SourceLocation RPLoc){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000333 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000334 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000335 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000336 virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
337 SourceLocation LParenLoc,
338 StmtArg First, ExprArg Second,
339 ExprArg Third, SourceLocation RParenLoc,
340 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000341 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000342 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000343 }
Sebastian Redlf05b1522009-01-16 23:28:06 +0000344 virtual OwningStmtResult ActOnObjCForCollectionStmt(
345 SourceLocation ForColLoc,
346 SourceLocation LParenLoc,
347 StmtArg First, ExprArg Second,
348 SourceLocation RParenLoc, StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000349 Out << __FUNCTION__ << "\n";
Sebastian Redlf05b1522009-01-16 23:28:06 +0000350 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000351 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000352 virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
353 SourceLocation LabelLoc,
354 IdentifierInfo *LabelII) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000355 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000356 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000357 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000358 virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
359 SourceLocation StarLoc,
360 ExprArg DestExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000361 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000362 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000363 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000364 virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
365 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000366 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000367 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000368 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000369 virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
370 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000371 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000372 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000373 }
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000374 virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
Anders Carlssona0ab25d2009-05-30 21:42:34 +0000375 FullExprArg RetValExp) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000376 Out << __FUNCTION__ << "\n";
Sebastian Redl4cffe2f2009-01-18 13:19:59 +0000377 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000378 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000379 virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000380 bool IsSimple,
Sebastian Redl3037ed02009-01-18 16:53:17 +0000381 bool IsVolatile,
382 unsigned NumOutputs,
383 unsigned NumInputs,
384 std::string *Names,
385 MultiExprArg Constraints,
386 MultiExprArg Exprs,
387 ExprArg AsmString,
388 MultiExprArg Clobbers,
389 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000390 Out << __FUNCTION__ << "\n";
Sebastian Redl3037ed02009-01-18 16:53:17 +0000391 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000392 }
Sebastian Redl3037ed02009-01-18 16:53:17 +0000393
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000394 // Objective-c statements
Sebastian Redl431e90e2009-01-18 17:43:11 +0000395 virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
396 SourceLocation RParen,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000397 DeclPtrTy Parm, StmtArg Body,
Sebastian Redl431e90e2009-01-18 17:43:11 +0000398 StmtArg CatchList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000399 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000400 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000401 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000402
403 virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
404 StmtArg Body) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000405 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000406 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000407 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000408
409 virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
410 StmtArg Try, StmtArg Catch,
411 StmtArg Finally) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000412 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000413 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000414 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000415
416 virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
Steve Naroffe21dd6f2009-02-11 20:05:44 +0000417 ExprArg Throw,
418 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000419 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000420 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000421 }
Sebastian Redl431e90e2009-01-18 17:43:11 +0000422
423 virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
424 ExprArg SynchExpr,
425 StmtArg SynchBody) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000426 Out << __FUNCTION__ << "\n";
Sebastian Redl431e90e2009-01-18 17:43:11 +0000427 return StmtEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000428 }
Sebastian Redla0fd8652008-12-21 16:41:36 +0000429
430 // C++ Statements
Chris Lattnerb28317a2009-03-28 19:18:32 +0000431 virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000432 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000433 return DeclPtrTy();
Sebastian Redla0fd8652008-12-21 16:41:36 +0000434 }
435
436 virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000437 DeclPtrTy ExceptionDecl,
Sebastian Redla0fd8652008-12-21 16:41:36 +0000438 StmtArg HandlerBlock) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000439 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000440 return StmtEmpty();
441 }
442
443 virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
444 StmtArg TryBlock,
445 MultiStmtArg Handlers) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000446 Out << __FUNCTION__ << "\n";
Sebastian Redla0fd8652008-12-21 16:41:36 +0000447 return StmtEmpty();
448 }
449
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000450 //===------------------------------------------------------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000451 // Expression Parsing Callbacks.
Mike Stumpc6e35aa2009-05-16 07:06:02 +0000452 //===------------------------------------------------------------------===//
Sebastian Redlcd965b92009-01-18 18:53:16 +0000453
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000454 // Primary Expressions.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000455
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000456 /// ActOnIdentifierExpr - Parse an identifier in expression context.
457 /// 'HasTrailingLParen' indicates whether or not the identifier has a '('
458 /// token immediately after it.
Sebastian Redlcd965b92009-01-18 18:53:16 +0000459 virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
460 IdentifierInfo &II,
461 bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000462 const CXXScopeSpec *SS,
463 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000464 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000465 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000466 }
467
Sebastian Redlcd965b92009-01-18 18:53:16 +0000468 virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
469 Scope *S, SourceLocation OperatorLoc,
470 OverloadedOperatorKind Op,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000471 bool HasTrailingLParen, const CXXScopeSpec &SS,
472 bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000473 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000474 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000475 }
476
Sebastian Redlcd965b92009-01-18 18:53:16 +0000477 virtual OwningExprResult ActOnCXXConversionFunctionExpr(
478 Scope *S, SourceLocation OperatorLoc,
479 TypeTy *Type, bool HasTrailingLParen,
Sebastian Redlebc07d52009-02-03 20:19:35 +0000480 const CXXScopeSpec &SS,bool isAddressOfOperand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000481 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000482 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000483 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000484
485 virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
486 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000487 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000488 return ExprEmpty();
489 }
490
491 virtual OwningExprResult ActOnCharacterConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000492 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000493 return ExprEmpty();
494 }
495
496 virtual OwningExprResult ActOnNumericConstant(const Token &) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000497 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000498 return ExprEmpty();
499 }
500
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000501 /// ActOnStringLiteral - The specified tokens were lexed as pasted string
502 /// fragments (e.g. "foo" "bar" L"baz").
Sebastian Redlcd965b92009-01-18 18:53:16 +0000503 virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
504 unsigned NumToks) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000505 Out << __FUNCTION__ << "\n";
Sebastian Redlcd965b92009-01-18 18:53:16 +0000506 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000507 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000508
509 virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
510 ExprArg Val) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000511 Out << __FUNCTION__ << "\n";
Sebastian Redl76ad2e82009-02-05 15:02:23 +0000512 return move(Val); // Default impl returns operand.
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000513 }
Sebastian Redlcd965b92009-01-18 18:53:16 +0000514
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000515 // Postfix Expressions.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000516 virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
517 tok::TokenKind Kind,
518 ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000519 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000520 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000521 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000522 virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
523 SourceLocation LLoc,
524 ExprArg Idx,
525 SourceLocation RLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000526 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000527 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000528 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000529 virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
530 SourceLocation OpLoc,
531 tok::TokenKind OpKind,
532 SourceLocation MemberLoc,
Fariborz Jahaniana6e3ac52009-03-04 22:30:12 +0000533 IdentifierInfo &Member,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000534 DeclPtrTy ImplDecl) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000535 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000536 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000537 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000538
539 virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
540 SourceLocation LParenLoc,
541 MultiExprArg Args,
542 SourceLocation *CommaLocs,
543 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000544 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000545 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000546 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000547
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000548 // Unary Operators. 'Tok' is the token for the operator.
Sebastian Redl0eb23302009-01-19 00:08:26 +0000549 virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
550 tok::TokenKind Op, ExprArg Input) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000551 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000552 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000553 }
Sebastian Redl0eb23302009-01-19 00:08:26 +0000554 virtual OwningExprResult
555 ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
556 void *TyOrEx, const SourceRange &ArgRange) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000557 Out << __FUNCTION__ << "\n";
Sebastian Redl0eb23302009-01-19 00:08:26 +0000558 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000559 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000560
561 virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
562 TypeTy *Ty,
563 SourceLocation RParen,
564 ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000565 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000566 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000567 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000568 virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
569 MultiExprArg InitList,
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000570 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000571 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000572 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000573 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000574 virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty,
575 SourceLocation RParenLoc,ExprArg Op){
Eli Friedmanf54fce82009-05-19 01:02:07 +0000576 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000577 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000578 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000579
580 virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
581 tok::TokenKind Kind,
582 ExprArg LHS, ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000583 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000584 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000585 }
586
587 /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
588 /// in the case of a the GNU conditional expr extension.
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000589 virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
590 SourceLocation ColonLoc,
591 ExprArg Cond, ExprArg LHS,
592 ExprArg RHS) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000593 Out << __FUNCTION__ << "\n";
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000594 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000595 }
Sebastian Redlb8a6aca2009-01-19 22:31:54 +0000596
597 //===--------------------- GNU Extension Expressions ------------------===//
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000598
Sebastian Redlf53597f2009-03-15 17:47:39 +0000599 virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
600 SourceLocation LabLoc,
601 IdentifierInfo *LabelII) {// "&&foo"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000602 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000603 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000604 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000605
606 virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
607 StmtArg SubStmt,
608 SourceLocation RPLoc) { // "({..})"
Eli Friedmanf54fce82009-05-19 01:02:07 +0000609 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000610 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000611 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000612
613 virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
614 SourceLocation BuiltinLoc,
615 SourceLocation TypeLoc,
616 TypeTy *Arg1,
617 OffsetOfComponent *CompPtr,
618 unsigned NumComponents,
619 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000620 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000621 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000622 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000623
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000624 // __builtin_types_compatible_p(type1, type2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000625 virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
626 TypeTy *arg1,TypeTy *arg2,
627 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000628 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000629 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000630 }
631 // __builtin_choose_expr(constExpr, expr1, expr2)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000632 virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
633 ExprArg cond, ExprArg expr1,
634 ExprArg expr2,
635 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000636 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000637 return ExprEmpty();
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000638 }
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000639
640 // __builtin_va_arg(expr, type)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000641 virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
642 ExprArg expr, TypeTy *type,
Daniel Dunbarbb8f4e62008-08-01 00:41:12 +0000643 SourceLocation RPLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000644 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000645 return ExprEmpty();
646 }
647
648 virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
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 void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000654 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000655 }
656
657 virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000658 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000659 }
660
661 virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000662 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000663 }
664
665 virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
666 StmtArg Body,
667 Scope *CurScope) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000668 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000669 return ExprEmpty();
670 }
671
Chris Lattnerb28317a2009-03-28 19:18:32 +0000672 virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
673 IdentifierInfo *Ident,
674 SourceLocation LBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000675 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000676 return DeclPtrTy();
Reid Spencer5f016e22007-07-11 17:01:13 +0000677 }
Sebastian Redlf53597f2009-03-15 17:47:39 +0000678
Chris Lattnerb28317a2009-03-28 19:18:32 +0000679 virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000680 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000681 return;
682 }
683
684#if 0
685 // FIXME: AttrList should be deleted by this function, but the definition
686 // would have to be available.
Chris Lattnerb28317a2009-03-28 19:18:32 +0000687 virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
688 SourceLocation UsingLoc,
689 SourceLocation NamespcLoc,
690 const CXXScopeSpec &SS,
691 SourceLocation IdentLoc,
692 IdentifierInfo *NamespcName,
693 AttributeList *AttrList) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000694 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000695 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000696 }
697#endif
698
Chris Lattnerb28317a2009-03-28 19:18:32 +0000699 virtual void ActOnParamDefaultArgument(DeclPtrTy param,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000700 SourceLocation EqualLoc,
701 ExprArg defarg) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000702 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000703 }
704
Chris Lattnerb28317a2009-03-28 19:18:32 +0000705 virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
Anders Carlsson5e300d12009-06-12 16:51:40 +0000706 SourceLocation EqualLoc,
707 SourceLocation ArgLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000708 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000709 }
710
Chris Lattnerb28317a2009-03-28 19:18:32 +0000711 virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000712 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000713 }
714
Chris Lattnerb28317a2009-03-28 19:18:32 +0000715 virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
Sebastian Redlf53597f2009-03-15 17:47:39 +0000716 SourceLocation LParenLoc,
717 MultiExprArg Exprs,
718 SourceLocation *CommaLocs,
719 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000720 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000721 return;
722 }
723
Chris Lattnerb28317a2009-03-28 19:18:32 +0000724 virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
725 DeclPtrTy Method)
Sebastian Redlf53597f2009-03-15 17:47:39 +0000726 {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000727 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000728 }
729
Chris Lattnerb28317a2009-03-28 19:18:32 +0000730 virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000731 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000732 }
733
734 virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
Chris Lattnerb28317a2009-03-28 19:18:32 +0000735 DeclPtrTy Method) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000736 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000737 }
738
Chris Lattnerb28317a2009-03-28 19:18:32 +0000739 virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
740 ExprArg AssertExpr,
741 ExprArg AssertMessageExpr) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000742 Out << __FUNCTION__ << "\n";
Chris Lattnerb28317a2009-03-28 19:18:32 +0000743 return DeclPtrTy();
Sebastian Redlf53597f2009-03-15 17:47:39 +0000744 }
745
746 virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
747 tok::TokenKind Kind,
748 SourceLocation LAngleBracketLoc,
749 TypeTy *Ty,
750 SourceLocation RAngleBracketLoc,
751 SourceLocation LParenLoc,
752 ExprArg Op,
753 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000754 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000755 return ExprEmpty();
756 }
757
758 virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
759 SourceLocation LParenLoc,
760 bool isType, void *TyOrExpr,
761 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000762 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000763 return ExprEmpty();
764 }
765
766 virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000767 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000768 return ExprEmpty();
769 }
770
771 virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
772 tok::TokenKind Kind) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000773 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000774 return ExprEmpty();
775 }
776
777 virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000778 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000779 return ExprEmpty();
780 }
781
782 virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
783 TypeTy *TypeRep,
784 SourceLocation LParenLoc,
785 MultiExprArg Exprs,
786 SourceLocation *CommaLocs,
787 SourceLocation RParenLoc) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000788 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000789 return ExprEmpty();
790 }
791
792 virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
793 SourceLocation StartLoc,
794 Declarator &D,
795 SourceLocation EqualLoc,
796 ExprArg AssignExprVal) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000797 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000798 return ExprEmpty();
799 }
800
801 virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
802 bool UseGlobal,
803 SourceLocation PlacementLParen,
804 MultiExprArg PlacementArgs,
805 SourceLocation PlacementRParen,
806 bool ParenTypeId, Declarator &D,
807 SourceLocation ConstructorLParen,
808 MultiExprArg ConstructorArgs,
809 SourceLocation ConstructorRParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000810 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000811 return ExprEmpty();
812 }
813
814 virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
815 bool UseGlobal, bool ArrayForm,
816 ExprArg Operand) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000817 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000818 return ExprEmpty();
819 }
820
821 virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
822 SourceLocation KWLoc,
823 SourceLocation LParen,
824 TypeTy *Ty,
825 SourceLocation RParen) {
Eli Friedmanf54fce82009-05-19 01:02:07 +0000826 Out << __FUNCTION__ << "\n";
Sebastian Redlf53597f2009-03-15 17:47:39 +0000827 return ExprEmpty();
828 }
Reid Spencer5f016e22007-07-11 17:01:13 +0000829 };
830}
831
Eli Friedmanf54fce82009-05-19 01:02:07 +0000832MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
833 llvm::raw_ostream* OS) {
834 return new ParserPrintActions(PP, *OS);
Reid Spencer5f016e22007-07-11 17:01:13 +0000835}