diff options
author | Chris Lattner <sabre@nondot.org> | 2004-02-09 04:12:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-02-09 04:12:57 +0000 |
commit | f5a4e33e497d161491c1ae5320e8cc30e2a7a243 (patch) | |
tree | d930eca55265797c71de46c4d42f0acb2f3a0cf5 /llvm | |
parent | a9634a0ee3e430831fe2819792eee748639a3100 (diff) | |
download | bcm5719-llvm-f5a4e33e497d161491c1ae5320e8cc30e2a7a243.tar.gz bcm5719-llvm-f5a4e33e497d161491c1ae5320e8cc30e2a7a243.zip |
Improve encapsulation in the FunctionType class, by adding param_(iterator/begin/end)
members, and eliminating the getParamTypes() method, and the associated typedef.
llvm-svn: 11223
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/DerivedTypes.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/include/llvm/DerivedTypes.h b/llvm/include/llvm/DerivedTypes.h index 117a0b94239..1ed6ee41795 100644 --- a/llvm/include/llvm/DerivedTypes.h +++ b/llvm/include/llvm/DerivedTypes.h @@ -120,11 +120,10 @@ public: -struct FunctionType : public DerivedType { - typedef std::vector<PATypeHandle> ParamTypes; +class FunctionType : public DerivedType { friend class TypeMap<FunctionValType, FunctionType>; -private: PATypeHandle ResultType; + typedef std::vector<PATypeHandle> 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]; } |