clang API Documentation
#include <Action.h>


Public Member Functions | |
| MinimalAction (Preprocessor &pp) | |
| ~MinimalAction () | |
| virtual TypeTy * | getTypeName (IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec *SS, bool isClassName=false, TypeTy *ObjectType=0) |
| virtual bool | isCurrentClassName (const IdentifierInfo &II, Scope *S, const CXXScopeSpec *SS) |
| virtual TemplateNameKind | isTemplateName (Scope *S, CXXScopeSpec &SS, UnqualifiedId &Name, TypeTy *ObjectType, bool EnteringContext, TemplateTy &Template, bool &MemberOfUnknownSpecialization) |
| Determine whether the given name refers to a template. | |
| virtual DeclPtrTy | ActOnDeclarator (Scope *S, Declarator &D) |
| virtual void | ActOnPopScope (SourceLocation Loc, Scope *S) |
| virtual void | ActOnTranslationUnitScope (SourceLocation Loc, Scope *S) |
| virtual DeclPtrTy | ActOnForwardClassDeclaration (SourceLocation AtClassLoc, IdentifierInfo **IdentList, SourceLocation *SLocs, unsigned NumElts) |
| virtual DeclPtrTy | ActOnStartClassInterface (SourceLocation interLoc, IdentifierInfo *ClassName, SourceLocation ClassLoc, IdentifierInfo *SuperName, SourceLocation SuperLoc, const DeclPtrTy *ProtoRefs, unsigned NumProtoRefs, const SourceLocation *ProtoLocs, SourceLocation EndProtoLoc, AttributeList *AttrList) |
MinimalAction - Minimal actions are used by light-weight clients of the parser that do not need name resolution or significant semantic analysis to be performed. The actions implemented here are in the form of unresolved identifiers. By using a simpler interface than the SemanticAction class, the parser doesn't have to build complex data structures and thus runs more quickly.
Definition at line 3192 of file Parse/Action.h.
| MinimalAction::MinimalAction | ( | Preprocessor & | pp | ) |
Definition at line 140 of file MinimalAction.cpp.
| MinimalAction::~MinimalAction | ( | ) |
Definition at line 145 of file MinimalAction.cpp.
References getTable().
| Action::DeclPtrTy MinimalAction::ActOnDeclarator | ( | Scope * | S, | |
| Declarator & | D | |||
| ) | [virtual] |
ActOnDeclarator - If this is a typedef declarator, we modify the IdentifierInfo::FETokenInfo field to keep track of this fact, until S is popped.
Reimplemented from clang::Action.
Definition at line 207 of file MinimalAction.cpp.
References clang::Scope::AddDecl(), clang::Declarator::getDeclSpec(), clang::IdentifierInfo::getFETokenInfo(), clang::Declarator::getIdentifier(), clang::DeclSpec::getStorageClassSpec(), getTable(), clang::OpaquePtr< 0 >::make(), and clang::DeclSpec::SCS_typedef.
| Action::DeclPtrTy MinimalAction::ActOnForwardClassDeclaration | ( | SourceLocation | AtClassLoc, | |
| IdentifierInfo ** | IdentList, | |||
| SourceLocation * | IdentLocs, | |||
| unsigned | NumElts | |||
| ) | [virtual] |
ActOnForwardClassDeclaration - Scope will always be top level file scope.
Reimplemented from clang::Action.
Definition at line 249 of file MinimalAction.cpp.
References clang::Scope::AddDecl(), getTable(), and clang::OpaquePtr< 0 >::make().
| void MinimalAction::ActOnPopScope | ( | SourceLocation | Loc, | |
| Scope * | S | |||
| ) | [virtual] |
ActOnPopScope - When a scope is popped, if any typedefs are now out-of-scope, they are removed from the IdentifierInfo::FETokenInfo field.
Reimplemented from clang::Action.
Definition at line 265 of file MinimalAction.cpp.
References clang::Scope::decl_begin(), clang::Scope::decl_end(), clang::IdentifierInfo::getFETokenInfo(), getTable(), and clang::IdentifierInfo::setFETokenInfo().
| Action::DeclPtrTy MinimalAction::ActOnStartClassInterface | ( | SourceLocation | interLoc, | |
| IdentifierInfo * | ClassName, | |||
| SourceLocation | ClassLoc, | |||
| IdentifierInfo * | SuperName, | |||
| SourceLocation | SuperLoc, | |||
| const DeclPtrTy * | ProtoRefs, | |||
| unsigned | NumProtoRefs, | |||
| const SourceLocation * | ProtoLocs, | |||
| SourceLocation | EndProtoLoc, | |||
| AttributeList * | AttrList | |||
| ) | [virtual] |
Reimplemented from clang::Action.
Definition at line 231 of file MinimalAction.cpp.
References getTable().
| void MinimalAction::ActOnTranslationUnitScope | ( | SourceLocation | Loc, | |
| Scope * | S | |||
| ) | [virtual] |
ActOnTranslationUnitScope - This callback is called once, immediately after creating the translation unit scope (in Parser::Initialize).
Reimplemented from clang::Action.
Definition at line 149 of file MinimalAction.cpp.
References clang::IdentifierTable::get(), clang::Preprocessor::getLangOptions(), clang::TargetInfo::getPointerWidth(), getTable(), clang::Preprocessor::getTargetInfo(), and clang::LangOptions::ObjC1.
| Action::TypeTy * MinimalAction::getTypeName | ( | IdentifierInfo & | II, | |
| SourceLocation | Loc, | |||
| Scope * | S, | |||
| CXXScopeSpec * | SS, | |||
| bool | isClassName = false, |
|||
| TypeTy * | ObjectType = 0 | |||
| ) | [virtual] |
getTypeName - This looks at the IdentifierInfo::FETokenInfo field to determine whether the name is a typedef or not in this scope.
| II | the identifier for which we are performing name lookup | |
| NameLoc | the location of the identifier | |
| S | the scope in which this name lookup occurs | |
| SS | if non-NULL, the C++ scope specifier that precedes the identifier | |
| isClassName | whether this is a C++ class-name production, in which we can end up referring to a member of an unknown specialization that we know (from the grammar) is supposed to be a type. For example, this occurs when deriving from "std::vector<T>::allocator_type", where T is a template parameter. |
isTypeName - This looks at the IdentifierInfo::FETokenInfo field to determine whether the name is a type name (objc class name or typedef) or not in this scope.
FIXME: Use the passed CXXScopeSpec for accurate C++ type checking.
Implements clang::Action.
Definition at line 175 of file MinimalAction.cpp.
References clang::IdentifierInfo::getFETokenInfo().
| bool MinimalAction::isCurrentClassName | ( | const IdentifierInfo & | II, | |
| Scope * | S, | |||
| const CXXScopeSpec * | SS | |||
| ) | [virtual] |
isCurrentClassName - Always returns false, because MinimalAction does not support C++ classes with constructors.
Implements clang::Action.
Definition at line 186 of file MinimalAction.cpp.
| TemplateNameKind MinimalAction::isTemplateName | ( | Scope * | S, | |
| CXXScopeSpec & | SS, | |||
| UnqualifiedId & | Name, | |||
| TypeTy * | ObjectType, | |||
| bool | EnteringContext, | |||
| TemplateTy & | Template, | |||
| bool & | MemberOfUnknownSpecialization | |||
| ) | [virtual] |
Determine whether the given name refers to a template.
This callback is used by the parser after it has seen a '<' to determine whether the given name refers to a template and, if so, what kind of template.
| S | the scope in which the name occurs. | |
| SS | the C++ nested-name-specifier that precedes the template name, if any. | |
| Name | the name that we are querying to determine whether it is a template. | |
| ObjectType | if we are determining whether the given name is a template name in the context of a member access expression (e.g., p->X<int>), this is the type of the object referred to by the member access (e.g., p). | |
| EnteringContext | whether we are potentially entering the context referred to by the nested-name-specifier SS, which allows semantic analysis to look into uninstantiated templates. | |
| Template | if the name does refer to a template, the declaration of the template that the name refers to. | |
| MemberOfUnknownSpecialization | Will be set true if the resulting member would be a member of an unknown specialization, in which case this lookup cannot possibly pass at this time. |
Implements clang::Action.
Definition at line 192 of file MinimalAction.cpp.
References clang::TNK_Non_template.