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 | |
| 15 | #include "clang.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" |
Ted Kremenek | bdd30c2 | 2008-01-14 16:44:48 +0000 | [diff] [blame] | 18 | #include "llvm/Support/Streams.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 { |
| 23 | |
Steve Naroff | b4292f2 | 2007-10-31 20:55:39 +0000 | [diff] [blame] | 24 | public: |
Daniel Dunbar | e10b0f2 | 2008-10-31 08:56:51 +0000 | [diff] [blame] | 25 | ParserPrintActions(Preprocessor &PP) : MinimalAction(PP) {} |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 26 | |
| 27 | // Printing Functions which also must call MinimalAction |
| 28 | |
Steve Naroff | 08d92e4 | 2007-09-15 18:49:24 +0000 | [diff] [blame] | 29 | /// ActOnDeclarator - This callback is invoked when a declarator is parsed |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 30 | /// and 'Init' specifies the initializer if any. This is for things like: |
| 31 | /// "int X = 4" or "typedef int foo". |
Steve Naroff | 08d92e4 | 2007-09-15 18:49:24 +0000 | [diff] [blame] | 32 | virtual DeclTy *ActOnDeclarator(Scope *S, Declarator &D, |
Daniel Dunbar | 914701e | 2008-08-05 16:28:08 +0000 | [diff] [blame] | 33 | DeclTy *LastInGroup) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 34 | llvm::cout << __FUNCTION__ << " "; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 35 | if (IdentifierInfo *II = D.getIdentifier()) { |
Ted Kremenek | bdd30c2 | 2008-01-14 16:44:48 +0000 | [diff] [blame] | 36 | llvm::cout << "'" << II->getName() << "'"; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 37 | } else { |
Ted Kremenek | bdd30c2 | 2008-01-14 16:44:48 +0000 | [diff] [blame] | 38 | llvm::cout << "<anon>"; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 39 | } |
Ted Kremenek | bdd30c2 | 2008-01-14 16:44:48 +0000 | [diff] [blame] | 40 | llvm::cout << "\n"; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 41 | |
| 42 | // Pass up to EmptyActions so that the symbol table is maintained right. |
Daniel Dunbar | 914701e | 2008-08-05 16:28:08 +0000 | [diff] [blame] | 43 | return MinimalAction::ActOnDeclarator(S, D, LastInGroup); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 44 | } |
Steve Naroff | 640db42 | 2007-10-10 17:45:44 +0000 | [diff] [blame] | 45 | /// ActOnPopScope - This callback is called immediately before the specified |
| 46 | /// scope is popped and deleted. |
| 47 | virtual void ActOnPopScope(SourceLocation Loc, Scope *S) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 48 | llvm::cout << __FUNCTION__ << "\n"; |
| 49 | return MinimalAction::ActOnPopScope(Loc, S); |
| 50 | } |
| 51 | |
| 52 | /// ActOnTranslationUnitScope - This callback is called once, immediately |
| 53 | /// after creating the translation unit scope (in Parser::Initialize). |
| 54 | virtual void ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) { |
| 55 | llvm::cout << __FUNCTION__ << "\n"; |
| 56 | MinimalAction::ActOnTranslationUnitScope(Loc, S); |
| 57 | } |
| 58 | |
| 59 | |
| 60 | Action::DeclTy *ActOnStartClassInterface(SourceLocation AtInterfaceLoc, |
| 61 | IdentifierInfo *ClassName, |
| 62 | SourceLocation ClassLoc, |
| 63 | IdentifierInfo *SuperName, |
| 64 | SourceLocation SuperLoc, |
| 65 | DeclTy * const *ProtoRefs, |
| 66 | unsigned NumProtocols, |
| 67 | SourceLocation EndProtoLoc, |
| 68 | AttributeList *AttrList) { |
| 69 | llvm::cout << __FUNCTION__ << "\n"; |
| 70 | return MinimalAction::ActOnStartClassInterface(AtInterfaceLoc, |
| 71 | ClassName, ClassLoc, |
| 72 | SuperName, SuperLoc, |
| 73 | ProtoRefs, NumProtocols, |
| 74 | EndProtoLoc, AttrList); |
| 75 | } |
| 76 | |
| 77 | /// ActOnForwardClassDeclaration - |
| 78 | /// Scope will always be top level file scope. |
| 79 | Action::DeclTy *ActOnForwardClassDeclaration(SourceLocation AtClassLoc, |
| 80 | IdentifierInfo **IdentList, |
| 81 | unsigned NumElts) { |
| 82 | llvm::cout << __FUNCTION__ << "\n"; |
| 83 | return MinimalAction::ActOnForwardClassDeclaration(AtClassLoc, IdentList, |
| 84 | NumElts); |
| 85 | } |
| 86 | |
| 87 | // Pure Printing |
| 88 | |
| 89 | /// ActOnParamDeclarator - This callback is invoked when a parameter |
| 90 | /// declarator is parsed. This callback only occurs for functions |
| 91 | /// with prototypes. S is the function prototype scope for the |
| 92 | /// parameters (C++ [basic.scope.proto]). |
| 93 | virtual DeclTy *ActOnParamDeclarator(Scope *S, Declarator &D) { |
| 94 | llvm::cout << __FUNCTION__ << " "; |
| 95 | if (IdentifierInfo *II = D.getIdentifier()) { |
| 96 | llvm::cout << "'" << II->getName() << "'"; |
| 97 | } else { |
| 98 | llvm::cout << "<anon>"; |
| 99 | } |
| 100 | llvm::cout << "\n"; |
| 101 | return 0; |
| 102 | } |
| 103 | |
| 104 | /// AddInitializerToDecl - This action is called immediately after |
| 105 | /// ParseDeclarator (when an initializer is present). The code is factored |
| 106 | /// this way to make sure we are able to handle the following: |
| 107 | /// void func() { int xx = xx; } |
| 108 | /// This allows ActOnDeclarator to register "xx" prior to parsing the |
| 109 | /// initializer. The declaration above should still result in a warning, |
| 110 | /// since the reference to "xx" is uninitialized. |
Sebastian Redl | 798d119 | 2008-12-13 16:23:55 +0000 | [diff] [blame] | 111 | virtual void AddInitializerToDecl(DeclTy *Dcl, ExprArg Init) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 112 | llvm::cout << __FUNCTION__ << "\n"; |
| 113 | } |
| 114 | |
| 115 | /// FinalizeDeclaratorGroup - After a sequence of declarators are parsed, this |
| 116 | /// gives the actions implementation a chance to process the group as a whole. |
| 117 | virtual DeclTy *FinalizeDeclaratorGroup(Scope *S, DeclTy *Group) { |
| 118 | llvm::cout << __FUNCTION__ << "\n"; |
| 119 | return 0; |
| 120 | } |
| 121 | |
| 122 | /// ActOnStartOfFunctionDef - This is called at the start of a function |
| 123 | /// definition, instead of calling ActOnDeclarator. The Declarator includes |
| 124 | /// information about formal arguments that are part of this function. |
| 125 | virtual DeclTy *ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) { |
| 126 | llvm::cout << __FUNCTION__ << "\n"; |
| 127 | return 0; |
| 128 | } |
| 129 | |
| 130 | /// ActOnStartOfFunctionDef - This is called at the start of a function |
| 131 | /// definition, after the FunctionDecl has already been created. |
| 132 | virtual DeclTy *ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclTy *D) { |
| 133 | llvm::cout << __FUNCTION__ << "\n"; |
| 134 | return 0; |
| 135 | } |
| 136 | |
Steve Naroff | ebf6443 | 2009-02-28 16:59:13 +0000 | [diff] [blame] | 137 | virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclTy *D) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 138 | llvm::cout << __FUNCTION__ << "\n"; |
| 139 | } |
| 140 | |
| 141 | /// ActOnFunctionDefBody - This is called when a function body has completed |
| 142 | /// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef. |
Sebastian Redl | 798d119 | 2008-12-13 16:23:55 +0000 | [diff] [blame] | 143 | virtual DeclTy *ActOnFinishFunctionBody(DeclTy *Decl, StmtArg Body) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 144 | llvm::cout << __FUNCTION__ << "\n"; |
| 145 | return 0; |
| 146 | } |
| 147 | |
Sebastian Redl | 798d119 | 2008-12-13 16:23:55 +0000 | [diff] [blame] | 148 | virtual DeclTy *ActOnFileScopeAsmDecl(SourceLocation Loc, ExprArg AsmString) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 149 | llvm::cout << __FUNCTION__ << "\n"; |
| 150 | return 0; |
| 151 | } |
| 152 | |
| 153 | /// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with |
| 154 | /// no declarator (e.g. "struct foo;") is parsed. |
| 155 | virtual DeclTy *ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) { |
| 156 | llvm::cout << __FUNCTION__ << "\n"; |
| 157 | return 0; |
| 158 | } |
Douglas Gregor | e79837a | 2008-12-17 01:46:43 +0000 | [diff] [blame] | 159 | |
| 160 | /// ActOnLinkageSpec - Parsed a C++ linkage-specification that |
| 161 | /// contained braces. Lang/StrSize contains the language string that |
| 162 | /// was parsed at location Loc. Decls/NumDecls provides the |
| 163 | /// declarations parsed inside the linkage specification. |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 164 | virtual DeclTy *ActOnLinkageSpec(SourceLocation Loc, SourceLocation LBrace, |
| 165 | SourceLocation RBrace, const char *Lang, |
Douglas Gregor | e79837a | 2008-12-17 01:46:43 +0000 | [diff] [blame] | 166 | unsigned StrSize, |
| 167 | DeclTy **Decls, unsigned NumDecls) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 168 | llvm::cout << __FUNCTION__ << "\n"; |
| 169 | return 0; |
| 170 | } |
Douglas Gregor | e79837a | 2008-12-17 01:46:43 +0000 | [diff] [blame] | 171 | |
| 172 | /// ActOnLinkageSpec - Parsed a C++ linkage-specification without |
| 173 | /// braces. Lang/StrSize contains the language string that was |
| 174 | /// parsed at location Loc. D is the declaration parsed. |
| 175 | virtual DeclTy *ActOnLinkageSpec(SourceLocation Loc, const char *Lang, |
| 176 | unsigned StrSize, DeclTy *D) { |
| 177 | return 0; |
| 178 | } |
| 179 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 180 | //===--------------------------------------------------------------------===// |
| 181 | // Type Parsing Callbacks. |
| 182 | //===--------------------------------------------------------------------===// |
| 183 | |
Sebastian Redl | cee63fb | 2008-12-02 14:43:59 +0000 | [diff] [blame] | 184 | virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 185 | llvm::cout << __FUNCTION__ << "\n"; |
| 186 | return 0; |
| 187 | } |
| 188 | |
| 189 | virtual DeclTy *ActOnTag(Scope *S, unsigned TagType, TagKind TK, |
Argyrios Kyrtzidis | eb83ecd | 2008-11-08 16:45:02 +0000 | [diff] [blame] | 190 | SourceLocation KWLoc, const CXXScopeSpec &SS, |
| 191 | IdentifierInfo *Name, SourceLocation NameLoc, |
Douglas Gregor | ddc29e1 | 2009-02-06 22:42:48 +0000 | [diff] [blame] | 192 | AttributeList *Attr) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 193 | // TagType is an instance of DeclSpec::TST, indicating what kind of tag this |
| 194 | // is (struct/union/enum/class). |
| 195 | llvm::cout << __FUNCTION__ << "\n"; |
| 196 | return 0; |
| 197 | } |
| 198 | |
| 199 | /// Act on @defs() element found when parsing a structure. ClassName is the |
| 200 | /// name of the referenced class. |
Douglas Gregor | 44b4321 | 2008-12-11 16:49:14 +0000 | [diff] [blame] | 201 | virtual void ActOnDefs(Scope *S, DeclTy *TagD, SourceLocation DeclStart, |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 202 | IdentifierInfo *ClassName, |
| 203 | llvm::SmallVectorImpl<DeclTy*> &Decls) { |
| 204 | llvm::cout << __FUNCTION__ << "\n"; |
| 205 | } |
| 206 | |
Douglas Gregor | 44b4321 | 2008-12-11 16:49:14 +0000 | [diff] [blame] | 207 | virtual DeclTy *ActOnField(Scope *S, DeclTy *TagD, |
| 208 | SourceLocation DeclStart, |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 209 | Declarator &D, ExprTy *BitfieldWidth) { |
| 210 | llvm::cout << __FUNCTION__ << "\n"; |
| 211 | return 0; |
| 212 | } |
| 213 | |
| 214 | virtual DeclTy *ActOnIvar(Scope *S, SourceLocation DeclStart, |
| 215 | Declarator &D, ExprTy *BitfieldWidth, |
| 216 | tok::ObjCKeywordKind visibility) { |
| 217 | llvm::cout << __FUNCTION__ << "\n"; |
| 218 | return 0; |
| 219 | } |
| 220 | |
| 221 | virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclTy *TagDecl, |
| 222 | DeclTy **Fields, unsigned NumFields, |
Daniel Dunbar | 1bfe1c2 | 2008-10-03 02:03:53 +0000 | [diff] [blame] | 223 | SourceLocation LBrac, SourceLocation RBrac, |
| 224 | AttributeList *AttrList) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 225 | llvm::cout << __FUNCTION__ << "\n"; |
| 226 | } |
| 227 | |
| 228 | virtual DeclTy *ActOnEnumConstant(Scope *S, DeclTy *EnumDecl, |
| 229 | DeclTy *LastEnumConstant, |
| 230 | SourceLocation IdLoc, IdentifierInfo *Id, |
| 231 | SourceLocation EqualLoc, ExprTy *Val) { |
| 232 | llvm::cout << __FUNCTION__ << "\n"; |
| 233 | return 0; |
| 234 | } |
| 235 | |
| 236 | virtual void ActOnEnumBody(SourceLocation EnumLoc, DeclTy *EnumDecl, |
| 237 | DeclTy **Elements, unsigned NumElements) { |
| 238 | llvm::cout << __FUNCTION__ << "\n"; |
| 239 | } |
| 240 | |
| 241 | //===--------------------------------------------------------------------===// |
| 242 | // Statement Parsing Callbacks. |
| 243 | //===--------------------------------------------------------------------===// |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 244 | |
| 245 | virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 246 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 247 | return StmtEmpty(); |
| 248 | } |
| 249 | |
| 250 | virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L, |
| 251 | SourceLocation R, |
| 252 | MultiStmtArg Elts, |
| 253 | bool isStmtExpr) { |
| 254 | llvm::cout << __FUNCTION__ << "\n"; |
| 255 | return StmtEmpty(); |
| 256 | } |
| 257 | virtual OwningStmtResult ActOnDeclStmt(DeclTy *Decl, |
| 258 | SourceLocation StartLoc, |
| 259 | SourceLocation EndLoc) { |
| 260 | llvm::cout << __FUNCTION__ << "\n"; |
| 261 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 262 | } |
| 263 | |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 264 | virtual OwningStmtResult ActOnExprStmt(ExprArg Expr) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 265 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | a60528c | 2008-12-21 12:04:03 +0000 | [diff] [blame] | 266 | return OwningStmtResult(*this, Expr.release()); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 267 | } |
| 268 | |
| 269 | /// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension, |
| 270 | /// which can specify an RHS value. |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 271 | virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc, |
| 272 | ExprArg LHSVal, |
| 273 | SourceLocation DotDotDotLoc, |
| 274 | ExprArg RHSVal, |
Chris Lattner | 24e1e70 | 2009-03-04 04:23:07 +0000 | [diff] [blame] | 275 | SourceLocation ColonLoc) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 276 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 277 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 278 | } |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 279 | virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc, |
| 280 | SourceLocation ColonLoc, |
| 281 | StmtArg SubStmt, Scope *CurScope){ |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 282 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 117054a | 2008-12-28 16:13:43 +0000 | [diff] [blame] | 283 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 284 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 285 | |
| 286 | virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc, |
| 287 | IdentifierInfo *II, |
| 288 | SourceLocation ColonLoc, |
| 289 | StmtArg SubStmt) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 290 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 291 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 292 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 293 | |
| 294 | virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc, ExprArg CondVal, |
| 295 | StmtArg ThenVal,SourceLocation ElseLoc, |
| 296 | StmtArg ElseVal) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 297 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 298 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 299 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 300 | |
| 301 | virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 302 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 303 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 304 | } |
Sebastian Redl | de30747 | 2009-01-11 00:38:46 +0000 | [diff] [blame] | 305 | |
| 306 | virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc, |
| 307 | StmtArg Switch, |
| 308 | StmtArg Body) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 309 | llvm::cout << __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 | } |
| 312 | |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 313 | virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc, |
| 314 | ExprArg Cond, StmtArg Body) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 315 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 316 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 317 | } |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 318 | virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body, |
| 319 | SourceLocation WhileLoc, ExprArg Cond){ |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 320 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 321 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 322 | } |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 323 | virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc, |
| 324 | SourceLocation LParenLoc, |
| 325 | StmtArg First, ExprArg Second, |
| 326 | ExprArg Third, SourceLocation RParenLoc, |
| 327 | StmtArg Body) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 328 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 329 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 330 | } |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 331 | virtual OwningStmtResult ActOnObjCForCollectionStmt( |
| 332 | SourceLocation ForColLoc, |
| 333 | SourceLocation LParenLoc, |
| 334 | StmtArg First, ExprArg Second, |
| 335 | SourceLocation RParenLoc, StmtArg Body) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 336 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | f05b152 | 2009-01-16 23:28:06 +0000 | [diff] [blame] | 337 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 338 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 339 | virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc, |
| 340 | SourceLocation LabelLoc, |
| 341 | IdentifierInfo *LabelII) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 342 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 343 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 344 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 345 | virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc, |
| 346 | SourceLocation StarLoc, |
| 347 | ExprArg DestExp) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 348 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 349 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 350 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 351 | virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc, |
| 352 | Scope *CurScope) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 353 | llvm::cout << __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 ActOnBreakStmt(SourceLocation GotoLoc, |
| 357 | Scope *CurScope) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 358 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 359 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 360 | } |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 361 | virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc, |
| 362 | ExprArg RetValExp) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 363 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 4cffe2f | 2009-01-18 13:19:59 +0000 | [diff] [blame] | 364 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 365 | } |
Sebastian Redl | 3037ed0 | 2009-01-18 16:53:17 +0000 | [diff] [blame] | 366 | virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc, |
| 367 | bool IsSimple, |
| 368 | bool IsVolatile, |
| 369 | unsigned NumOutputs, |
| 370 | unsigned NumInputs, |
| 371 | std::string *Names, |
| 372 | MultiExprArg Constraints, |
| 373 | MultiExprArg Exprs, |
| 374 | ExprArg AsmString, |
| 375 | MultiExprArg Clobbers, |
| 376 | SourceLocation RParenLoc) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 377 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 3037ed0 | 2009-01-18 16:53:17 +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 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 381 | // Objective-c statements |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 382 | virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc, |
| 383 | SourceLocation RParen, |
Steve Naroff | 7ba138a | 2009-03-03 19:52:17 +0000 | [diff] [blame] | 384 | DeclTy *Parm, StmtArg Body, |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 385 | StmtArg CatchList) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 386 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 387 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 388 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 389 | |
| 390 | virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc, |
| 391 | StmtArg Body) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 392 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 393 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 394 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 395 | |
| 396 | virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc, |
| 397 | StmtArg Try, StmtArg Catch, |
| 398 | StmtArg Finally) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 399 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 400 | return StmtEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 401 | } |
Sebastian Redl | 431e90e | 2009-01-18 17:43:11 +0000 | [diff] [blame] | 402 | |
| 403 | virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc, |
Steve Naroff | e21dd6f | 2009-02-11 20:05:44 +0000 | [diff] [blame] | 404 | ExprArg Throw, |
| 405 | Scope *CurScope) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 406 | llvm::cout << __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 ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc, |
| 411 | ExprArg SynchExpr, |
| 412 | StmtArg SynchBody) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 413 | llvm::cout << __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 | a0fd865 | 2008-12-21 16:41:36 +0000 | [diff] [blame] | 416 | |
| 417 | // C++ Statements |
| 418 | virtual DeclTy *ActOnExceptionDeclarator(Scope *S, Declarator &D) { |
| 419 | llvm::cout << __FUNCTION__ << "\n"; |
| 420 | return 0; |
| 421 | } |
| 422 | |
| 423 | virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc, |
| 424 | DeclTy *ExceptionDecl, |
| 425 | StmtArg HandlerBlock) { |
| 426 | llvm::cout << __FUNCTION__ << "\n"; |
| 427 | return StmtEmpty(); |
| 428 | } |
| 429 | |
| 430 | virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc, |
| 431 | StmtArg TryBlock, |
| 432 | MultiStmtArg Handlers) { |
| 433 | llvm::cout << __FUNCTION__ << "\n"; |
| 434 | return StmtEmpty(); |
| 435 | } |
| 436 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 437 | //===--------------------------------------------------------------------===// |
| 438 | // Expression Parsing Callbacks. |
| 439 | //===--------------------------------------------------------------------===// |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 440 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 441 | // Primary Expressions. |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 442 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 443 | /// ActOnIdentifierExpr - Parse an identifier in expression context. |
| 444 | /// 'HasTrailingLParen' indicates whether or not the identifier has a '(' |
| 445 | /// token immediately after it. |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 446 | virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc, |
| 447 | IdentifierInfo &II, |
| 448 | bool HasTrailingLParen, |
Sebastian Redl | ebc07d5 | 2009-02-03 20:19:35 +0000 | [diff] [blame] | 449 | const CXXScopeSpec *SS, |
| 450 | bool isAddressOfOperand) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 451 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 452 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 453 | } |
| 454 | |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 455 | virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr( |
| 456 | Scope *S, SourceLocation OperatorLoc, |
| 457 | OverloadedOperatorKind Op, |
Sebastian Redl | ebc07d5 | 2009-02-03 20:19:35 +0000 | [diff] [blame] | 458 | bool HasTrailingLParen, const CXXScopeSpec &SS, |
| 459 | bool isAddressOfOperand) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 460 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 461 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 462 | } |
| 463 | |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 464 | virtual OwningExprResult ActOnCXXConversionFunctionExpr( |
| 465 | Scope *S, SourceLocation OperatorLoc, |
| 466 | TypeTy *Type, bool HasTrailingLParen, |
Sebastian Redl | ebc07d5 | 2009-02-03 20:19:35 +0000 | [diff] [blame] | 467 | const CXXScopeSpec &SS,bool isAddressOfOperand) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 468 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 469 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 470 | } |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 471 | |
| 472 | virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc, |
| 473 | tok::TokenKind Kind) { |
| 474 | llvm::cout << __FUNCTION__ << "\n"; |
| 475 | return ExprEmpty(); |
| 476 | } |
| 477 | |
| 478 | virtual OwningExprResult ActOnCharacterConstant(const Token &) { |
| 479 | llvm::cout << __FUNCTION__ << "\n"; |
| 480 | return ExprEmpty(); |
| 481 | } |
| 482 | |
| 483 | virtual OwningExprResult ActOnNumericConstant(const Token &) { |
| 484 | llvm::cout << __FUNCTION__ << "\n"; |
| 485 | return ExprEmpty(); |
| 486 | } |
| 487 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 488 | /// ActOnStringLiteral - The specified tokens were lexed as pasted string |
| 489 | /// fragments (e.g. "foo" "bar" L"baz"). |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 490 | virtual OwningExprResult ActOnStringLiteral(const Token *Toks, |
| 491 | unsigned NumToks) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 492 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 493 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 494 | } |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 495 | |
| 496 | virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R, |
| 497 | ExprArg Val) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 498 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 76ad2e8 | 2009-02-05 15:02:23 +0000 | [diff] [blame] | 499 | return move(Val); // Default impl returns operand. |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 500 | } |
Sebastian Redl | cd965b9 | 2009-01-18 18:53:16 +0000 | [diff] [blame] | 501 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 502 | // Postfix Expressions. |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 503 | virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc, |
| 504 | tok::TokenKind Kind, |
| 505 | ExprArg Input) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 506 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 507 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 508 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 509 | virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base, |
| 510 | SourceLocation LLoc, |
| 511 | ExprArg Idx, |
| 512 | SourceLocation RLoc) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 513 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 514 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 515 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 516 | virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base, |
| 517 | SourceLocation OpLoc, |
| 518 | tok::TokenKind OpKind, |
| 519 | SourceLocation MemberLoc, |
Fariborz Jahanian | a6e3ac5 | 2009-03-04 22:30:12 +0000 | [diff] [blame^] | 520 | IdentifierInfo &Member, |
| 521 | DeclTy *ImplDecl) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 522 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 523 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 524 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 525 | |
| 526 | virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn, |
| 527 | SourceLocation LParenLoc, |
| 528 | MultiExprArg Args, |
| 529 | SourceLocation *CommaLocs, |
| 530 | SourceLocation RParenLoc) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 531 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 532 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 533 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 534 | |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 535 | // Unary Operators. 'Tok' is the token for the operator. |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 536 | virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc, |
| 537 | tok::TokenKind Op, ExprArg Input) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 538 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 539 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 540 | } |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 541 | virtual OwningExprResult |
| 542 | ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType, |
| 543 | void *TyOrEx, const SourceRange &ArgRange) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 544 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | 0eb2330 | 2009-01-19 00:08:26 +0000 | [diff] [blame] | 545 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 546 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 547 | |
| 548 | virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen, |
| 549 | TypeTy *Ty, |
| 550 | SourceLocation RParen, |
| 551 | ExprArg Op) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 552 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 553 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 554 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 555 | virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc, |
| 556 | MultiExprArg InitList, |
| 557 | InitListDesignations &Designators, |
| 558 | SourceLocation RParenLoc) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 559 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +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 | virtual OwningExprResult ActOnCastExpr(SourceLocation LParenLoc, TypeTy *Ty, |
| 563 | SourceLocation RParenLoc,ExprArg Op){ |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 564 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 565 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 566 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 567 | |
| 568 | virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc, |
| 569 | tok::TokenKind Kind, |
| 570 | ExprArg LHS, ExprArg RHS) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 571 | llvm::cout << __FUNCTION__ << "\n"; |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 572 | return ExprEmpty(); |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 573 | } |
| 574 | |
| 575 | /// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null |
| 576 | /// in the case of a the GNU conditional expr extension. |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 577 | virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc, |
| 578 | SourceLocation ColonLoc, |
| 579 | ExprArg Cond, ExprArg LHS, |
| 580 | ExprArg RHS) { |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 581 | llvm::cout << __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 | } |
Sebastian Redl | b8a6aca | 2009-01-19 22:31:54 +0000 | [diff] [blame] | 584 | |
| 585 | //===--------------------- GNU Extension Expressions ------------------===// |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 586 | |
| 587 | virtual ExprResult ActOnAddrLabel(SourceLocation OpLoc, SourceLocation LabLoc, |
| 588 | IdentifierInfo *LabelII) { // "&&foo" |
| 589 | llvm::cout << __FUNCTION__ << "\n"; |
| 590 | return 0; |
| 591 | } |
| 592 | |
| 593 | virtual ExprResult ActOnStmtExpr(SourceLocation LPLoc, StmtTy *SubStmt, |
| 594 | SourceLocation RPLoc) { // "({..})" |
| 595 | llvm::cout << __FUNCTION__ << "\n"; |
| 596 | return 0; |
| 597 | } |
| 598 | |
Douglas Gregor | 3fc749d | 2008-12-23 00:26:44 +0000 | [diff] [blame] | 599 | virtual ExprResult ActOnBuiltinOffsetOf(Scope *S, SourceLocation BuiltinLoc, |
Daniel Dunbar | bb8f4e6 | 2008-08-01 00:41:12 +0000 | [diff] [blame] | 600 | SourceLocation TypeLoc, TypeTy *Arg1, |
| 601 | OffsetOfComponent *CompPtr, |
| 602 | unsigned NumComponents, |
| 603 | SourceLocation RParenLoc) { |
| 604 | llvm::cout << __FUNCTION__ << "\n"; |
| 605 | return 0; |
| 606 | } |
| 607 | |
| 608 | // __builtin_types_compatible_p(type1, type2) |
| 609 | virtual ExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc, |
| 610 | TypeTy *arg1, TypeTy *arg2, |
| 611 | SourceLocation RPLoc) { |
| 612 | llvm::cout << __FUNCTION__ << "\n"; |
| 613 | return 0; |
| 614 | } |
| 615 | // __builtin_choose_expr(constExpr, expr1, expr2) |
| 616 | virtual ExprResult ActOnChooseExpr(SourceLocation BuiltinLoc, |
| 617 | ExprTy *cond, ExprTy *expr1, ExprTy *expr2, |
| 618 | SourceLocation RPLoc) { |
| 619 | llvm::cout << __FUNCTION__ << "\n"; |
| 620 | return 0; |
| 621 | } |
| 622 | // __builtin_overload(...) |
| 623 | virtual ExprResult ActOnOverloadExpr(ExprTy **Args, unsigned NumArgs, |
| 624 | SourceLocation *CommaLocs, |
| 625 | SourceLocation BuiltinLoc, |
| 626 | SourceLocation RPLoc) { |
| 627 | llvm::cout << __FUNCTION__ << "\n"; |
| 628 | return 0; |
| 629 | } |
| 630 | |
| 631 | |
| 632 | // __builtin_va_arg(expr, type) |
| 633 | virtual ExprResult ActOnVAArg(SourceLocation BuiltinLoc, |
| 634 | ExprTy *expr, TypeTy *type, |
| 635 | SourceLocation RPLoc) { |
| 636 | llvm::cout << __FUNCTION__ << "\n"; |
| 637 | return 0; |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 638 | } |
| 639 | }; |
| 640 | } |
| 641 | |
Daniel Dunbar | e10b0f2 | 2008-10-31 08:56:51 +0000 | [diff] [blame] | 642 | MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP) { |
| 643 | return new ParserPrintActions(PP); |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 644 | } |