2006-08-17 13:51:27 +08:00
|
|
|
//===--- PrintParserActions.cpp - Implement -parse-print-callbacks mode ---===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-30 03:59:25 +08:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-08-17 13:51:27 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This code simply runs the preprocessor on the input file and prints out the
|
|
|
|
// result. This is the traditional behavior of the -E option.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2009-05-19 12:14:29 +08:00
|
|
|
#include "clang/Frontend/Utils.h"
|
2006-08-17 13:51:27 +08:00
|
|
|
#include "clang/Parse/Action.h"
|
2006-11-12 07:03:42 +08:00
|
|
|
#include "clang/Parse/DeclSpec.h"
|
2009-05-19 09:02:07 +08:00
|
|
|
#include "llvm/Support/raw_ostream.h"
|
2006-08-17 13:51:27 +08:00
|
|
|
using namespace clang;
|
|
|
|
|
|
|
|
namespace {
|
2006-11-06 02:44:26 +08:00
|
|
|
class ParserPrintActions : public MinimalAction {
|
2009-05-19 09:02:07 +08:00
|
|
|
llvm::raw_ostream& Out;
|
|
|
|
|
2007-11-01 04:55:39 +08:00
|
|
|
public:
|
2009-05-19 09:02:07 +08:00
|
|
|
ParserPrintActions(Preprocessor &PP, llvm::raw_ostream& OS)
|
|
|
|
: MinimalAction(PP), Out(OS) {}
|
2008-08-01 08:41:12 +08:00
|
|
|
|
|
|
|
// Printing Functions which also must call MinimalAction
|
|
|
|
|
2007-09-16 02:49:24 +08:00
|
|
|
/// ActOnDeclarator - This callback is invoked when a declarator is parsed
|
2006-10-16 08:33:54 +08:00
|
|
|
/// and 'Init' specifies the initializer if any. This is for things like:
|
2006-08-17 13:51:27 +08:00
|
|
|
/// "int X = 4" or "typedef int foo".
|
2009-03-30 00:50:03 +08:00
|
|
|
virtual DeclPtrTy ActOnDeclarator(Scope *S, Declarator &D) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << " ";
|
2006-08-17 13:51:27 +08:00
|
|
|
if (IdentifierInfo *II = D.getIdentifier()) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << "'" << II->getName() << "'";
|
2006-08-17 13:51:27 +08:00
|
|
|
} else {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << "<anon>";
|
2006-08-17 13:51:27 +08:00
|
|
|
}
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << "\n";
|
2006-08-17 13:51:27 +08:00
|
|
|
|
|
|
|
// Pass up to EmptyActions so that the symbol table is maintained right.
|
2009-03-30 00:50:03 +08:00
|
|
|
return MinimalAction::ActOnDeclarator(S, D);
|
2006-08-17 13:51:27 +08:00
|
|
|
}
|
2007-10-11 01:45:44 +08:00
|
|
|
/// ActOnPopScope - This callback is called immediately before the specified
|
|
|
|
/// scope is popped and deleted.
|
|
|
|
virtual void ActOnPopScope(SourceLocation Loc, Scope *S) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-08-01 08:41:12 +08:00
|
|
|
return MinimalAction::ActOnPopScope(Loc, S);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// ActOnTranslationUnitScope - This callback is called once, immediately
|
|
|
|
/// after creating the translation unit scope (in Parser::Initialize).
|
|
|
|
virtual void ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-08-01 08:41:12 +08:00
|
|
|
MinimalAction::ActOnTranslationUnitScope(Loc, S);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
Action::DeclPtrTy ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
|
|
|
|
IdentifierInfo *ClassName,
|
|
|
|
SourceLocation ClassLoc,
|
|
|
|
IdentifierInfo *SuperName,
|
|
|
|
SourceLocation SuperLoc,
|
|
|
|
const DeclPtrTy *ProtoRefs,
|
|
|
|
unsigned NumProtocols,
|
|
|
|
SourceLocation EndProtoLoc,
|
|
|
|
AttributeList *AttrList) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-08-01 08:41:12 +08:00
|
|
|
return MinimalAction::ActOnStartClassInterface(AtInterfaceLoc,
|
|
|
|
ClassName, ClassLoc,
|
|
|
|
SuperName, SuperLoc,
|
|
|
|
ProtoRefs, NumProtocols,
|
|
|
|
EndProtoLoc, AttrList);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// ActOnForwardClassDeclaration -
|
|
|
|
/// Scope will always be top level file scope.
|
2009-03-29 03:18:32 +08:00
|
|
|
Action::DeclPtrTy ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
|
|
|
|
IdentifierInfo **IdentList,
|
|
|
|
unsigned NumElts) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-08-01 08:41:12 +08:00
|
|
|
return MinimalAction::ActOnForwardClassDeclaration(AtClassLoc, IdentList,
|
|
|
|
NumElts);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Pure Printing
|
|
|
|
|
|
|
|
/// ActOnParamDeclarator - This callback is invoked when a parameter
|
|
|
|
/// declarator is parsed. This callback only occurs for functions
|
|
|
|
/// with prototypes. S is the function prototype scope for the
|
|
|
|
/// parameters (C++ [basic.scope.proto]).
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnParamDeclarator(Scope *S, Declarator &D) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << " ";
|
2008-08-01 08:41:12 +08:00
|
|
|
if (IdentifierInfo *II = D.getIdentifier()) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << "'" << II->getName() << "'";
|
2008-08-01 08:41:12 +08:00
|
|
|
} else {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << "<anon>";
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// AddInitializerToDecl - This action is called immediately after
|
|
|
|
/// ParseDeclarator (when an initializer is present). The code is factored
|
|
|
|
/// this way to make sure we are able to handle the following:
|
|
|
|
/// void func() { int xx = xx; }
|
|
|
|
/// This allows ActOnDeclarator to register "xx" prior to parsing the
|
|
|
|
/// initializer. The declaration above should still result in a warning,
|
|
|
|
/// since the reference to "xx" is uninitialized.
|
2009-08-16 13:13:48 +08:00
|
|
|
virtual void AddInitializerToDecl(DeclPtrTy Dcl, ExprArg Init) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-03-30 00:50:03 +08:00
|
|
|
/// FinalizeDeclaratorGroup - After a sequence of declarators are parsed,
|
|
|
|
/// this gives the actions implementation a chance to process the group as
|
|
|
|
/// a whole.
|
2009-05-29 09:49:24 +08:00
|
|
|
virtual DeclGroupPtrTy FinalizeDeclaratorGroup(Scope *S, const DeclSpec& DS,
|
|
|
|
DeclPtrTy *Group,
|
2009-03-30 00:50:03 +08:00
|
|
|
unsigned NumDecls) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-30 00:50:03 +08:00
|
|
|
return DeclGroupPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// ActOnStartOfFunctionDef - This is called at the start of a function
|
|
|
|
/// definition, instead of calling ActOnDeclarator. The Declarator includes
|
|
|
|
/// information about formal arguments that are part of this function.
|
2009-03-30 00:50:03 +08:00
|
|
|
virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope,
|
|
|
|
Declarator &D){
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// ActOnStartOfFunctionDef - This is called at the start of a function
|
|
|
|
/// definition, after the FunctionDecl has already been created.
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnStartOfFunctionDef(Scope *FnBodyScope, DeclPtrTy D) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual void ActOnStartOfObjCMethodDef(Scope *FnBodyScope, DeclPtrTy D) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// ActOnFunctionDefBody - This is called when a function body has completed
|
|
|
|
/// parsing. Decl is the DeclTy returned by ParseStartOfFunctionDef.
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnFinishFunctionBody(DeclPtrTy Decl, StmtArg Body) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnFileScopeAsmDecl(SourceLocation Loc,
|
|
|
|
ExprArg AsmString) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
|
|
|
|
/// no declarator (e.g. "struct foo;") is parsed.
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ParsedFreeStandingDeclSpec(Scope *S, DeclSpec &DS) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2008-12-17 09:46:43 +08:00
|
|
|
|
|
|
|
/// ActOnLinkageSpec - Parsed a C++ linkage-specification that
|
|
|
|
/// contained braces. Lang/StrSize contains the language string that
|
|
|
|
/// was parsed at location Loc. Decls/NumDecls provides the
|
|
|
|
/// declarations parsed inside the linkage specification.
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc,
|
|
|
|
SourceLocation LBrace,
|
|
|
|
SourceLocation RBrace, const char *Lang,
|
|
|
|
unsigned StrSize,
|
|
|
|
DeclPtrTy *Decls, unsigned NumDecls) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2008-12-17 09:46:43 +08:00
|
|
|
|
|
|
|
/// ActOnLinkageSpec - Parsed a C++ linkage-specification without
|
|
|
|
/// braces. Lang/StrSize contains the language string that was
|
|
|
|
/// parsed at location Loc. D is the declaration parsed.
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnLinkageSpec(SourceLocation Loc, const char *Lang,
|
|
|
|
unsigned StrSize, DeclPtrTy D) {
|
|
|
|
return DeclPtrTy();
|
2008-12-17 09:46:43 +08:00
|
|
|
}
|
|
|
|
|
2009-05-16 15:06:02 +08:00
|
|
|
//===------------------------------------------------------------------===//
|
2008-08-01 08:41:12 +08:00
|
|
|
// Type Parsing Callbacks.
|
2009-05-16 15:06:02 +08:00
|
|
|
//===------------------------------------------------------------------===//
|
2008-08-01 08:41:12 +08:00
|
|
|
|
2008-12-02 22:43:59 +08:00
|
|
|
virtual TypeResult ActOnTypeName(Scope *S, Declarator &D) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return TypeResult();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-07-31 10:45:11 +08:00
|
|
|
virtual DeclPtrTy ActOnTag(Scope *S, unsigned TagType, TagUseKind TUK,
|
2009-03-29 03:18:32 +08:00
|
|
|
SourceLocation KWLoc, const CXXScopeSpec &SS,
|
|
|
|
IdentifierInfo *Name, SourceLocation NameLoc,
|
When we parse a tag specifier, keep track of whether that tag
specifier resulted in the creation of a new TagDecl node, which
happens either when the tag specifier was a definition or when the tag
specifier was the first declaration of that tag type. This information
has several uses, the first of which is implemented in this commit:
1) In C++, one is not allowed to define tag types within a type
specifier (e.g., static_cast<struct S { int x; } *>(0) is
ill-formed) or within the result or parameter types of a
function. We now diagnose this.
2) We can extend DeclGroups to contain information about any tags
that are declared/defined within the declaration specifiers of a
variable, e.g.,
struct Point { int x, y, z; } p;
This will help improve AST printing and template instantiation,
among other things.
3) For C99, we can keep track of whether a tag type is defined
within the type of a parameter, to properly cope with cases like,
e.g.,
int bar(struct T2 { int x; } y) {
struct T2 z;
}
We can also do similar things wherever there is a type specifier,
e.g., to keep track of where the definition of S occurs in this
legal C99 code:
(struct S { int x, y; } *)0
llvm-svn: 72555
2009-05-29 07:31:59 +08:00
|
|
|
AttributeList *Attr, AccessSpecifier AS,
|
2009-07-24 00:36:45 +08:00
|
|
|
MultiTemplateParamsArg TemplateParamLists,
|
When we parse a tag specifier, keep track of whether that tag
specifier resulted in the creation of a new TagDecl node, which
happens either when the tag specifier was a definition or when the tag
specifier was the first declaration of that tag type. This information
has several uses, the first of which is implemented in this commit:
1) In C++, one is not allowed to define tag types within a type
specifier (e.g., static_cast<struct S { int x; } *>(0) is
ill-formed) or within the result or parameter types of a
function. We now diagnose this.
2) We can extend DeclGroups to contain information about any tags
that are declared/defined within the declaration specifiers of a
variable, e.g.,
struct Point { int x, y, z; } p;
This will help improve AST printing and template instantiation,
among other things.
3) For C99, we can keep track of whether a tag type is defined
within the type of a parameter, to properly cope with cases like,
e.g.,
int bar(struct T2 { int x; } y) {
struct T2 z;
}
We can also do similar things wherever there is a type specifier,
e.g., to keep track of where the definition of S occurs in this
legal C99 code:
(struct S { int x, y; } *)0
llvm-svn: 72555
2009-05-29 07:31:59 +08:00
|
|
|
bool &Owned) {
|
2008-08-01 08:41:12 +08:00
|
|
|
// TagType is an instance of DeclSpec::TST, indicating what kind of tag this
|
|
|
|
// is (struct/union/enum/class).
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Act on @defs() element found when parsing a structure. ClassName is the
|
|
|
|
/// name of the referenced class.
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual void ActOnDefs(Scope *S, DeclPtrTy TagD, SourceLocation DeclStart,
|
2008-08-01 08:41:12 +08:00
|
|
|
IdentifierInfo *ClassName,
|
2009-03-29 03:18:32 +08:00
|
|
|
llvm::SmallVectorImpl<DeclPtrTy> &Decls) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnField(Scope *S, DeclPtrTy TagD,
|
|
|
|
SourceLocation DeclStart,
|
|
|
|
Declarator &D, ExprTy *BitfieldWidth) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnIvar(Scope *S, SourceLocation DeclStart,
|
2009-06-06 02:16:35 +08:00
|
|
|
DeclPtrTy IntfDecl,
|
2009-03-29 03:18:32 +08:00
|
|
|
Declarator &D, ExprTy *BitfieldWidth,
|
|
|
|
tok::ObjCKeywordKind visibility) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual void ActOnFields(Scope* S, SourceLocation RecLoc, DeclPtrTy TagDecl,
|
|
|
|
DeclPtrTy *Fields, unsigned NumFields,
|
2008-10-03 10:03:53 +08:00
|
|
|
SourceLocation LBrac, SourceLocation RBrac,
|
|
|
|
AttributeList *AttrList) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnEnumConstant(Scope *S, DeclPtrTy EnumDecl,
|
|
|
|
DeclPtrTy LastEnumConstant,
|
|
|
|
SourceLocation IdLoc,IdentifierInfo *Id,
|
|
|
|
SourceLocation EqualLoc, ExprTy *Val) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-05-16 15:06:02 +08:00
|
|
|
virtual void ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc,
|
|
|
|
SourceLocation RBraceLoc, DeclPtrTy EnumDecl,
|
2009-08-08 22:36:57 +08:00
|
|
|
DeclPtrTy *Elements, unsigned NumElements,
|
|
|
|
Scope *S, AttributeList *AttrList) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-05-16 15:06:02 +08:00
|
|
|
//===------------------------------------------------------------------===//
|
2008-08-01 08:41:12 +08:00
|
|
|
// Statement Parsing Callbacks.
|
2009-05-16 15:06:02 +08:00
|
|
|
//===------------------------------------------------------------------===//
|
2008-12-21 20:04:03 +08:00
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnNullStmt(SourceLocation SemiLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-12-21 20:04:03 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2008-12-21 20:04:03 +08:00
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnCompoundStmt(SourceLocation L,
|
|
|
|
SourceLocation R,
|
|
|
|
MultiStmtArg Elts,
|
|
|
|
bool isStmtExpr) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-12-21 20:04:03 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-03-30 00:50:03 +08:00
|
|
|
virtual OwningStmtResult ActOnDeclStmt(DeclGroupPtrTy Decl,
|
2008-12-21 20:04:03 +08:00
|
|
|
SourceLocation StartLoc,
|
|
|
|
SourceLocation EndLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-12-21 20:04:03 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-05-18 05:11:30 +08:00
|
|
|
virtual OwningStmtResult ActOnExprStmt(FullExprArg Expr) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-05-18 05:11:30 +08:00
|
|
|
return OwningStmtResult(*this, Expr->release());
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// ActOnCaseStmt - Note that this handles the GNU 'case 1 ... 4' extension,
|
|
|
|
/// which can specify an RHS value.
|
2008-12-29 00:13:43 +08:00
|
|
|
virtual OwningStmtResult ActOnCaseStmt(SourceLocation CaseLoc,
|
|
|
|
ExprArg LHSVal,
|
|
|
|
SourceLocation DotDotDotLoc,
|
|
|
|
ExprArg RHSVal,
|
2009-03-04 12:23:07 +08:00
|
|
|
SourceLocation ColonLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-12-29 00:13:43 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2008-12-29 00:13:43 +08:00
|
|
|
virtual OwningStmtResult ActOnDefaultStmt(SourceLocation DefaultLoc,
|
|
|
|
SourceLocation ColonLoc,
|
|
|
|
StmtArg SubStmt, Scope *CurScope){
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-12-29 00:13:43 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-11 08:38:46 +08:00
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnLabelStmt(SourceLocation IdentLoc,
|
|
|
|
IdentifierInfo *II,
|
|
|
|
SourceLocation ColonLoc,
|
|
|
|
StmtArg SubStmt) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-11 08:38:46 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-11 08:38:46 +08:00
|
|
|
|
2009-05-18 02:26:53 +08:00
|
|
|
virtual OwningStmtResult ActOnIfStmt(SourceLocation IfLoc,
|
|
|
|
FullExprArg CondVal, StmtArg ThenVal,
|
|
|
|
SourceLocation ElseLoc,
|
2009-01-11 08:38:46 +08:00
|
|
|
StmtArg ElseVal) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-11 08:38:46 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-11 08:38:46 +08:00
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnStartOfSwitchStmt(ExprArg Cond) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-11 08:38:46 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-11 08:38:46 +08:00
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnFinishSwitchStmt(SourceLocation SwitchLoc,
|
|
|
|
StmtArg Switch,
|
|
|
|
StmtArg Body) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-11 08:38:46 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-01-17 07:28:06 +08:00
|
|
|
virtual OwningStmtResult ActOnWhileStmt(SourceLocation WhileLoc,
|
2009-05-18 05:22:26 +08:00
|
|
|
FullExprArg Cond, StmtArg Body) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-17 07:28:06 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-17 07:28:06 +08:00
|
|
|
virtual OwningStmtResult ActOnDoStmt(SourceLocation DoLoc, StmtArg Body,
|
2009-06-13 07:04:47 +08:00
|
|
|
SourceLocation WhileLoc,
|
|
|
|
SourceLocation LPLoc, ExprArg Cond,
|
|
|
|
SourceLocation RPLoc){
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-17 07:28:06 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-17 07:28:06 +08:00
|
|
|
virtual OwningStmtResult ActOnForStmt(SourceLocation ForLoc,
|
|
|
|
SourceLocation LParenLoc,
|
|
|
|
StmtArg First, ExprArg Second,
|
|
|
|
ExprArg Third, SourceLocation RParenLoc,
|
|
|
|
StmtArg Body) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-17 07:28:06 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-17 07:28:06 +08:00
|
|
|
virtual OwningStmtResult ActOnObjCForCollectionStmt(
|
|
|
|
SourceLocation ForColLoc,
|
|
|
|
SourceLocation LParenLoc,
|
|
|
|
StmtArg First, ExprArg Second,
|
|
|
|
SourceLocation RParenLoc, StmtArg Body) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-17 07:28:06 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-18 21:19:59 +08:00
|
|
|
virtual OwningStmtResult ActOnGotoStmt(SourceLocation GotoLoc,
|
|
|
|
SourceLocation LabelLoc,
|
|
|
|
IdentifierInfo *LabelII) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-18 21:19:59 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-18 21:19:59 +08:00
|
|
|
virtual OwningStmtResult ActOnIndirectGotoStmt(SourceLocation GotoLoc,
|
|
|
|
SourceLocation StarLoc,
|
|
|
|
ExprArg DestExp) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-18 21:19:59 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-18 21:19:59 +08:00
|
|
|
virtual OwningStmtResult ActOnContinueStmt(SourceLocation ContinueLoc,
|
|
|
|
Scope *CurScope) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-18 21:19:59 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-18 21:19:59 +08:00
|
|
|
virtual OwningStmtResult ActOnBreakStmt(SourceLocation GotoLoc,
|
|
|
|
Scope *CurScope) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-18 21:19:59 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-18 21:19:59 +08:00
|
|
|
virtual OwningStmtResult ActOnReturnStmt(SourceLocation ReturnLoc,
|
2009-05-31 05:42:34 +08:00
|
|
|
FullExprArg RetValExp) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-18 21:19:59 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 00:53:17 +08:00
|
|
|
virtual OwningStmtResult ActOnAsmStmt(SourceLocation AsmLoc,
|
2009-05-16 15:06:02 +08:00
|
|
|
bool IsSimple,
|
2009-01-19 00:53:17 +08:00
|
|
|
bool IsVolatile,
|
|
|
|
unsigned NumOutputs,
|
|
|
|
unsigned NumInputs,
|
|
|
|
std::string *Names,
|
|
|
|
MultiExprArg Constraints,
|
|
|
|
MultiExprArg Exprs,
|
|
|
|
ExprArg AsmString,
|
|
|
|
MultiExprArg Clobbers,
|
|
|
|
SourceLocation RParenLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 00:53:17 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 00:53:17 +08:00
|
|
|
|
2008-08-01 08:41:12 +08:00
|
|
|
// Objective-c statements
|
2009-01-19 01:43:11 +08:00
|
|
|
virtual OwningStmtResult ActOnObjCAtCatchStmt(SourceLocation AtLoc,
|
|
|
|
SourceLocation RParen,
|
2009-03-29 03:18:32 +08:00
|
|
|
DeclPtrTy Parm, StmtArg Body,
|
2009-01-19 01:43:11 +08:00
|
|
|
StmtArg CatchList) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 01:43:11 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 01:43:11 +08:00
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnObjCAtFinallyStmt(SourceLocation AtLoc,
|
|
|
|
StmtArg Body) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 01:43:11 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 01:43:11 +08:00
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnObjCAtTryStmt(SourceLocation AtLoc,
|
|
|
|
StmtArg Try, StmtArg Catch,
|
|
|
|
StmtArg Finally) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 01:43:11 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 01:43:11 +08:00
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnObjCAtThrowStmt(SourceLocation AtLoc,
|
2009-02-12 04:05:44 +08:00
|
|
|
ExprArg Throw,
|
|
|
|
Scope *CurScope) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 01:43:11 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 01:43:11 +08:00
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnObjCAtSynchronizedStmt(SourceLocation AtLoc,
|
|
|
|
ExprArg SynchExpr,
|
|
|
|
StmtArg SynchBody) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 01:43:11 +08:00
|
|
|
return StmtEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2008-12-22 00:41:36 +08:00
|
|
|
|
|
|
|
// C++ Statements
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnExceptionDeclarator(Scope *S, Declarator &D) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-12-22 00:41:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnCXXCatchBlock(SourceLocation CatchLoc,
|
2009-03-29 03:18:32 +08:00
|
|
|
DeclPtrTy ExceptionDecl,
|
2008-12-22 00:41:36 +08:00
|
|
|
StmtArg HandlerBlock) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-12-22 00:41:36 +08:00
|
|
|
return StmtEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningStmtResult ActOnCXXTryBlock(SourceLocation TryLoc,
|
|
|
|
StmtArg TryBlock,
|
|
|
|
MultiStmtArg Handlers) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2008-12-22 00:41:36 +08:00
|
|
|
return StmtEmpty();
|
|
|
|
}
|
|
|
|
|
2009-05-16 15:06:02 +08:00
|
|
|
//===------------------------------------------------------------------===//
|
2008-08-01 08:41:12 +08:00
|
|
|
// Expression Parsing Callbacks.
|
2009-05-16 15:06:02 +08:00
|
|
|
//===------------------------------------------------------------------===//
|
2009-01-19 02:53:16 +08:00
|
|
|
|
2008-08-01 08:41:12 +08:00
|
|
|
// Primary Expressions.
|
2009-01-19 02:53:16 +08:00
|
|
|
|
2008-08-01 08:41:12 +08:00
|
|
|
/// ActOnIdentifierExpr - Parse an identifier in expression context.
|
|
|
|
/// 'HasTrailingLParen' indicates whether or not the identifier has a '('
|
|
|
|
/// token immediately after it.
|
2009-01-19 02:53:16 +08:00
|
|
|
virtual OwningExprResult ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
|
|
|
|
IdentifierInfo &II,
|
|
|
|
bool HasTrailingLParen,
|
2009-02-04 04:19:35 +08:00
|
|
|
const CXXScopeSpec *SS,
|
|
|
|
bool isAddressOfOperand) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 02:53:16 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 02:53:16 +08:00
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCXXOperatorFunctionIdExpr(
|
|
|
|
Scope *S, SourceLocation OperatorLoc,
|
|
|
|
OverloadedOperatorKind Op,
|
2009-02-04 04:19:35 +08:00
|
|
|
bool HasTrailingLParen, const CXXScopeSpec &SS,
|
|
|
|
bool isAddressOfOperand) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 02:53:16 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-01-19 02:53:16 +08:00
|
|
|
virtual OwningExprResult ActOnCXXConversionFunctionExpr(
|
|
|
|
Scope *S, SourceLocation OperatorLoc,
|
|
|
|
TypeTy *Type, bool HasTrailingLParen,
|
2009-02-04 04:19:35 +08:00
|
|
|
const CXXScopeSpec &SS,bool isAddressOfOperand) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 02:53:16 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
2009-01-19 02:53:16 +08:00
|
|
|
virtual OwningExprResult ActOnPredefinedExpr(SourceLocation Loc,
|
|
|
|
tok::TokenKind Kind) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 02:53:16 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 02:53:16 +08:00
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCharacterConstant(const Token &) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 02:53:16 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnNumericConstant(const Token &) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 02:53:16 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
2008-08-01 08:41:12 +08:00
|
|
|
/// ActOnStringLiteral - The specified tokens were lexed as pasted string
|
|
|
|
/// fragments (e.g. "foo" "bar" L"baz").
|
2009-01-19 02:53:16 +08:00
|
|
|
virtual OwningExprResult ActOnStringLiteral(const Token *Toks,
|
|
|
|
unsigned NumToks) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 02:53:16 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 02:53:16 +08:00
|
|
|
|
|
|
|
virtual OwningExprResult ActOnParenExpr(SourceLocation L, SourceLocation R,
|
|
|
|
ExprArg Val) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-02-05 23:02:23 +08:00
|
|
|
return move(Val); // Default impl returns operand.
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 02:53:16 +08:00
|
|
|
|
2008-08-01 08:41:12 +08:00
|
|
|
// Postfix Expressions.
|
2009-01-19 08:08:26 +08:00
|
|
|
virtual OwningExprResult ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc,
|
|
|
|
tok::TokenKind Kind,
|
|
|
|
ExprArg Input) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 08:08:26 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 08:08:26 +08:00
|
|
|
virtual OwningExprResult ActOnArraySubscriptExpr(Scope *S, ExprArg Base,
|
|
|
|
SourceLocation LLoc,
|
|
|
|
ExprArg Idx,
|
|
|
|
SourceLocation RLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 08:08:26 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 08:08:26 +08:00
|
|
|
virtual OwningExprResult ActOnMemberReferenceExpr(Scope *S, ExprArg Base,
|
|
|
|
SourceLocation OpLoc,
|
|
|
|
tok::TokenKind OpKind,
|
|
|
|
SourceLocation MemberLoc,
|
2009-03-05 06:30:12 +08:00
|
|
|
IdentifierInfo &Member,
|
2009-08-06 11:17:00 +08:00
|
|
|
DeclPtrTy ImplDecl,
|
|
|
|
const CXXScopeSpec *SS=0) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 08:08:26 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 08:08:26 +08:00
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCallExpr(Scope *S, ExprArg Fn,
|
|
|
|
SourceLocation LParenLoc,
|
|
|
|
MultiExprArg Args,
|
|
|
|
SourceLocation *CommaLocs,
|
|
|
|
SourceLocation RParenLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 08:08:26 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 08:08:26 +08:00
|
|
|
|
2008-08-01 08:41:12 +08:00
|
|
|
// Unary Operators. 'Tok' is the token for the operator.
|
2009-01-19 08:08:26 +08:00
|
|
|
virtual OwningExprResult ActOnUnaryOp(Scope *S, SourceLocation OpLoc,
|
|
|
|
tok::TokenKind Op, ExprArg Input) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 08:08:26 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-19 08:08:26 +08:00
|
|
|
virtual OwningExprResult
|
|
|
|
ActOnSizeOfAlignOfExpr(SourceLocation OpLoc, bool isSizeof, bool isType,
|
|
|
|
void *TyOrEx, const SourceRange &ArgRange) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-19 08:08:26 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-20 06:31:54 +08:00
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCompoundLiteral(SourceLocation LParen,
|
|
|
|
TypeTy *Ty,
|
|
|
|
SourceLocation RParen,
|
|
|
|
ExprArg Op) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-20 06:31:54 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-20 06:31:54 +08:00
|
|
|
virtual OwningExprResult ActOnInitList(SourceLocation LParenLoc,
|
|
|
|
MultiExprArg InitList,
|
|
|
|
SourceLocation RParenLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-20 06:31:54 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-08-11 07:49:36 +08:00
|
|
|
virtual OwningExprResult ActOnCastExpr(Scope *S, SourceLocation LParenLoc,
|
|
|
|
TypeTy *Ty, SourceLocation RParenLoc,
|
|
|
|
ExprArg Op) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-20 06:31:54 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-20 06:31:54 +08:00
|
|
|
|
|
|
|
virtual OwningExprResult ActOnBinOp(Scope *S, SourceLocation TokLoc,
|
|
|
|
tok::TokenKind Kind,
|
|
|
|
ExprArg LHS, ExprArg RHS) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-20 06:31:54 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// ActOnConditionalOp - Parse a ?: operation. Note that 'LHS' may be null
|
|
|
|
/// in the case of a the GNU conditional expr extension.
|
2009-01-20 06:31:54 +08:00
|
|
|
virtual OwningExprResult ActOnConditionalOp(SourceLocation QuestionLoc,
|
|
|
|
SourceLocation ColonLoc,
|
|
|
|
ExprArg Cond, ExprArg LHS,
|
|
|
|
ExprArg RHS) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-01-20 06:31:54 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-01-20 06:31:54 +08:00
|
|
|
|
|
|
|
//===--------------------- GNU Extension Expressions ------------------===//
|
2008-08-01 08:41:12 +08:00
|
|
|
|
2009-03-16 01:47:39 +08:00
|
|
|
virtual OwningExprResult ActOnAddrLabel(SourceLocation OpLoc,
|
|
|
|
SourceLocation LabLoc,
|
|
|
|
IdentifierInfo *LabelII) {// "&&foo"
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-03-16 01:47:39 +08:00
|
|
|
|
|
|
|
virtual OwningExprResult ActOnStmtExpr(SourceLocation LPLoc,
|
|
|
|
StmtArg SubStmt,
|
|
|
|
SourceLocation RPLoc) { // "({..})"
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-03-16 01:47:39 +08:00
|
|
|
|
|
|
|
virtual OwningExprResult ActOnBuiltinOffsetOf(Scope *S,
|
|
|
|
SourceLocation BuiltinLoc,
|
|
|
|
SourceLocation TypeLoc,
|
|
|
|
TypeTy *Arg1,
|
|
|
|
OffsetOfComponent *CompPtr,
|
|
|
|
unsigned NumComponents,
|
|
|
|
SourceLocation RParenLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-03-16 01:47:39 +08:00
|
|
|
|
2008-08-01 08:41:12 +08:00
|
|
|
// __builtin_types_compatible_p(type1, type2)
|
2009-03-16 01:47:39 +08:00
|
|
|
virtual OwningExprResult ActOnTypesCompatibleExpr(SourceLocation BuiltinLoc,
|
|
|
|
TypeTy *arg1,TypeTy *arg2,
|
|
|
|
SourceLocation RPLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
|
|
|
// __builtin_choose_expr(constExpr, expr1, expr2)
|
2009-03-16 01:47:39 +08:00
|
|
|
virtual OwningExprResult ActOnChooseExpr(SourceLocation BuiltinLoc,
|
|
|
|
ExprArg cond, ExprArg expr1,
|
|
|
|
ExprArg expr2,
|
|
|
|
SourceLocation RPLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
// __builtin_va_arg(expr, type)
|
|
|
|
virtual OwningExprResult ActOnVAArg(SourceLocation BuiltinLoc,
|
|
|
|
ExprArg expr, TypeTy *type,
|
|
|
|
SourceLocation RPLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnGNUNullExpr(SourceLocation TokenLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void ActOnBlockStart(SourceLocation CaretLoc, Scope *CurScope) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void ActOnBlockError(SourceLocation CaretLoc, Scope *CurScope) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnBlockStmtExpr(SourceLocation CaretLoc,
|
|
|
|
StmtArg Body,
|
|
|
|
Scope *CurScope) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnStartNamespaceDef(Scope *S, SourceLocation IdentLoc,
|
|
|
|
IdentifierInfo *Ident,
|
|
|
|
SourceLocation LBrace) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-03-16 01:47:39 +08:00
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual void ActOnFinishNamespaceDef(DeclPtrTy Dcl, SourceLocation RBrace) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
// FIXME: AttrList should be deleted by this function, but the definition
|
|
|
|
// would have to be available.
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnUsingDirective(Scope *CurScope,
|
|
|
|
SourceLocation UsingLoc,
|
|
|
|
SourceLocation NamespcLoc,
|
|
|
|
const CXXScopeSpec &SS,
|
|
|
|
SourceLocation IdentLoc,
|
|
|
|
IdentifierInfo *NamespcName,
|
|
|
|
AttributeList *AttrList) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2008-08-01 08:41:12 +08:00
|
|
|
}
|
2009-03-16 01:47:39 +08:00
|
|
|
#endif
|
2008-08-01 08:41:12 +08:00
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual void ActOnParamDefaultArgument(DeclPtrTy param,
|
2009-03-16 01:47:39 +08:00
|
|
|
SourceLocation EqualLoc,
|
|
|
|
ExprArg defarg) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual void ActOnParamUnparsedDefaultArgument(DeclPtrTy param,
|
2009-06-13 00:51:40 +08:00
|
|
|
SourceLocation EqualLoc,
|
|
|
|
SourceLocation ArgLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual void ActOnParamDefaultArgumentError(DeclPtrTy param) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual void AddCXXDirectInitializerToDecl(DeclPtrTy Dcl,
|
2009-03-16 01:47:39 +08:00
|
|
|
SourceLocation LParenLoc,
|
|
|
|
MultiExprArg Exprs,
|
|
|
|
SourceLocation *CommaLocs,
|
|
|
|
SourceLocation RParenLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual void ActOnStartDelayedCXXMethodDeclaration(Scope *S,
|
|
|
|
DeclPtrTy Method)
|
2009-03-16 01:47:39 +08:00
|
|
|
{
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual void ActOnDelayedCXXMethodParameter(Scope *S, DeclPtrTy Param) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
virtual void ActOnFinishDelayedCXXMethodDeclaration(Scope *S,
|
2009-03-29 03:18:32 +08:00
|
|
|
DeclPtrTy Method) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
}
|
|
|
|
|
2009-03-29 03:18:32 +08:00
|
|
|
virtual DeclPtrTy ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
|
|
|
|
ExprArg AssertExpr,
|
|
|
|
ExprArg AssertMessageExpr) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-29 03:18:32 +08:00
|
|
|
return DeclPtrTy();
|
2006-08-17 13:51:27 +08:00
|
|
|
}
|
2009-03-16 01:47:39 +08:00
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCXXNamedCast(SourceLocation OpLoc,
|
|
|
|
tok::TokenKind Kind,
|
|
|
|
SourceLocation LAngleBracketLoc,
|
|
|
|
TypeTy *Ty,
|
|
|
|
SourceLocation RAngleBracketLoc,
|
|
|
|
SourceLocation LParenLoc,
|
|
|
|
ExprArg Op,
|
|
|
|
SourceLocation RParenLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCXXTypeid(SourceLocation OpLoc,
|
|
|
|
SourceLocation LParenLoc,
|
|
|
|
bool isType, void *TyOrExpr,
|
|
|
|
SourceLocation RParenLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCXXThis(SourceLocation ThisLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCXXBoolLiteral(SourceLocation OpLoc,
|
|
|
|
tok::TokenKind Kind) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCXXThrow(SourceLocation OpLoc, ExprArg Op) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCXXTypeConstructExpr(SourceRange TypeRange,
|
|
|
|
TypeTy *TypeRep,
|
|
|
|
SourceLocation LParenLoc,
|
|
|
|
MultiExprArg Exprs,
|
|
|
|
SourceLocation *CommaLocs,
|
|
|
|
SourceLocation RParenLoc) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCXXConditionDeclarationExpr(Scope *S,
|
|
|
|
SourceLocation StartLoc,
|
|
|
|
Declarator &D,
|
|
|
|
SourceLocation EqualLoc,
|
|
|
|
ExprArg AssignExprVal) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCXXNew(SourceLocation StartLoc,
|
|
|
|
bool UseGlobal,
|
|
|
|
SourceLocation PlacementLParen,
|
|
|
|
MultiExprArg PlacementArgs,
|
|
|
|
SourceLocation PlacementRParen,
|
|
|
|
bool ParenTypeId, Declarator &D,
|
|
|
|
SourceLocation ConstructorLParen,
|
|
|
|
MultiExprArg ConstructorArgs,
|
|
|
|
SourceLocation ConstructorRParen) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnCXXDelete(SourceLocation StartLoc,
|
|
|
|
bool UseGlobal, bool ArrayForm,
|
|
|
|
ExprArg Operand) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual OwningExprResult ActOnUnaryTypeTrait(UnaryTypeTrait OTT,
|
|
|
|
SourceLocation KWLoc,
|
|
|
|
SourceLocation LParen,
|
|
|
|
TypeTy *Ty,
|
|
|
|
SourceLocation RParen) {
|
2009-05-19 09:02:07 +08:00
|
|
|
Out << __FUNCTION__ << "\n";
|
2009-03-16 01:47:39 +08:00
|
|
|
return ExprEmpty();
|
|
|
|
}
|
2006-08-17 13:51:27 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2009-05-19 09:02:07 +08:00
|
|
|
MinimalAction *clang::CreatePrintParserActionsAction(Preprocessor &PP,
|
|
|
|
llvm::raw_ostream* OS) {
|
|
|
|
return new ParserPrintActions(PP, *OS);
|
2006-08-17 13:51:27 +08:00
|
|
|
}
|