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

Chris Lattner lattner at cs.uiuc.edu
Thu Oct 9 15:36:08 PDT 2003


Changes in directory llvm/include/llvm:

Type.h updated: 1.30 -> 1.31

---
Log message:

Make getContainedType more efficient by not returning null if out of range!


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

Index: llvm/include/llvm/Type.h
diff -u llvm/include/llvm/Type.h:1.30 llvm/include/llvm/Type.h:1.31
--- llvm/include/llvm/Type.h:1.30	Thu Oct  2 18:35:45 2003
+++ llvm/include/llvm/Type.h	Thu Oct  9 15:35:15 2003
@@ -202,11 +202,11 @@
 
   /// getContainedType - This method is used to implement the type iterator
   /// (defined a the end of the file).  For derived types, this returns the
-  /// types 'contained' in the derived type, returning 0 when 'i' becomes
-  /// invalid. This allows the user to iterate over the types in a struct, for
-  /// example, really easily.
+  /// types 'contained' in the derived type.
   ///
-  virtual const Type *getContainedType(unsigned i) const { return 0; }
+  virtual const Type *getContainedType(unsigned i) const {
+    assert(0 && "No contained types!");
+  }
 
   /// getNumContainedTypes - Return the number of types in the derived type
   virtual unsigned getNumContainedTypes() const { return 0; }





More information about the llvm-commits mailing list