|
Intel SPMD Program Compiler
1.3.0
|
Type representing a function (return type + argument types) More...
#include <type.h>


Public Member Functions | |
| FunctionType (const Type *returnType, const llvm::SmallVector< const Type *, 8 > &argTypes, SourcePos pos) | |
| FunctionType (const Type *returnType, const llvm::SmallVector< const Type *, 8 > &argTypes, const llvm::SmallVector< std::string, 8 > &argNames, const llvm::SmallVector< Expr *, 8 > &argDefaults, const llvm::SmallVector< SourcePos, 8 > &argPos, bool isTask, bool isExported, bool isExternC, bool isUnmasked) | |
| Variability | GetVariability () const |
| bool | IsBoolType () const |
| bool | IsFloatType () const |
| bool | IsIntType () const |
| bool | IsUnsignedType () const |
| bool | IsConstType () const |
| const Type * | GetBaseType () const |
| const Type * | GetAsVaryingType () const |
| const Type * | GetAsUniformType () const |
| const Type * | GetAsUnboundVariabilityType () const |
| const Type * | GetAsSOAType (int width) const |
| const FunctionType * | ResolveUnboundVariability (Variability v) const |
| const Type * | GetAsConstType () const |
| const Type * | GetAsNonConstType () const |
| std::string | GetString () const |
| std::string | Mangle () const |
| std::string | GetCDeclaration (const std::string &fname) const |
| llvm::Type * | LLVMType (llvm::LLVMContext *ctx) const |
| llvm::DIType | GetDIType (llvm::DIDescriptor scope) const |
| const Type * | GetReturnType () const |
| const std::string | GetReturnTypeString () const |
| llvm::FunctionType * | LLVMFunctionType (llvm::LLVMContext *ctx, bool disableMask=false) const |
| int | GetNumParameters () const |
| const Type * | GetParameterType (int i) const |
| Expr * | GetParameterDefault (int i) const |
| const SourcePos & | GetParameterSourcePos (int i) const |
| const std::string & | GetParameterName (int i) const |
Public Attributes | |
| const bool | isTask |
| const bool | isExported |
| const bool | isExternC |
| const bool | isUnmasked |
| bool | isSafe |
| int | costOverride |
Private Attributes | |
| const Type *const | returnType |
| const llvm::SmallVector< const Type *, 8 > | paramTypes |
| const llvm::SmallVector < std::string, 8 > | paramNames |
| llvm::SmallVector< Expr *, 8 > | paramDefaults |
| const llvm::SmallVector < SourcePos, 8 > | paramPositions |
Type representing a function (return type + argument types)
FunctionType encapsulates the information related to a function's type, including the return type and the types of the arguments.
| FunctionType::FunctionType | ( | const Type * | returnType, |
| const llvm::SmallVector< const Type *, 8 > & | argTypes, | ||
| SourcePos | pos | ||
| ) |
Definition at line 2635 of file type.cpp.
References Assert, costOverride, isSafe, NULL, and returnType.
Referenced by ResolveUnboundVariability().
| FunctionType::FunctionType | ( | const Type * | returnType, |
| const llvm::SmallVector< const Type *, 8 > & | argTypes, | ||
| const llvm::SmallVector< std::string, 8 > & | argNames, | ||
| const llvm::SmallVector< Expr *, 8 > & | argDefaults, | ||
| const llvm::SmallVector< SourcePos, 8 > & | argPos, | ||
| bool | isTask, | ||
| bool | isExported, | ||
| bool | isExternC, | ||
| bool | isUnmasked | ||
| ) |
Definition at line 2649 of file type.cpp.
References Assert, costOverride, isSafe, NULL, paramDefaults, paramNames, paramPositions, paramTypes, and returnType.
| const Type * FunctionType::GetAsConstType | ( | ) | const [virtual] |
| const Type * FunctionType::GetAsNonConstType | ( | ) | const [virtual] |
| const Type * FunctionType::GetAsSOAType | ( | int | width | ) | const [virtual] |
| const Type * FunctionType::GetAsUnboundVariabilityType | ( | ) | const [virtual] |
| const Type * FunctionType::GetAsUniformType | ( | ) | const [virtual] |
| const Type * FunctionType::GetAsVaryingType | ( | ) | const [virtual] |
| const Type * FunctionType::GetBaseType | ( | ) | const [virtual] |
| std::string FunctionType::GetCDeclaration | ( | const std::string & | name | ) | const [virtual] |
Returns a string that is the declaration of the same type in C syntax.
Implements Type.
Definition at line 2812 of file type.cpp.
References PointerType::GetBaseType(), Type::GetCDeclaration(), Type::GetString(), NULL, paramNames, paramTypes, and returnType.
Referenced by lPrintFunctionDeclarations(), and Module::writeHostStub().
| llvm::DIType FunctionType::GetDIType | ( | llvm::DIDescriptor | scope | ) | const [virtual] |
Returns the DIType (LLVM's debugging information structure), corresponding to this type.
Implements Type.
Definition at line 2850 of file type.cpp.
References Module::diBuilder, Type::GetDIType(), GetNumParameters(), GetParameterType(), m, NULL, and returnType.
| int FunctionType::GetNumParameters | ( | ) | const [inline] |
Definition at line 882 of file type.h.
References paramTypes.
Referenced by Module::AddFunctionDeclaration(), emitOffloadParamStruct(), FunctionSymbolExpr::getCandidateFunctions(), GetDIType(), FunctionCallExpr::GetValue(), lCalleeArgCount(), lCheckForStructParameters(), lCheckTypeEquality(), lGetExportedParamTypes(), PossiblyResolveFunctionOverloads(), AssignExpr::TypeCheck(), FunctionCallExpr::TypeCheck(), Module::writeDevStub(), and Module::writeHostStub().
| Expr * FunctionType::GetParameterDefault | ( | int | i | ) | const |
Definition at line 2961 of file type.cpp.
References Assert, and paramDefaults.
Referenced by Module::AddFunctionDeclaration(), FunctionSymbolExpr::getCandidateFunctions(), FunctionCallExpr::GetValue(), and FunctionCallExpr::TypeCheck().
| const std::string & FunctionType::GetParameterName | ( | int | i | ) | const |
Definition at line 2975 of file type.cpp.
References Assert, and paramNames.
Referenced by Module::AddFunctionDeclaration(), emitOffloadParamStruct(), Module::writeDevStub(), and Module::writeHostStub().
| const SourcePos & FunctionType::GetParameterSourcePos | ( | int | i | ) | const |
Definition at line 2968 of file type.cpp.
References Assert, and paramPositions.
Referenced by Module::AddFunctionDeclaration().
| const Type * FunctionType::GetParameterType | ( | int | i | ) | const |
Definition at line 2954 of file type.cpp.
References Assert, and paramTypes.
Referenced by Module::AddFunctionDeclaration(), FunctionSymbolExpr::computeOverloadCost(), emitOffloadParamStruct(), GetDIType(), FunctionCallExpr::GetValue(), lCheckForStructParameters(), lCheckTypeEquality(), lGetExportedParamTypes(), PossiblyResolveFunctionOverloads(), AssignExpr::TypeCheck(), FunctionCallExpr::TypeCheck(), Module::writeDevStub(), and Module::writeHostStub().
| const Type* FunctionType::GetReturnType | ( | ) | const [inline] |
Definition at line 871 of file type.h.
References returnType.
Referenced by Module::AddFunctionDeclaration(), FunctionEmitContext::CallInst(), FunctionCallExpr::GetType(), FunctionCallExpr::GetValue(), lCheckTypeEquality(), lGetExportedParamTypes(), FunctionCallExpr::TypeCheck(), and Module::writeDevStub().
| const std::string FunctionType::GetReturnTypeString | ( | ) | const |
Definition at line 2871 of file type.cpp.
References costOverride, Type::GetString(), isExported, isExternC, isSafe, isTask, isUnmasked, NULL, and returnType.
Referenced by Module::AddFunctionDeclaration(), and GetString().
| std::string FunctionType::GetString | ( | ) | const [virtual] |
Returns a text representation of the type (for example, for use in warning and error messages).
Implements Type.
Definition at line 2778 of file type.cpp.
References GetReturnTypeString(), NULL, and paramTypes.
Referenced by lCreateSymbol(), and lPrintOverloadCandidates().
| Variability FunctionType::GetVariability | ( | ) | const [virtual] |
Returns the variability of the type.
Implements Type.
Definition at line 2668 of file type.cpp.
References Variability::Uniform.
| bool FunctionType::IsBoolType | ( | ) | const [virtual] |
| bool FunctionType::IsConstType | ( | ) | const [virtual] |
| bool FunctionType::IsFloatType | ( | ) | const [virtual] |
| bool FunctionType::IsIntType | ( | ) | const [virtual] |
| bool FunctionType::IsUnsignedType | ( | ) | const [virtual] |
| llvm::FunctionType * FunctionType::LLVMFunctionType | ( | llvm::LLVMContext * | ctx, |
| bool | disableMask = false |
||
| ) | const |
This method returns the LLVM FunctionType that corresponds to this function type. The disableMask parameter indicates whether the llvm::FunctionType should have the trailing mask parameter, if present, removed from the return function signature.
Definition at line 2897 of file type.cpp.
References Assert, Globals::ctx, Type::Equal(), Module::errorCount, g, LLVMTypes::Int32Type, isTask, isUnmasked, Type::LLVMType(), m, LLVMTypes::MaskType, NULL, paramTypes, and returnType.
Referenced by Module::AddFunctionDeclaration(), FunctionEmitContext::CallInst(), and PointerType::LLVMType().
| llvm::Type * FunctionType::LLVMType | ( | llvm::LLVMContext * | ctx | ) | const [virtual] |
| std::string FunctionType::Mangle | ( | ) | const [virtual] |
Returns a string that represents the mangled type (for use in mangling function symbol names for function overloading). The various Types implementations of this method should collectively ensure that all of them use mangling schemes that are guaranteed not to clash.
Implements Type.
Definition at line 2796 of file type.cpp.
References Assert, Module::errorCount, isUnmasked, m, NULL, and paramTypes.
Referenced by Module::AddFunctionDeclaration().
| const FunctionType * FunctionType::ResolveUnboundVariability | ( | Variability | v | ) | const [virtual] |
Implements Type.
Definition at line 2739 of file type.cpp.
References Assert, costOverride, Module::errorCount, FunctionType(), isExported, isExternC, isSafe, isTask, isUnmasked, m, NULL, paramDefaults, paramNames, paramPositions, paramTypes, Type::ResolveUnboundVariability(), and returnType.
If non-negative, this provides a user-supplied override to the cost function estimate for the function.
Definition at line 911 of file type.h.
Referenced by FunctionCallExpr::EstimateCost(), FunctionType(), GetReturnTypeString(), and ResolveUnboundVariability().
| const bool FunctionType::isExported |
This value is true if the function had a 'export' qualifier in the source program.
Definition at line 894 of file type.h.
Referenced by Module::AddFunctionDeclaration(), GetReturnTypeString(), lCheckTypeEquality(), lIsExported(), and ResolveUnboundVariability().
| const bool FunctionType::isExternC |
This value is true if the function was declared as an 'extern "C"' function in the source program.
Definition at line 898 of file type.h.
Referenced by Module::AddFunctionDeclaration(), GetReturnTypeString(), lCheckTypeEquality(), lIsExternC(), and ResolveUnboundVariability().
| bool FunctionType::isSafe |
Indicates whether this function has been declared to be safe to run with an all-off mask.
Definition at line 907 of file type.h.
Referenced by FunctionType(), GetReturnTypeString(), and ResolveUnboundVariability().
| const bool FunctionType::isTask |
This value is true if the function had a 'task' qualifier in the source program.
Definition at line 890 of file type.h.
Referenced by Module::AddFunctionDeclaration(), GetReturnTypeString(), FunctionCallExpr::GetValue(), lCheckTypeEquality(), LLVMFunctionType(), ResolveUnboundVariability(), and FunctionCallExpr::TypeCheck().
| const bool FunctionType::isUnmasked |
Indicates whether the function doesn't take an implicit mask parameter (and thus should start execution with an "all on" mask).
Definition at line 903 of file type.h.
Referenced by GetReturnTypeString(), lCheckTypeEquality(), LLVMFunctionType(), Mangle(), and ResolveUnboundVariability().
llvm::SmallVector<Expr *, 8> FunctionType::paramDefaults [mutable, private] |
Default values of the function's arguments. For arguments without default values provided, NULL is stored.
Definition at line 922 of file type.h.
Referenced by FunctionType(), GetParameterDefault(), and ResolveUnboundVariability().
const llvm::SmallVector<std::string, 8> FunctionType::paramNames [private] |
Definition at line 919 of file type.h.
Referenced by FunctionType(), GetCDeclaration(), GetParameterName(), and ResolveUnboundVariability().
const llvm::SmallVector<SourcePos, 8> FunctionType::paramPositions [private] |
The names provided (if any) with the function arguments in the function's signature. These should only be used for error messages and the like and so not affect testing function types for equality, etc.
Definition at line 927 of file type.h.
Referenced by FunctionType(), GetParameterSourcePos(), and ResolveUnboundVariability().
const llvm::SmallVector<const Type *, 8> FunctionType::paramTypes [private] |
Definition at line 918 of file type.h.
Referenced by FunctionType(), GetCDeclaration(), GetNumParameters(), GetParameterType(), GetString(), LLVMFunctionType(), Mangle(), and ResolveUnboundVariability().
const Type* const FunctionType::returnType [private] |
Definition at line 914 of file type.h.
Referenced by FunctionType(), GetCDeclaration(), GetDIType(), GetReturnType(), GetReturnTypeString(), LLVMFunctionType(), and ResolveUnboundVariability().
1.7.5.1