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, |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 248 | DeclPtrTy *Elements, unsigned NumElements) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 249 | Out << __FUNCTION__ << "\n"; |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 250 | } |
| 251 | |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 252 | //===------------------------------------------------------------------===// |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 253 | // Statement Parsing Callbacks. |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 254 | //===------------------------------------------------------------------===// |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 255 | |
| 256 | virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 257 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 258 | return StmtEmpty(); |
| 259 | } |
| 260 | |
| 261 | virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L, |
| 262 | SourceLocation R, |
| 263 | MultiStmtArg Elts, |
| 264 | bool isStmtExpr) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 265 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 266 | return StmtEmpty(); |
| 267 | } |
Chris Lattner | 682bf92 | 2009-03-29 16:50:03 +0000 | [diff] [blame] | 268 | virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl, |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 269 | SourceLocation StartLoc, |
| 270 | SourceLocation EndLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 271 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 272 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 273 | } |
| 274 | |
Anders Carlsson | 6b1d283 | 2009-05-17 21:11:30 +0000 | [diff] [blame] | 275 | virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 276 | Out << __FUNCTION__ << "\n"; |
Anders Carlsson | 6b1d283 | 2009-05-17 21:11:30 +0000 | [diff] [blame] | 277 | return OwningStmtResult(*this, Expr->release()); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 278 | } |
| 279 | |
| 280 | /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension, |
| 281 | /// which can specify an RHS value. |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 282 | virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc, |
| 283 | ExprArg LHSVal, |
| 284 | SourceLocation DotDotDotLoc, |
| 285 | ExprArg RHSVal, |
Chris Lattner | 24e1e70 | 2009-03-04 04:23:07 +0000 | [diff] [blame] | 286 | SourceLocation ColonLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 287 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 288 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 289 | } |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 290 | virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc, |
| 291 | SourceLocation ColonLoc, |
| 292 | StmtArg SubStmt, Scope *CurScope){ |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 293 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 294 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 295 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 296 | |
| 297 | virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc, |
| 298 | IdentifierInfo *II, |
| 299 | SourceLocation ColonLoc, |
| 300 | StmtArg SubStmt) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 301 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 302 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 303 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 304 | |
Anders Carlsson | a99fad8 | 2009-05-17 18:26:53 +0000 | [diff] [blame] | 305 | virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc, |
| 306 | FullExprArg CondVal, StmtArg ThenVal, |
| 307 | SourceLocation ElseLoc, |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 308 | StmtArg ElseVal) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 309 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 310 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 311 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 312 | |
| 313 | virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 314 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 315 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 316 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 317 | |
| 318 | virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc, |
| 319 | StmtArg Switch, |
| 320 | StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 321 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 322 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 323 | } |
| 324 | |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 325 | virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc, |
Anders Carlsson | 7f537c1 | 2009-05-17 21:22:26 +0000 | [diff] [blame] | 326 | FullExprArg Cond, StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 327 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 328 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 329 | } |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 330 | virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body, |
Chris Lattner | 9891359 | 2009-06-12 23:04:47 +0000 | [diff] [blame] | 331 | SourceLocation WhileLoc, |
| 332 | SourceLocation LPLoc, ExprArg Cond, |
| 333 | SourceLocation RPLoc){ |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 334 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 335 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 336 | } |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 337 | virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc, |
| 338 | SourceLocation LParenLoc, |
| 339 | StmtArg First, ExprArg Second, |
| 340 | ExprArg Third, SourceLocation RParenLoc, |
| 341 | StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 342 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 343 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 344 | } |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 345 | virtual OwningStmtResult ActOnObjCForCollectionStmt( |
| 346 | SourceLocation ForColLoc, |
| 347 | SourceLocation LParenLoc, |
| 348 | StmtArg First, ExprArg Second, |
| 349 | SourceLocation RParenLoc, StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 350 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 351 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 352 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 353 | virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc, |
| 354 | SourceLocation LabelLoc, |
| 355 | IdentifierInfo *LabelII) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 356 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 357 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 358 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 359 | virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc, |
| 360 | SourceLocation StarLoc, |
| 361 | ExprArg DestExp) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 362 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 363 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 364 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 365 | virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc, |
| 366 | Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 367 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 368 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 369 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 370 | virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc, |
| 371 | Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 372 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 373 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 374 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 375 | virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc, |
Anders Carlsson | a0ab25d | 2009-05-30 21:42:34 +0000 | [diff] [blame] | 376 | FullExprArg RetValExp) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 377 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 378 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 379 | } |
Sebastian Redl | 3037ed0 | 2009-01-18 16:53:17 +0000 | [diff] [blame] | 380 | virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc, |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 381 | bool IsSimple, |
Sebastian Redl | 3037ed0 | 2009-01-18 16:53:17 +0000 | [diff] [blame] | 382 | bool IsVolatile, |
| 383 | unsigned NumOutputs, |
| 384 | unsigned NumInputs, |
| 385 | std::string *Names, |
| 386 | MultiExprArg Constraints, |
| 387 | MultiExprArg Exprs, |
| 388 | ExprArg AsmString, |
| 389 | MultiExprArg Clobbers, |
| 390 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 391 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 3037ed0 | 2009-01-18 16:53:17 +0000 | [diff] [blame] | 392 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 393 | } |
Sebastian Redl | 3037ed0 | 2009-01-18 16:53:17 +0000 | [diff] [blame] | 394 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 395 | // Objective-c statements |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 396 | virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc, |
| 397 | SourceLocation RParen, |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 398 | DeclPtrTy Parm, StmtArg Body, |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 399 | StmtArg CatchList) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 400 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 401 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 402 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 403 | |
| 404 | virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc, |
| 405 | StmtArg Body) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 406 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 407 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 408 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 409 | |
| 410 | virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc, |
| 411 | StmtArg Try, StmtArg Catch, |
| 412 | StmtArg Finally) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 413 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 414 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 415 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 416 | |
| 417 | virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc, |
Steve Naroff | e21dd6f | 2009-02-11 20:05:44 +0000 | [diff] [blame] | 418 | ExprArg Throw, |
| 419 | Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 420 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 421 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 422 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 423 | |
| 424 | virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc, |
| 425 | ExprArg SynchExpr, |
| 426 | StmtArg SynchBody) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 427 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 428 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 429 | } |
Sebastian Redl | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 430 | |
| 431 | // C++ Statements |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 432 | virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 433 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 434 | return DeclPtrTy(); |
Sebastian Redl | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 435 | } |
| 436 | |
| 437 | virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc, |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 438 | DeclPtrTy ExceptionDecl, |
Sebastian Redl | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 439 | StmtArg HandlerBlock) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 440 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 441 | return StmtEmpty(); |
| 442 | } |
| 443 | |
| 444 | virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc, |
| 445 | StmtArg TryBlock, |
| 446 | MultiStmtArg Handlers) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 447 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 448 | return StmtEmpty(); |
| 449 | } |
| 450 | |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 451 | //===------------------------------------------------------------------===// |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 452 | // Expression Parsing Callbacks. |
Mike Stump | c6e35aa | 2009-05-16 07:06:02 +0000 | [diff] [blame] | 453 | //===------------------------------------------------------------------===// |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 454 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 455 | // Primary Expressions. |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 456 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 457 | /// ActOnIdentifierExpr - Parse an identifier in expression context. |
| 458 | /// 'HasTrailingLParen' indicates whether or not the identifier has a '(' |
| 459 | /// token immediately after it. |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 460 | virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc, |
| 461 | IdentifierInfo &II, |
| 462 | bool HasTrailingLParen, |
Sebastian Redl | ebc07d5 | 2009-02-03 20:19:35 +0000 | [diff] [blame] | 463 | const CXXScopeSpec *SS, |
| 464 | bool isAddressOfOperand) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 465 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 466 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 467 | } |
| 468 | |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 469 | virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr( |
| 470 | Scope *S, SourceLocation OperatorLoc, |
| 471 | OverloadedOperatorKind Op, |
Sebastian Redl | ebc07d5 | 2009-02-03 20:19:35 +0000 | [diff] [blame] | 472 | bool HasTrailingLParen, const CXXScopeSpec &SS, |
| 473 | bool isAddressOfOperand) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 474 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 475 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 476 | } |
| 477 | |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 478 | virtual OwningExprResult ActOnCXXConversionFunctionExpr( |
| 479 | Scope *S, SourceLocation OperatorLoc, |
| 480 | TypeTy *Type, bool HasTrailingLParen, |
Sebastian Redl | ebc07d5 | 2009-02-03 20:19:35 +0000 | [diff] [blame] | 481 | const CXXScopeSpec &SS,bool isAddressOfOperand) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 482 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 483 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 484 | } |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 485 | |
| 486 | virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc, |
| 487 | tok::TokenKind Kind) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 488 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 489 | return ExprEmpty(); |
| 490 | } |
| 491 | |
| 492 | virtual OwningExprResult ActOnCharacterConstant(const Token &) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 493 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 494 | return ExprEmpty(); |
| 495 | } |
| 496 | |
| 497 | virtual OwningExprResult ActOnNumericConstant(const Token &) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 498 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 499 | return ExprEmpty(); |
| 500 | } |
| 501 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 502 | /// ActOnStringLiteral - The specified tokens were lexed as pasted string |
| 503 | /// fragments (e.g. "foo" "bar" L"baz"). |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 504 | virtual OwningExprResult ActOnStringLiteral(const Token *Toks, |
| 505 | unsigned NumToks) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 506 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 507 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 508 | } |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 509 | |
| 510 | virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R, |
| 511 | ExprArg Val) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 512 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 76ad2e8 | 2009-02-05 15:02:23 +0000 | [diff] [blame] | 513 | return move(Val); // Default impl returns operand. |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 514 | } |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 515 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 516 | // Postfix Expressions. |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 517 | virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc, |
| 518 | tok::TokenKind Kind, |
| 519 | ExprArg Input) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 520 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 521 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 522 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 523 | virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base, |
| 524 | SourceLocation LLoc, |
| 525 | ExprArg Idx, |
| 526 | SourceLocation RLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 527 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 528 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 529 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 530 | virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base, |
| 531 | SourceLocation OpLoc, |
| 532 | tok::TokenKind OpKind, |
| 533 | SourceLocation MemberLoc, |
Fariborz Jahanian | a6e3ac5 | 2009-03-04 22:30:12 +0000 | [diff] [blame] | 534 | IdentifierInfo &Member, |
Douglas Gregor | fe85ced | 2009-08-06 03:17:00 +0000 | [diff] [blame^] | 535 | DeclPtrTy ImplDecl, |
| 536 | const CXXScopeSpec *SS=0) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 537 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 538 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 539 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 540 | |
| 541 | virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn, |
| 542 | SourceLocation LParenLoc, |
| 543 | MultiExprArg Args, |
| 544 | SourceLocation *CommaLocs, |
| 545 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 546 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 547 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 548 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 549 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 550 | // Unary Operators. 'Tok' is the token for the operator. |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 551 | virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc, |
| 552 | tok::TokenKind Op, ExprArg Input) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 553 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 554 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 555 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 556 | virtual OwningExprResult |
| 557 | ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType, |
| 558 | void *TyOrEx, const SourceRange &ArgRange) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 559 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 560 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 561 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 562 | |
| 563 | virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen, |
| 564 | TypeTy *Ty, |
| 565 | SourceLocation RParen, |
| 566 | ExprArg Op) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 567 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 568 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 569 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 570 | virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc, |
| 571 | MultiExprArg InitList, |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 572 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 573 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 574 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 575 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 576 | virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty, |
| 577 | SourceLocation RParenLoc,ExprArg Op){ |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 578 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 579 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 580 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 581 | |
| 582 | virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc, |
| 583 | tok::TokenKind Kind, |
| 584 | ExprArg LHS, ExprArg RHS) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 585 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 586 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 587 | } |
| 588 | |
| 589 | /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null |
| 590 | /// in the case of a the GNU conditional expr extension. |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 591 | virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc, |
| 592 | SourceLocation ColonLoc, |
| 593 | ExprArg Cond, ExprArg LHS, |
| 594 | ExprArg RHS) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 595 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 596 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 597 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 598 | |
| 599 | //===--------------------- GNU Extension Expressions ------------------===// |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 600 | |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 601 | virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc, |
| 602 | SourceLocation LabLoc, |
| 603 | IdentifierInfo *LabelII) {// "&&foo" |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 604 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 605 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 606 | } |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 607 | |
| 608 | virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc, |
| 609 | StmtArg SubStmt, |
| 610 | SourceLocation RPLoc) { // "({..})" |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 611 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 612 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 613 | } |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 614 | |
| 615 | virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S, |
| 616 | SourceLocation BuiltinLoc, |
| 617 | SourceLocation TypeLoc, |
| 618 | TypeTy *Arg1, |
| 619 | OffsetOfComponent *CompPtr, |
| 620 | unsigned NumComponents, |
| 621 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 622 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 623 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 624 | } |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 625 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 626 | // __builtin_types_compatible_p(type1, type2) |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 627 | virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc, |
| 628 | TypeTy *arg1,TypeTy *arg2, |
| 629 | SourceLocation RPLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 630 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 631 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 632 | } |
| 633 | // __builtin_choose_expr(constExpr, expr1, expr2) |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 634 | virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc, |
| 635 | ExprArg cond, ExprArg expr1, |
| 636 | ExprArg expr2, |
| 637 | SourceLocation RPLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 638 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 639 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 640 | } |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 641 | |
| 642 | // __builtin_va_arg(expr, type) |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 643 | virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc, |
| 644 | ExprArg expr, TypeTy *type, |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 645 | SourceLocation RPLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 646 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 647 | return ExprEmpty(); |
| 648 | } |
| 649 | |
| 650 | virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 651 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 652 | return ExprEmpty(); |
| 653 | } |
| 654 | |
| 655 | virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 656 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 657 | } |
| 658 | |
| 659 | virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 660 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 661 | } |
| 662 | |
| 663 | virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 664 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 665 | } |
| 666 | |
| 667 | virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc, |
| 668 | StmtArg Body, |
| 669 | Scope *CurScope) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 670 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 671 | return ExprEmpty(); |
| 672 | } |
| 673 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 674 | virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc, |
| 675 | IdentifierInfo *Ident, |
| 676 | SourceLocation LBrace) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 677 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 678 | return DeclPtrTy(); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 679 | } |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 680 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 681 | virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 682 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 683 | return; |
| 684 | } |
| 685 | |
| 686 | #if 0 |
| 687 | // FIXME: AttrList should be deleted by this function, but the definition |
| 688 | // would have to be available. |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 689 | virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope, |
| 690 | SourceLocation UsingLoc, |
| 691 | SourceLocation NamespcLoc, |
| 692 | const CXXScopeSpec &SS, |
| 693 | SourceLocation IdentLoc, |
| 694 | IdentifierInfo *NamespcName, |
| 695 | AttributeList *AttrList) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 696 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 697 | return DeclPtrTy(); |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 698 | } |
| 699 | #endif |
| 700 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 701 | virtual void ActOnParamDefaultArgument(DeclPtrTy param, |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 702 | SourceLocation EqualLoc, |
| 703 | ExprArg defarg) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 704 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 705 | } |
| 706 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 707 | virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param, |
Anders Carlsson | 5e300d1 | 2009-06-12 16:51:40 +0000 | [diff] [blame] | 708 | SourceLocation EqualLoc, |
| 709 | SourceLocation ArgLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 710 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 711 | } |
| 712 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 713 | virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 714 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 715 | } |
| 716 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 717 | virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl, |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 718 | SourceLocation LParenLoc, |
| 719 | MultiExprArg Exprs, |
| 720 | SourceLocation *CommaLocs, |
| 721 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 722 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 723 | return; |
| 724 | } |
| 725 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 726 | virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S, |
| 727 | DeclPtrTy Method) |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 728 | { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 729 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 730 | } |
| 731 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 732 | virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 733 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 734 | } |
| 735 | |
| 736 | virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S, |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 737 | DeclPtrTy Method) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 738 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 739 | } |
| 740 | |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 741 | virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc, |
| 742 | ExprArg AssertExpr, |
| 743 | ExprArg AssertMessageExpr) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 744 | Out << __FUNCTION__ << "\n"; |
Chris Lattner | b28317a | 2009-03-28 19:18:32 +0000 | [diff] [blame] | 745 | return DeclPtrTy(); |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 746 | } |
| 747 | |
| 748 | virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc, |
| 749 | tok::TokenKind Kind, |
| 750 | SourceLocation LAngleBracketLoc, |
| 751 | TypeTy *Ty, |
| 752 | SourceLocation RAngleBracketLoc, |
| 753 | SourceLocation LParenLoc, |
| 754 | ExprArg Op, |
| 755 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 756 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 757 | return ExprEmpty(); |
| 758 | } |
| 759 | |
| 760 | virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc, |
| 761 | SourceLocation LParenLoc, |
| 762 | bool isType, void *TyOrExpr, |
| 763 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 764 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 765 | return ExprEmpty(); |
| 766 | } |
| 767 | |
| 768 | virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 769 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 770 | return ExprEmpty(); |
| 771 | } |
| 772 | |
| 773 | virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc, |
| 774 | tok::TokenKind Kind) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 775 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 776 | return ExprEmpty(); |
| 777 | } |
| 778 | |
| 779 | virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 780 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 781 | return ExprEmpty(); |
| 782 | } |
| 783 | |
| 784 | virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange, |
| 785 | TypeTy *TypeRep, |
| 786 | SourceLocation LParenLoc, |
| 787 | MultiExprArg Exprs, |
| 788 | SourceLocation *CommaLocs, |
| 789 | SourceLocation RParenLoc) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 790 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 791 | return ExprEmpty(); |
| 792 | } |
| 793 | |
| 794 | virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S, |
| 795 | SourceLocation StartLoc, |
| 796 | Declarator &D, |
| 797 | SourceLocation EqualLoc, |
| 798 | ExprArg AssignExprVal) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 799 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 800 | return ExprEmpty(); |
| 801 | } |
| 802 | |
| 803 | virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc, |
| 804 | bool UseGlobal, |
| 805 | SourceLocation PlacementLParen, |
| 806 | MultiExprArg PlacementArgs, |
| 807 | SourceLocation PlacementRParen, |
| 808 | bool ParenTypeId, Declarator &D, |
| 809 | SourceLocation ConstructorLParen, |
| 810 | MultiExprArg ConstructorArgs, |
| 811 | SourceLocation ConstructorRParen) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 812 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 813 | return ExprEmpty(); |
| 814 | } |
| 815 | |
| 816 | virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc, |
| 817 | bool UseGlobal, bool ArrayForm, |
| 818 | ExprArg Operand) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 819 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 820 | return ExprEmpty(); |
| 821 | } |
| 822 | |
| 823 | virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT, |
| 824 | SourceLocation KWLoc, |
| 825 | SourceLocation LParen, |
| 826 | TypeTy *Ty, |
| 827 | SourceLocation RParen) { |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 828 | Out << __FUNCTION__ << "\n"; |
Sebastian Redl | f53597f | 2009-03-15 17:47:39 +0000 | [diff] [blame] | 829 | return ExprEmpty(); |
| 830 | } |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 831 | }; |
| 832 | } |
| 833 | |
Eli Friedman | f54fce8 | 2009-05-19 01:02:07 +0000 | [diff] [blame] | 834 | MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP, |
| 835 | llvm::raw_ostream* OS) { |
| 836 | return new ParserPrintActions(PP, *OS); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 837 | } |