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