aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Type.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-09 20:35:15 +0000
committerChris Lattner <sabre@nondot.org>2003-10-09 20:35:15 +0000
commit1bc33a5227d6d4b9e1da6fbde1c8369921e3fba5 (patch)
treef83fbf7f7a271a3388b8fd87ba076c982788bde1 /include/llvm/Type.h
parentae19bf7c37fb2dac783d1aa68cc292d0a37b096f (diff)
Make getContainedType more efficient by not returning null if out of range!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8987 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Type.h')
-rw-r--r--include/llvm/Type.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/llvm/Type.h b/include/llvm/Type.h
index 5900b402dc..3ed2d2dd7a 100644
--- a/include/llvm/Type.h
+++ b/include/llvm/Type.h
@@ -202,11 +202,11 @@ public:
/// 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; }