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