Add convenience method.
authorChris Lattner <sabre@nondot.org>
Fri, 7 Jan 2005 07:40:32 +0000 (07:40 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 7 Jan 2005 07:40:32 +0000 (07:40 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19321 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Function.h
lib/VMCore/Function.cpp

index a540ee3f7438df48f0b312b38aa45ab102466f56..a4545a79ab1404813aa587acacd831c067b347d8 100644 (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
index a35a55b4bb41cf35df5d49c2ff6c8b3e6c2c7c31..340bb1b4d12010b63f6d319c8078279c99432c55 100644 (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();
 }