Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 1 | //===--- PrintParserActions.cpp - Implement -parse-print-callbacks mode ---===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 0bc735f | 2007-12-29 19:59:25 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 7 | // |
| 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 Friedman | b09f6e1 | 2009-05-19 04:14:29 +0000 | [diff] [blame] | 15 | #include "clang/Frontend/Utils.h" |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 16 | #include "clang/Parse/Action.h" |
| 17 | #include "clang/Parse/DeclSpec.h" |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 18 | #include "llvm/Support/raw_ostream.h" |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 19 | using namespace clang; |
| 20 | |
| 21 | namespace { |
| 22 | class ParserPrintActions : public MinimalAction { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 23 | llvm::raw_ostream& Out; |
| 24 | |
Steve Naroff | b4292f2 | 2007-10-31 20:55:39 +0000 | [diff] [blame] | 25 | public: |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 26 | ParserPrintActions(Preprocessor &PP, llvm::raw_ostream& OS) |
| 27 | : MinimalAction(PP), Out(OS) {} |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 28 | |
| 29 | // Printing Functions which also must call MinimalAction |
| 30 | |
Steve Naroff | 08d92e4 | 2007-09-15 18:49:24 +0000 | [diff] [blame] | 31 | /// ActOnDeclarator - This callback is invoked when a declarator is parsed |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 32 | /// and 'Init' specifies the initializer if any. This is for things like: |
| 33 | /// "int X = 4" or "typedef int foo". |
Chris Lattner | 682bf92 | 2009-03-29 16:50:03 +0000 | [diff] [blame] | 34 | virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 35 | Out << __FUNCTION__ << " "; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 36 | if (IdentifierInfo *II = D.getIdentifier()) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 37 | Out << "'" << II->getName() << "'"; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 38 | } else { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 39 | Out << "<anon>"; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 40 | } |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 41 | Out << "\n"; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 42 | |
| 43 | // Pass up to EmptyActions so that the symbol table is maintained right. |
Chris Lattner | 682bf92 | 2009-03-29 16:50:03 +0000 | [diff] [blame] | 44 | return MinimalAction::ActOnDeclarator(S, D); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 45 | } |
Steve Naroff | 640db42 | 2007-10-10 17:45:44 +0000 | [diff] [blame] | 46 | /// ActOnPopScope - This callback is called immediately before the specified |
| 47 | /// scope is popped and deleted. |
| 48 | virtual void ActOnPopScope(SourceLocation Loc, Scope *S) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 49 | Out << __FUNCTION__ << "\n"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 50 | 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 Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 56 | Out << __FUNCTION__ << "\n"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 57 | MinimalAction::ActOnTranslationUnitScope(Loc, S); |
| 58 | } |
| 59 | |
| 60 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 61 | 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 Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 70 | Out << __FUNCTION__ << "\n"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 71 | 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 Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 80 | Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc, |
| 81 | IdentifierInfo **IdentList, |
| 82 | unsigned NumElts) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 83 | Out << __FUNCTION__ << "\n"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 84 | 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 Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 94 | virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 95 | Out << __FUNCTION__ << " "; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 96 | if (IdentifierInfo *II = D.getIdentifier()) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 97 | Out << "'" << II->getName() << "'"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 98 | } else { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 99 | Out << "<anon>"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 100 | } |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 101 | Out << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 102 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 103 | } |
| 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 Carlsson | f5dcd38 | 2009-05-30 21:37:25 +0000 | [diff] [blame] | 112 | virtual void AddInitializerToDecl(DeclPtrTy Dcl, FullExprArg Init) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 113 | Out << __FUNCTION__ << "\n"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 114 | } |
| 115 | |
Chris Lattner | 682bf92 | 2009-03-29 16:50:03 +0000 | [diff] [blame] | 116 | /// 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 Friedman | c1dc653 | 2009-05-29 01:49:24 +0000 | [diff] [blame] | 119 | virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec& DS, |
| 120 | DeclPtrTy *Group, |
Chris Lattner | 682bf92 | 2009-03-29 16:50:03 +0000 | [diff] [blame] | 121 | unsigned NumDecls) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 122 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | 682bf92 | 2009-03-29 16:50:03 +0000 | [diff] [blame] | 123 | return DeclGroupPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 124 | } |
| 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 Lattner | 682bf92 | 2009-03-29 16:50:03 +0000 | [diff] [blame] | 129 | virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, |
| 130 | Declarator &D){ |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 131 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 132 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | /// ActOnStartOfFunctionDef - This is called at the start of a function |
| 136 | /// definition, after the FunctionDecl has already been created. |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 137 | virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 138 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 139 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 140 | } |
| 141 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 142 | virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 143 | Out << __FUNCTION__ << "\n"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 144 | } |
| 145 | |
| 146 | /// ActOnFunctionDefBody - This is called when a function body has completed |
| 147 | /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef. |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 148 | virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 149 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 150 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 151 | } |
| 152 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 153 | virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc, |
| 154 | ExprArg AsmString) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 155 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 156 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 157 | } |
| 158 | |
| 159 | /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with |
| 160 | /// no declarator (e.g. "struct foo;") is parsed. |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 161 | virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 162 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 163 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 164 | } |
Douglas Gregor | e79837a | 2008-12-17 01:46:43 +0000 | [diff] [blame] | 165 | |
| 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 Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 170 | virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, |
| 171 | SourceLocation LBrace, |
| 172 | SourceLocation RBrace, const char *Lang, |
| 173 | unsigned StrSize, |
| 174 | DeclPtrTy *Decls, unsigned NumDecls) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 175 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 176 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 177 | } |
Douglas Gregor | e79837a | 2008-12-17 01:46:43 +0000 | [diff] [blame] | 178 | |
| 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 Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 182 | virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang, |
| 183 | unsigned StrSize, DeclPtrTy D) { |
| 184 | return DeclPtrTy(); |
Douglas Gregor | e79837a | 2008-12-17 01:46:43 +0000 | [diff] [blame] | 185 | } |
| 186 | |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 187 | //===------------------------------------------------------------------===// |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 188 | // Type Parsing Callbacks. |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 189 | //===------------------------------------------------------------------===// |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 190 | |
Sebastian Redl | cee63fb | 2008-12-02 14:43:59 +0000 | [diff] [blame] | 191 | virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 192 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 193 | return TypeResult(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 194 | } |
| 195 | |
John McCall | 0f434ec | 2009-07-31 02:45:11 +0000 | [diff] [blame] | 196 | virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagType, TagUseKind TUK, |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 197 | SourceLocation KWLoc, const CXXScopeSpec &SS, |
| 198 | IdentifierInfo *Name, SourceLocation NameLoc, |
Douglas Gregor | 402abb5 | 2009-05-28 23:31:59 +0000 | [diff] [blame] | 199 | AttributeList *Attr, AccessSpecifier AS, |
Douglas Gregor | bd1099e | 2009-07-23 16:36:45 +0000 | [diff] [blame] | 200 | MultiTemplateParamsArg TemplateParamLists, |
Douglas Gregor | 402abb5 | 2009-05-28 23:31:59 +0000 | [diff] [blame] | 201 | bool &Owned) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 202 | // TagType is an instance of DeclSpec::TST, indicating what kind of tag this |
| 203 | // is (struct/union/enum/class). |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 204 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 205 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | /// Act on @defs() element found when parsing a structure. ClassName is the |
| 209 | /// name of the referenced class. |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 210 | virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart, |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 211 | IdentifierInfo *ClassName, |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 212 | llvm::SmallVectorImpl<DeclPtrTy> &Decls) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 213 | Out << __FUNCTION__ << "\n"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 214 | } |
| 215 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 216 | virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD, |
| 217 | SourceLocation DeclStart, |
| 218 | Declarator &D, ExprTy *BitfieldWidth) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 219 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 220 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 221 | } |
| 222 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 223 | virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart, |
Fariborz Jahanian | 496b5a8 | 2009-06-05 18:16:35 +0000 | [diff] [blame] | 224 | DeclPtrTy IntfDecl, |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 225 | Declarator &D, ExprTy *BitfieldWidth, |
| 226 | tok::ObjCKeywordKind visibility) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 227 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 228 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 229 | } |
| 230 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 231 | virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl, |
| 232 | DeclPtrTy *Fields, unsigned NumFields, |
Daniel Dunbar | 1bfe1c2 | 2008-10-03 02:03:53 +0000 | [diff] [blame] | 233 | SourceLocation LBrac, SourceLocation RBrac, |
| 234 | AttributeList *AttrList) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 235 | Out << __FUNCTION__ << "\n"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 236 | } |
| 237 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 238 | virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl, |
| 239 | DeclPtrTy LastEnumConstant, |
| 240 | SourceLocation IdLoc,IdentifierInfo *Id, |
| 241 | SourceLocation EqualLoc, ExprTy *Val) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 242 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 243 | return DeclPtrTy(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 244 | } |
| 245 | |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 246 | virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc, |
| 247 | SourceLocation RBraceLoc, DeclPtrTy EnumDecl, |
Edward O'Callaghan | fee1381 | 2009-08-08 14:36:57 +0000 | [diff] [blame] | 248 | DeclPtrTy *Elements, unsigned NumElements, |
| 249 | Scope *S, AttributeList *AttrList) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 250 | Out << __FUNCTION__ << "\n"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 251 | } |
| 252 | |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 253 | //===------------------------------------------------------------------===// |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 254 | // Statement Parsing Callbacks. |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 255 | //===------------------------------------------------------------------===// |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 256 | |
| 257 | virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 258 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 259 | return StmtEmpty(); |
| 260 | } |
| 261 | |
| 262 | virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L, |
| 263 | SourceLocation R, |
| 264 | MultiStmtArg Elts, |
| 265 | bool isStmtExpr) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 266 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 267 | return StmtEmpty(); |
| 268 | } |
Chris Lattner | 682bf92 | 2009-03-29 16:50:03 +0000 | [diff] [blame] | 269 | virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl, |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 270 | SourceLocation StartLoc, |
| 271 | SourceLocation EndLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 272 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 273 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 274 | } |
| 275 | |
Anders Carlsson | 6b1d283 | 2009-05-17 21:11:30 +0000 | [diff] [blame] | 276 | virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 277 | Out << __FUNCTION__ << "\n"; |
Anders Carlsson | 6b1d283 | 2009-05-17 21:11:30 +0000 | [diff] [blame] | 278 | return OwningStmtResult(*this, Expr->release()); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 279 | } |
| 280 | |
| 281 | /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension, |
| 282 | /// which can specify an RHS value. |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 283 | virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc, |
| 284 | ExprArg LHSVal, |
| 285 | SourceLocation DotDotDotLoc, |
| 286 | ExprArg RHSVal, |
Chris Lattner | 24e1e70 | 2009-03-04 04:23:07 +0000 | [diff] [blame] | 287 | SourceLocation ColonLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 288 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 289 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 290 | } |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 291 | virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc, |
| 292 | SourceLocation ColonLoc, |
| 293 | StmtArg SubStmt, Scope *CurScope){ |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 294 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 295 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 296 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 297 | |
| 298 | virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc, |
| 299 | IdentifierInfo *II, |
| 300 | SourceLocation ColonLoc, |
| 301 | StmtArg SubStmt) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 302 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 303 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 304 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 305 | |
Anders Carlsson | a99fad8 | 2009-05-17 18:26:53 +0000 | [diff] [blame] | 306 | virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc, |
| 307 | FullExprArg CondVal, StmtArg ThenVal, |
| 308 | SourceLocation ElseLoc, |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 309 | StmtArg ElseVal) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 310 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 311 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 312 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 313 | |
| 314 | virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 315 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 316 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 317 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 318 | |
| 319 | virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc, |
| 320 | StmtArg Switch, |
| 321 | StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 322 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 323 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 324 | } |
| 325 | |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 326 | virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc, |
Anders Carlsson | 7f537c1 | 2009-05-17 21:22:26 +0000 | [diff] [blame] | 327 | FullExprArg Cond, StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 328 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 329 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 330 | } |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 331 | virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body, |
Chris Lattner | 9891359 | 2009-06-12 23:04:47 +0000 | [diff] [blame] | 332 | SourceLocation WhileLoc, |
| 333 | SourceLocation LPLoc, ExprArg Cond, |
| 334 | SourceLocation RPLoc){ |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 335 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 336 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 337 | } |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 338 | virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc, |
| 339 | SourceLocation LParenLoc, |
| 340 | StmtArg First, ExprArg Second, |
| 341 | ExprArg Third, SourceLocation RParenLoc, |
| 342 | StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 343 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 344 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 345 | } |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 346 | virtual OwningStmtResult ActOnObjCForCollectionStmt( |
| 347 | SourceLocation ForColLoc, |
| 348 | SourceLocation LParenLoc, |
| 349 | StmtArg First, ExprArg Second, |
| 350 | SourceLocation RParenLoc, StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 351 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 352 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 353 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 354 | virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc, |
| 355 | SourceLocation LabelLoc, |
| 356 | IdentifierInfo *LabelII) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 357 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 358 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 359 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 360 | virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc, |
| 361 | SourceLocation StarLoc, |
| 362 | ExprArg DestExp) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 363 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 364 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 365 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 366 | virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc, |
| 367 | Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 368 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 369 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 370 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 371 | virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc, |
| 372 | Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 373 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 374 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 375 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 376 | virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc, |
Anders Carlsson | a0ab25d | 2009-05-30 21:42:34 +0000 | [diff] [blame] | 377 | FullExprArg RetValExp) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 378 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 379 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 380 | } |
Sebastian Redl | 3037ed0 | 2009-01-18 16:53:17 +0000 | [diff] [blame] | 381 | virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc, |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 382 | bool IsSimple, |
Sebastian Redl | 3037ed0 | 2009-01-18 16:53:17 +0000 | [diff] [blame] | 383 | bool IsVolatile, |
| 384 | unsigned NumOutputs, |
| 385 | unsigned NumInputs, |
| 386 | std::string *Names, |
| 387 | MultiExprArg Constraints, |
| 388 | MultiExprArg Exprs, |
| 389 | ExprArg AsmString, |
| 390 | MultiExprArg Clobbers, |
| 391 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 392 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 3037ed0 | 2009-01-18 16:53:17 +0000 | [diff] [blame] | 393 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 394 | } |
Sebastian Redl | 3037ed0 | 2009-01-18 16:53:17 +0000 | [diff] [blame] | 395 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 396 | // Objective-c statements |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 397 | virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc, |
| 398 | SourceLocation RParen, |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 399 | DeclPtrTy Parm, StmtArg Body, |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 400 | StmtArg CatchList) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 401 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 402 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 403 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 404 | |
| 405 | virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc, |
| 406 | StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 407 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 408 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 409 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 410 | |
| 411 | virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc, |
| 412 | StmtArg Try, StmtArg Catch, |
| 413 | StmtArg Finally) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 414 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 415 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 416 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 417 | |
| 418 | virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc, |
Steve Naroff | e21dd6f | 2009-02-11 20:05:44 +0000 | [diff] [blame] | 419 | ExprArg Throw, |
| 420 | Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 421 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 422 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 423 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 424 | |
| 425 | virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc, |
| 426 | ExprArg SynchExpr, |
| 427 | StmtArg SynchBody) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 428 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 429 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 430 | } |
Sebastian Redl | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 431 | |
| 432 | // C++ Statements |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 433 | virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 434 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 435 | return DeclPtrTy(); |
Sebastian Redl | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 436 | } |
| 437 | |
| 438 | virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc, |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 439 | DeclPtrTy ExceptionDecl, |
Sebastian Redl | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 440 | StmtArg HandlerBlock) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 441 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 442 | return StmtEmpty(); |
| 443 | } |
| 444 | |
| 445 | virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc, |
| 446 | StmtArg TryBlock, |
| 447 | MultiStmtArg Handlers) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 448 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 449 | return StmtEmpty(); |
| 450 | } |
| 451 | |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 452 | //===------------------------------------------------------------------===// |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 453 | // Expression Parsing Callbacks. |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 454 | //===------------------------------------------------------------------===// |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 455 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 456 | // Primary Expressions. |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 457 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 458 | /// ActOnIdentifierExpr - Parse an identifier in expression context. |
| 459 | /// 'HasTrailingLParen' indicates whether or not the identifier has a '(' |
| 460 | /// token immediately after it. |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 461 | virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc, |
| 462 | IdentifierInfo &II, |
| 463 | bool HasTrailingLParen, |
Sebastian Redl | ebc07d5 | 2009-02-03 20:19:35 +0000 | [diff] [blame] | 464 | const CXXScopeSpec *SS, |
| 465 | bool isAddressOfOperand) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 466 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 467 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 468 | } |
| 469 | |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 470 | virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr( |
| 471 | Scope *S, SourceLocation OperatorLoc, |
| 472 | OverloadedOperatorKind Op, |
Sebastian Redl | ebc07d5 | 2009-02-03 20:19:35 +0000 | [diff] [blame] | 473 | bool HasTrailingLParen, const CXXScopeSpec &SS, |
| 474 | bool isAddressOfOperand) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 475 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 476 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 477 | } |
| 478 | |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 479 | virtual OwningExprResult ActOnCXXConversionFunctionExpr( |
| 480 | Scope *S, SourceLocation OperatorLoc, |
| 481 | TypeTy *Type, bool HasTrailingLParen, |
Sebastian Redl | ebc07d5 | 2009-02-03 20:19:35 +0000 | [diff] [blame] | 482 | const CXXScopeSpec &SS,bool isAddressOfOperand) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 483 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 484 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 485 | } |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 486 | |
| 487 | virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc, |
| 488 | tok::TokenKind Kind) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 489 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 490 | return ExprEmpty(); |
| 491 | } |
| 492 | |
| 493 | virtual OwningExprResult ActOnCharacterConstant(const Token &) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 494 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 495 | return ExprEmpty(); |
| 496 | } |
| 497 | |
| 498 | virtual OwningExprResult ActOnNumericConstant(const Token &) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 499 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 500 | return ExprEmpty(); |
| 501 | } |
| 502 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 503 | /// ActOnStringLiteral - The specified tokens were lexed as pasted string |
| 504 | /// fragments (e.g. "foo" "bar" L"baz"). |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 505 | virtual OwningExprResult ActOnStringLiteral(const Token *Toks, |
| 506 | unsigned NumToks) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 507 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 508 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 509 | } |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 510 | |
| 511 | virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R, |
| 512 | ExprArg Val) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 513 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 76ad2e8 | 2009-02-05 15:02:23 +0000 | [diff] [blame] | 514 | return move(Val); // Default impl returns operand. |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 515 | } |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 516 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 517 | // Postfix Expressions. |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 518 | virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc, |
| 519 | tok::TokenKind Kind, |
| 520 | ExprArg Input) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 521 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 522 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 523 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 524 | virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base, |
| 525 | SourceLocation LLoc, |
| 526 | ExprArg Idx, |
| 527 | SourceLocation RLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 528 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 529 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 530 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 531 | virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base, |
| 532 | SourceLocation OpLoc, |
| 533 | tok::TokenKind OpKind, |
| 534 | SourceLocation MemberLoc, |
Fariborz Jahanian | a6e3ac5 | 2009-03-04 22:30:12 +0000 | [diff] [blame] | 535 | IdentifierInfo &Member, |
Douglas Gregor | fe85ced | 2009-08-06 03:17:00 +0000 | [diff] [blame] | 536 | DeclPtrTy ImplDecl, |
| 537 | const CXXScopeSpec *SS=0) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 538 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 539 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 540 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 541 | |
| 542 | virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn, |
| 543 | SourceLocation LParenLoc, |
| 544 | MultiExprArg Args, |
| 545 | SourceLocation *CommaLocs, |
| 546 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 547 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 548 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 549 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 550 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 551 | // Unary Operators. 'Tok' is the token for the operator. |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 552 | virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc, |
| 553 | tok::TokenKind Op, ExprArg Input) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 554 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 555 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 556 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 557 | virtual OwningExprResult |
| 558 | ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType, |
| 559 | void *TyOrEx, const SourceRange &ArgRange) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 560 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 561 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 562 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 563 | |
| 564 | virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen, |
| 565 | TypeTy *Ty, |
| 566 | SourceLocation RParen, |
| 567 | ExprArg Op) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 568 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 569 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 570 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 571 | virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc, |
| 572 | MultiExprArg InitList, |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 573 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 574 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 575 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 576 | } |
Nate Begeman | 2ef13e5 | 2009-08-10 23:49:36 +0000 | [diff] [blame^] | 577 | virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc, |
| 578 | TypeTy *Ty, SourceLocation RParenLoc, |
| 579 | ExprArg Op) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 580 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 581 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 582 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 583 | |
| 584 | virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc, |
| 585 | tok::TokenKind Kind, |
| 586 | ExprArg LHS, ExprArg RHS) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 587 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 588 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 589 | } |
| 590 | |
| 591 | /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null |
| 592 | /// in the case of a the GNU conditional expr extension. |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 593 | virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc, |
| 594 | SourceLocation ColonLoc, |
| 595 | ExprArg Cond, ExprArg LHS, |
| 596 | ExprArg RHS) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 597 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 598 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 599 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 600 | |
| 601 | //===--------------------- GNU Extension Expressions ------------------===// |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 602 | |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 603 | virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc, |
| 604 | SourceLocation LabLoc, |
| 605 | IdentifierInfo *LabelII) {// "&&foo" |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 606 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 607 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 608 | } |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 609 | |
| 610 | virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc, |
| 611 | StmtArg SubStmt, |
| 612 | SourceLocation RPLoc) { // "({..})" |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 613 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 614 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 615 | } |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 616 | |
| 617 | virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S, |
| 618 | SourceLocation BuiltinLoc, |
| 619 | SourceLocation TypeLoc, |
| 620 | TypeTy *Arg1, |
| 621 | OffsetOfComponent *CompPtr, |
| 622 | unsigned NumComponents, |
| 623 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 624 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 625 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 626 | } |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 627 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 628 | // __builtin_types_compatible_p(type1, type2) |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 629 | virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc, |
| 630 | TypeTy *arg1,TypeTy *arg2, |
| 631 | SourceLocation RPLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 632 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 633 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 634 | } |
| 635 | // __builtin_choose_expr(constExpr, expr1, expr2) |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 636 | virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc, |
| 637 | ExprArg cond, ExprArg expr1, |
| 638 | ExprArg expr2, |
| 639 | SourceLocation RPLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 640 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 641 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 642 | } |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 643 | |
| 644 | // __builtin_va_arg(expr, type) |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 645 | virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc, |
| 646 | ExprArg expr, TypeTy *type, |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 647 | SourceLocation RPLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 648 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 649 | return ExprEmpty(); |
| 650 | } |
| 651 | |
| 652 | virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 653 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 654 | return ExprEmpty(); |
| 655 | } |
| 656 | |
| 657 | virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 658 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 659 | } |
| 660 | |
| 661 | virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 662 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 663 | } |
| 664 | |
| 665 | virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 666 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 667 | } |
| 668 | |
| 669 | virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc, |
| 670 | StmtArg Body, |
| 671 | Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 672 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 673 | return ExprEmpty(); |
| 674 | } |
| 675 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 676 | virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc, |
| 677 | IdentifierInfo *Ident, |
| 678 | SourceLocation LBrace) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 679 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 680 | return DeclPtrTy(); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 681 | } |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 682 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 683 | virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 684 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 685 | return; |
| 686 | } |
| 687 | |
| 688 | #if 0 |
| 689 | // FIXME: AttrList should be deleted by this function, but the definition |
| 690 | // would have to be available. |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 691 | virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope, |
| 692 | SourceLocation UsingLoc, |
| 693 | SourceLocation NamespcLoc, |
| 694 | const CXXScopeSpec &SS, |
| 695 | SourceLocation IdentLoc, |
| 696 | IdentifierInfo *NamespcName, |
| 697 | AttributeList *AttrList) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 698 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 699 | return DeclPtrTy(); |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 700 | } |
| 701 | #endif |
| 702 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 703 | virtual void ActOnParamDefaultArgument(DeclPtrTy param, |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 704 | SourceLocation EqualLoc, |
| 705 | ExprArg defarg) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 706 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 707 | } |
| 708 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 709 | virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param, |
Anders Carlsson | 5e300d1 | 2009-06-12 16:51:40 +0000 | [diff] [blame] | 710 | SourceLocation EqualLoc, |
| 711 | SourceLocation ArgLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 712 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 713 | } |
| 714 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 715 | virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 716 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 717 | } |
| 718 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 719 | virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl, |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 720 | SourceLocation LParenLoc, |
| 721 | MultiExprArg Exprs, |
| 722 | SourceLocation *CommaLocs, |
| 723 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 724 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 725 | return; |
| 726 | } |
| 727 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 728 | virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S, |
| 729 | DeclPtrTy Method) |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 730 | { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 731 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 732 | } |
| 733 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 734 | virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 735 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 736 | } |
| 737 | |
| 738 | virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 739 | DeclPtrTy Method) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 740 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 741 | } |
| 742 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 743 | virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc, |
| 744 | ExprArg AssertExpr, |
| 745 | ExprArg AssertMessageExpr) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 746 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 747 | return DeclPtrTy(); |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 748 | } |
| 749 | |
| 750 | virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc, |
| 751 | tok::TokenKind Kind, |
| 752 | SourceLocation LAngleBracketLoc, |
| 753 | TypeTy *Ty, |
| 754 | SourceLocation RAngleBracketLoc, |
| 755 | SourceLocation LParenLoc, |
| 756 | ExprArg Op, |
| 757 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 758 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 759 | return ExprEmpty(); |
| 760 | } |
| 761 | |
| 762 | virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc, |
| 763 | SourceLocation LParenLoc, |
| 764 | bool isType, void *TyOrExpr, |
| 765 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 766 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 767 | return ExprEmpty(); |
| 768 | } |
| 769 | |
| 770 | virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 771 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 772 | return ExprEmpty(); |
| 773 | } |
| 774 | |
| 775 | virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc, |
| 776 | tok::TokenKind Kind) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 777 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 778 | return ExprEmpty(); |
| 779 | } |
| 780 | |
| 781 | virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 782 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 783 | return ExprEmpty(); |
| 784 | } |
| 785 | |
| 786 | virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange, |
| 787 | TypeTy *TypeRep, |
| 788 | SourceLocation LParenLoc, |
| 789 | MultiExprArg Exprs, |
| 790 | SourceLocation *CommaLocs, |
| 791 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 792 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 793 | return ExprEmpty(); |
| 794 | } |
| 795 | |
| 796 | virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S, |
| 797 | SourceLocation StartLoc, |
| 798 | Declarator &D, |
| 799 | SourceLocation EqualLoc, |
| 800 | ExprArg AssignExprVal) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 801 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 802 | return ExprEmpty(); |
| 803 | } |
| 804 | |
| 805 | virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc, |
| 806 | bool UseGlobal, |
| 807 | SourceLocation PlacementLParen, |
| 808 | MultiExprArg PlacementArgs, |
| 809 | SourceLocation PlacementRParen, |
| 810 | bool ParenTypeId, Declarator &D, |
| 811 | SourceLocation ConstructorLParen, |
| 812 | MultiExprArg ConstructorArgs, |
| 813 | SourceLocation ConstructorRParen) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 814 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 815 | return ExprEmpty(); |
| 816 | } |
| 817 | |
| 818 | virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc, |
| 819 | bool UseGlobal, bool ArrayForm, |
| 820 | ExprArg Operand) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 821 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 822 | return ExprEmpty(); |
| 823 | } |
| 824 | |
| 825 | virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT, |
| 826 | SourceLocation KWLoc, |
| 827 | SourceLocation LParen, |
| 828 | TypeTy *Ty, |
| 829 | SourceLocation RParen) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 830 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 831 | return ExprEmpty(); |
| 832 | } |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 833 | }; |
| 834 | } |
| 835 | |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 836 | MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP, |
| 837 | llvm::raw_ostream* OS) { |
| 838 | return new ParserPrintActions(PP, *OS); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 839 | } |