clang API Documentation
#include <Type.h>


Classes | |
| struct | ExtProtoInfo |
| ExtProtoInfo - Extra information about a function prototype. More... | |
Public Types | |
| enum | NoexceptResult { NR_NoNoexcept, NR_BadNoexcept, NR_Dependent, NR_Throw, NR_Nothrow } |
| Result type of getNoexceptSpec(). More... | |
| typedef const QualType * | arg_type_iterator |
| typedef const QualType * | exception_iterator |
Public Member Functions | |
| unsigned | getNumArgs () const |
| QualType | getArgType (unsigned i) const |
| ExtProtoInfo | getExtProtoInfo () const |
| ExceptionSpecificationType | getExceptionSpecType () const |
| Get the kind of exception specification on this function. | |
| bool | hasExceptionSpec () const |
| Return whether this function has any kind of exception spec. | |
| bool | hasDynamicExceptionSpec () const |
| Return whether this function has a dynamic (throw) exception spec. | |
| bool | hasNoexceptExceptionSpec () const |
| Return whether this function has a noexcept exception spec. | |
| NoexceptResult | getNoexceptSpec (ASTContext &Ctx) const |
| Get the meaning of the noexcept spec on this function, if any. | |
| unsigned | getNumExceptions () const |
| QualType | getExceptionType (unsigned i) const |
| Expr * | getNoexceptExpr () const |
| bool | isNothrow (ASTContext &Ctx) const |
| bool | isTemplateVariadic () const |
| Determines whether this function prototype contains a parameter pack at the end. | |
| unsigned | getTypeQuals () const |
| RefQualifierKind | getRefQualifier () const |
| Retrieve the ref-qualifier associated with this function type. | |
| arg_type_iterator | arg_type_begin () const |
| arg_type_iterator | arg_type_end () const |
| exception_iterator | exception_begin () const |
| exception_iterator | exception_end () const |
| bool | hasAnyConsumedArgs () const |
| bool | isArgConsumed (unsigned I) const |
| bool | isSugared () const |
| QualType | desugar () const |
| void | printExceptionSpecification (std::string &S, PrintingPolicy Policy) const |
| void | Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Ctx) |
Static Public Member Functions | |
| static bool | classof (const Type *T) |
| static bool | classof (const FunctionProtoType *) |
| static void | Profile (llvm::FoldingSetNodeID &ID, QualType Result, arg_type_iterator ArgTys, unsigned NumArgs, const ExtProtoInfo &EPI, const ASTContext &Context) |
Friends | |
| class | ASTContext |
FunctionProtoType - Represents a prototype with argument type info, e.g. 'int foo(int)' or 'int foo(void)'. 'void' is represented as having no arguments, not as having a single void argument. Such a type can have an exception specification, but this specification is not part of the canonical type.
| typedef const QualType* clang::FunctionProtoType::arg_type_iterator |
| typedef const QualType* clang::FunctionProtoType::exception_iterator |
Result type of getNoexceptSpec().
| NR_NoNoexcept |
There is no noexcept specifier. |
| NR_BadNoexcept |
The noexcept specifier has a bad expression. |
| NR_Dependent |
The noexcept specifier is dependent. |
| NR_Throw |
The noexcept specifier evaluates to false. |
| NR_Nothrow |
The noexcept specifier evaluates to true. |
| arg_type_iterator clang::FunctionProtoType::arg_type_begin | ( | ) | const [inline] |
Definition at line 2867 of file Type.h.
Referenced by clang::Sema::ActOnBlockStmtExpr(), addAssociatedClassesAndNamespaces(), clang::ASTContext::adjustFunctionType(), CheckConstexprParameterTypes(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckEquivalentExceptionSpec(), computeCachedProperties(), DeduceTemplateArgumentsByTypeMatch(), clang::Sema::FunctionArgTypesAreEqual(), GetFullTypeForDeclarator(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), isAtLeastAsSpecializedAs(), clang::ASTContext::mergeFunctionTypes(), Profile(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::ASTNodeImporter::VisitFunctionProtoType().
| arg_type_iterator clang::FunctionProtoType::arg_type_end | ( | ) | const [inline] |
Definition at line 2870 of file Type.h.
References NumArgs.
Referenced by addAssociatedClassesAndNamespaces(), CheckConstexprParameterTypes(), computeCachedProperties(), clang::Sema::FunctionArgTypesAreEqual(), isAtLeastAsSpecializedAs(), clang::TemplateDeclInstantiator::VisitFunctionDecl(), and clang::ASTNodeImporter::VisitFunctionProtoType().
| static bool clang::FunctionProtoType::classof | ( | const Type * | T | ) | [inline, static] |
Reimplemented from clang::FunctionType.
Definition at line 2899 of file Type.h.
References clang::Type::getTypeClass().
| static bool clang::FunctionProtoType::classof | ( | const FunctionProtoType * | ) | [inline, static] |
| QualType clang::FunctionProtoType::desugar | ( | ) | const [inline] |
| exception_iterator clang::FunctionProtoType::exception_begin | ( | ) | const [inline] |
Definition at line 2873 of file Type.h.
Referenced by clang::Sema::ImplicitExceptionSpecification::CalledDecl(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckExceptionSpecSubset(), and clang::ASTNodeImporter::VisitFunctionProtoType().
| exception_iterator clang::FunctionProtoType::exception_end | ( | ) | const [inline] |
Definition at line 2877 of file Type.h.
References clang::EST_Dynamic.
Referenced by clang::Sema::ImplicitExceptionSpecification::CalledDecl(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckExceptionSpecSubset(), and clang::ASTNodeImporter::VisitFunctionProtoType().
| QualType clang::FunctionProtoType::getArgType | ( | unsigned | i | ) | const [inline] |
Definition at line 2778 of file Type.h.
References NumArgs.
Referenced by clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::Sema::CheckExplicitlyDefaultedCopyAssignment(), clang::Sema::CheckExplicitlyDefaultedCopyConstructor(), clang::Sema::CheckExplicitlyDefaultedMoveAssignment(), clang::Sema::CheckExplicitlyDefaultedMoveConstructor(), clang::Sema::CheckMain(), clang::Sema::CheckParamExceptionSpec(), clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(), clang::Sema::DeclareInheritedConstructors(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), clang::Sema::FindAllocationFunctions(), clang::Sema::GatherArgumentsForCall(), clang::CXXRecordDecl::getCopyAssignmentOperator(), clang::Sema::HandleFunctionTypeMismatch(), IsAcceptableNonMemberOperatorCandidate(), clang::Sema::IsBlockPointerConversion(), clang::Sema::isObjCPointerConversion(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), IsStructurallyEquivalent(), isTemplateVariadic(), MarkUsedTemplateParameters(), and clang::ASTContext::mergeFunctionTypes().
| ExceptionSpecificationType clang::FunctionProtoType::getExceptionSpecType | ( | ) | const [inline] |
Get the kind of exception specification on this function.
Definition at line 2802 of file Type.h.
Referenced by clang::Sema::ActOnFinishDelayedMemberInitializers(), clang::Sema::ImplicitExceptionSpecification::CalledDecl(), CanCalleeThrow(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckExceptionSpecSubset(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), EvaluateUnaryTypeTrait(), getNoexceptSpec(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), IsStructurallyEquivalent(), and printExceptionSpecification().
| QualType clang::FunctionProtoType::getExceptionType | ( | unsigned | i | ) | const [inline] |
Definition at line 2828 of file Type.h.
Referenced by clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), IsStructurallyEquivalent(), and printExceptionSpecification().
| ExtProtoInfo clang::FunctionProtoType::getExtProtoInfo | ( | ) | const [inline] |
Definition at line 2783 of file Type.h.
References clang::FunctionProtoType::ExtProtoInfo::ConsumedArguments, clang::EST_ComputedNoexcept, clang::EST_Dynamic, clang::FunctionProtoType::ExtProtoInfo::Exceptions, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpecType, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::ExtProtoInfo::NoexceptExpr, clang::FunctionProtoType::ExtProtoInfo::NumExceptions, clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, and clang::FunctionProtoType::ExtProtoInfo::Variadic.
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::AdjustDestructorExceptionSpec(), clang::ASTContext::adjustFunctionType(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckDestructorDeclarator(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::DeclareInheritedConstructors(), clang::ASTContext::FunctionTypesMatchOnNSConsumedAttrs(), GetFullTypeForDeclarator(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), LookupDirect(), clang::Sema::MergeFunctionDecl(), clang::ASTContext::mergeFunctionTypes(), Profile(), and clang::ASTNodeImporter::VisitFunctionProtoType().
| Expr* clang::FunctionProtoType::getNoexceptExpr | ( | ) | const [inline] |
Definition at line 2832 of file Type.h.
References clang::EST_ComputedNoexcept.
Referenced by clang::Sema::CheckEquivalentExceptionSpec(), getNoexceptSpec(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), IsStructurallyEquivalent(), and printExceptionSpecification().
| FunctionProtoType::NoexceptResult FunctionProtoType::getNoexceptSpec | ( | ASTContext & | Ctx | ) | const |
Get the meaning of the noexcept spec on this function, if any.
Definition at line 1621 of file Type.cpp.
References clang::EST_BasicNoexcept, clang::EST_ComputedNoexcept, getExceptionSpecType(), getNoexceptExpr(), clang::Expr::isIntegerConstantExpr(), clang::Expr::isValueDependent(), NR_BadNoexcept, NR_Dependent, NR_NoNoexcept, NR_Nothrow, and NR_Throw.
Referenced by clang::Sema::ImplicitExceptionSpecification::CalledDecl(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckExceptionSpecSubset(), clang::CodeGen::CodeGenFunction::EmitEndEHSpec(), and clang::CodeGen::CodeGenFunction::EmitStartEHSpec().
| unsigned clang::FunctionProtoType::getNumArgs | ( | ) | const [inline] |
Definition at line 2777 of file Type.h.
References NumArgs.
Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::AddMethodCandidate(), clang::Sema::AddOverloadCandidate(), clang::Sema::AddSurrogateCandidate(), clang::ASTContext::adjustFunctionType(), clang::Sema::BuildCallToObjectOfClassType(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckConversionDeclarator(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckMain(), clang::Sema::CheckParamExceptionSpec(), clang::Sema::CompleteConstructorCall(), clang::Sema::ConvertArgumentsForCall(), clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(), DeduceTemplateArgumentsByTypeMatch(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), EvaluateUnaryTypeTrait(), clang::Sema::FindAllocationFunctions(), clang::ASTContext::FunctionTypesMatchOnNSConsumedAttrs(), clang::Sema::GatherArgumentsForCall(), clang::CXXRecordDecl::getCopyAssignmentOperator(), GetFullTypeForDeclarator(), clang::Sema::HandleFunctionTypeMismatch(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), IsAcceptableNonMemberOperatorCandidate(), isAtLeastAsSpecializedAs(), clang::Sema::IsBlockPointerConversion(), clang::Sema::isObjCPointerConversion(), clang::Sema::IsOverload(), clang::FunctionDecl::isReservedGlobalPlacementOperator(), IsStructurallyEquivalent(), isTemplateVariadic(), MarkUsedTemplateParameters(), and clang::ASTContext::mergeFunctionTypes().
| unsigned clang::FunctionProtoType::getNumExceptions | ( | ) | const [inline] |
Definition at line 2827 of file Type.h.
Referenced by clang::Sema::CheckEquivalentExceptionSpec(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), IsStructurallyEquivalent(), and printExceptionSpecification().
| RefQualifierKind clang::FunctionProtoType::getRefQualifier | ( | ) | const [inline] |
Retrieve the ref-qualifier associated with this function type.
Reimplemented from clang::FunctionType.
Definition at line 2862 of file Type.h.
References clang::FunctionType::getRefQualifier().
Referenced by clang::Sema::CheckExplicitlyDefaultedCopyAssignment(), clang::Sema::CheckExplicitlyDefaultedMoveAssignment(), DeduceTemplateArgumentsByTypeMatch(), GetFullTypeForDeclarator(), and clang::Sema::SubstituteExplicitTemplateArguments().
| unsigned clang::FunctionProtoType::getTypeQuals | ( | ) | const [inline] |
Reimplemented from clang::FunctionType.
Definition at line 2858 of file Type.h.
References clang::FunctionType::getTypeQuals().
Referenced by AddFunctionTypeQualsToCompletionString(), clang::Sema::BuildCallToMemberFunction(), clang::Sema::CheckExplicitlyDefaultedCopyAssignment(), clang::Sema::CheckExplicitlyDefaultedMoveAssignment(), DeduceTemplateArgumentsByTypeMatch(), GetFullTypeForDeclarator(), clang::Sema::HandleFunctionTypeMismatch(), clang::Sema::isObjCPointerConversion(), IsStructurallyEquivalent(), and clang::Sema::SubstituteExplicitTemplateArguments().
| bool clang::FunctionProtoType::hasAnyConsumedArgs | ( | ) | const [inline] |
Definition at line 2883 of file Type.h.
Referenced by clang::ASTContext::FunctionTypesMatchOnNSConsumedAttrs().
| bool clang::FunctionProtoType::hasDynamicExceptionSpec | ( | ) | const [inline] |
Return whether this function has a dynamic (throw) exception spec.
Definition at line 2810 of file Type.h.
References clang::isDynamicExceptionSpec().
Referenced by printExceptionSpecification().
| bool clang::FunctionProtoType::hasExceptionSpec | ( | ) | const [inline] |
Return whether this function has any kind of exception spec.
Definition at line 2806 of file Type.h.
References clang::EST_None.
Referenced by clang::Sema::AdjustDestructorExceptionSpec(), clang::Sema::CheckDistantExceptionSpec(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::CheckExplicitlyDefaultedCopyAssignment(), clang::Sema::CheckExplicitlyDefaultedCopyConstructor(), clang::Sema::CheckExplicitlyDefaultedDefaultConstructor(), clang::Sema::CheckExplicitlyDefaultedDestructor(), clang::Sema::CheckExplicitlyDefaultedMoveAssignment(), clang::Sema::CheckExplicitlyDefaultedMoveConstructor(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), and clang::ASTContext::mergeFunctionTypes().
| bool clang::FunctionProtoType::hasNoexceptExceptionSpec | ( | ) | const [inline] |
Return whether this function has a noexcept exception spec.
Definition at line 2814 of file Type.h.
References clang::isNoexceptExceptionSpec().
| bool clang::FunctionProtoType::isArgConsumed | ( | unsigned | I | ) | const [inline] |
Definition at line 2886 of file Type.h.
Referenced by clang::Sema::GatherArgumentsForCall().
| bool clang::FunctionProtoType::isNothrow | ( | ASTContext & | Ctx | ) | const [inline] |
Definition at line 2838 of file Type.h.
References clang::EST_BasicNoexcept, clang::EST_ComputedNoexcept, clang::EST_Delayed, and clang::EST_DynamicNone.
Referenced by CanCalleeThrow(), clang::CodeGen::CodeGenModule::ConstructAttributeList(), clang::CodeGen::CodeGenFunction::EmitCXXNewExpr(), and EvaluateUnaryTypeTrait().
| bool FunctionProtoType::isTemplateVariadic | ( | ) | const |
Determines whether this function prototype contains a parameter pack at the end.
A function template whose last parameter is a parameter pack can be called with an arbitrary number of arguments, much like a variadic function. However,
Definition at line 1644 of file Type.cpp.
References getArgType(), and getNumArgs().
Referenced by clang::Sema::DeduceTemplateArguments().
| void FunctionProtoType::printExceptionSpecification | ( | std::string & | S, |
| PrintingPolicy | Policy | ||
| ) | const |
Definition at line 401 of file TypePrinter.cpp.
References clang::EST_ComputedNoexcept, clang::EST_MSAny, clang::QualType::getAsString(), getExceptionSpecType(), getExceptionType(), getNoexceptExpr(), getNumExceptions(), hasDynamicExceptionSpec(), clang::isNoexceptExceptionSpec(), and clang::Stmt::printPretty().
| void FunctionProtoType::Profile | ( | llvm::FoldingSetNodeID & | ID, |
| const ASTContext & | Ctx | ||
| ) |
Definition at line 1702 of file Type.cpp.
References arg_type_begin(), getExtProtoInfo(), and clang::FunctionType::getResultType().
Referenced by clang::ASTContext::getFunctionType().
| static void clang::FunctionProtoType::Profile | ( | llvm::FoldingSetNodeID & | ID, |
| QualType | Result, | ||
| arg_type_iterator | ArgTys, | ||
| unsigned | NumArgs, | ||
| const ExtProtoInfo & | EPI, | ||
| const ASTContext & | Context | ||
| ) | [static] |
friend class ASTContext [friend] |
Reimplemented from clang::Type.