Add convenience method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19321 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-01-07 07:40:32 +00:00
parent 60766f7d41
commit fe59d36c45
2 changed files with 8 additions and 0 deletions

View File

@ -90,6 +90,10 @@ public:
const Type *getReturnType() const; // Return the type of the ret val
const FunctionType *getFunctionType() const; // Return the FunctionType for me
/// isVarArg - Return true if this function takes a variable number of
/// arguments.
bool isVarArg() const;
/// isExternal - Is the body of this function unknown? (The basic block list
/// is empty if so.) This is true for external functions, defined as forward
/// "declare"ations

View File

@ -142,6 +142,10 @@ const FunctionType *Function::getFunctionType() const {
return cast<FunctionType>(getType()->getElementType());
}
bool Function::isVarArg() const {
return getFunctionType()->isVarArg();
}
const Type *Function::getReturnType() const {
return getFunctionType()->getReturnType();
}