From fe59d36c4510b9b3df6deab2fe269ef19db4d193 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 7 Jan 2005 07:40:32 +0000 Subject: [PATCH] Add convenience method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19321 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Function.h | 4 ++++ lib/VMCore/Function.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/llvm/Function.h b/include/llvm/Function.h index a540ee3f743..a4545a79ab1 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -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 diff --git a/lib/VMCore/Function.cpp b/lib/VMCore/Function.cpp index a35a55b4bb4..340bb1b4d12 100644 --- a/lib/VMCore/Function.cpp +++ b/lib/VMCore/Function.cpp @@ -142,6 +142,10 @@ const FunctionType *Function::getFunctionType() const { return cast(getType()->getElementType()); } +bool Function::isVarArg() const { + return getFunctionType()->isVarArg(); +} + const Type *Function::getReturnType() const { return getFunctionType()->getReturnType(); }