From 36cb08ae5bc991bb91f1ab566100c2cdd25c344c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 9 Feb 2004 04:12:57 +0000 Subject: [PATCH] Improve encapsulation in the FunctionType class, by adding param_(iterator/begin/end) members, and eliminating the getParamTypes() method, and the associated typedef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11223 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/DerivedTypes.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/llvm/DerivedTypes.h b/include/llvm/DerivedTypes.h index 117a0b94239..1ed6ee41795 100644 --- a/include/llvm/DerivedTypes.h +++ b/include/llvm/DerivedTypes.h @@ -120,11 +120,10 @@ public: -struct FunctionType : public DerivedType { - typedef std::vector ParamTypes; +class FunctionType : public DerivedType { friend class TypeMap; -private: PATypeHandle ResultType; + typedef std::vector ParamTypes; ParamTypes ParamTys; bool isVarArgs; @@ -153,7 +152,10 @@ public: inline bool isVarArg() const { return isVarArgs; } inline const Type *getReturnType() const { return ResultType; } - inline const ParamTypes &getParamTypes() const { return ParamTys; } + + typedef ParamTypes::const_iterator param_iterator; + param_iterator param_begin() const { return ParamTys.begin(); } + param_iterator param_end() const { return ParamTys.end(); } // Parameter type accessors... const Type *getParamType(unsigned i) const { return ParamTys[i]; }