[llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h

Chris Lattner lattner at cs.uiuc.edu
Sun Feb 8 22:14:02 PST 2004


Changes in directory llvm/include/llvm:

DerivedTypes.h updated: 1.50 -> 1.51

---
Log message:

Improve encapsulation in the FunctionType class, by adding param_(iterator/begin/end)
members, and eliminating the getParamTypes() method, and the associated typedef.


---
Diffs of the changes:  (+6 -4)

Index: llvm/include/llvm/DerivedTypes.h
diff -u llvm/include/llvm/DerivedTypes.h:1.50 llvm/include/llvm/DerivedTypes.h:1.51
--- llvm/include/llvm/DerivedTypes.h:1.50	Fri Feb  6 12:40:26 2004
+++ llvm/include/llvm/DerivedTypes.h	Sun Feb  8 22:12:57 2004
@@ -120,11 +120,10 @@
 
 
 
-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 @@
 
   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]; }





More information about the llvm-commits mailing list