clang API Documentation

Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends
clang::FunctionProtoType Class Reference

#include <Type.h>

Inheritance diagram for clang::FunctionProtoType:
Inheritance graph
[legend]
Collaboration diagram for clang::FunctionProtoType:
Collaboration graph
[legend]

List of all members.

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 QualTypearg_type_iterator
typedef const QualTypeexception_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
ExprgetNoexceptExpr () 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

Detailed Description

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.

Definition at line 2701 of file Type.h.


Member Typedef Documentation

Definition at line 2866 of file Type.h.

Definition at line 2872 of file Type.h.


Member Enumeration Documentation

Result type of getNoexceptSpec().

Enumerator:
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.

Definition at line 2818 of file Type.h.


Member Function Documentation

arg_type_iterator clang::FunctionProtoType::arg_type_begin ( ) const [inline]
arg_type_iterator clang::FunctionProtoType::arg_type_end ( ) const [inline]
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]

Definition at line 2902 of file Type.h.

QualType clang::FunctionProtoType::desugar ( ) const [inline]

Definition at line 2894 of file Type.h.

exception_iterator clang::FunctionProtoType::exception_begin ( ) const [inline]
exception_iterator clang::FunctionProtoType::exception_end ( ) const [inline]
QualType clang::FunctionProtoType::getArgType ( unsigned  i) const [inline]
ExceptionSpecificationType clang::FunctionProtoType::getExceptionSpecType ( ) const [inline]
QualType clang::FunctionProtoType::getExceptionType ( unsigned  i) const [inline]
ExtProtoInfo clang::FunctionProtoType::getExtProtoInfo ( ) const [inline]
Expr* clang::FunctionProtoType::getNoexceptExpr ( ) const [inline]
FunctionProtoType::NoexceptResult FunctionProtoType::getNoexceptSpec ( ASTContext Ctx) const
unsigned clang::FunctionProtoType::getNumArgs ( ) const [inline]
unsigned clang::FunctionProtoType::getNumExceptions ( ) const [inline]
RefQualifierKind clang::FunctionProtoType::getRefQualifier ( ) const [inline]
unsigned clang::FunctionProtoType::getTypeQuals ( ) const [inline]
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]
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]
bool clang::FunctionProtoType::isSugared ( ) const [inline]

Definition at line 2893 of file Type.h.

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
void FunctionProtoType::Profile ( llvm::FoldingSetNodeID &  ID,
const ASTContext Ctx 
)
static void clang::FunctionProtoType::Profile ( llvm::FoldingSetNodeID &  ID,
QualType  Result,
arg_type_iterator  ArgTys,
unsigned  NumArgs,
const ExtProtoInfo EPI,
const ASTContext Context 
) [static]

Friends And Related Function Documentation

friend class ASTContext [friend]

Reimplemented from clang::Type.

Definition at line 2761 of file Type.h.


The documentation for this class was generated from the following files: