[llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h
Chris Lattner
lattner at cs.uiuc.edu
Thu Oct 9 15:36:01 PDT 2003
Changes in directory llvm/include/llvm:
DerivedTypes.h updated: 1.43 -> 1.44
---
Log message:
Make getContainedType more efficient by not returning null if out of range!
---
Diffs of the changes: (+3 -4)
Index: llvm/include/llvm/DerivedTypes.h
diff -u llvm/include/llvm/DerivedTypes.h:1.43 llvm/include/llvm/DerivedTypes.h:1.44
--- llvm/include/llvm/DerivedTypes.h:1.43 Fri Oct 3 13:57:52 2003
+++ llvm/include/llvm/DerivedTypes.h Thu Oct 9 15:35:09 2003
@@ -156,8 +156,7 @@
virtual const Type *getContainedType(unsigned i) const {
- return i == 0 ? ResultType :
- (i <= ParamTys.size() ? ParamTys[i-1].get() : 0);
+ return i == 0 ? ResultType.get() : ParamTys[i-1].get();
}
virtual unsigned getNumContainedTypes() const { return ParamTys.size()+1; }
@@ -239,7 +238,7 @@
inline const ElementTypes &getElementTypes() const { return ETypes; }
virtual const Type *getContainedType(unsigned i) const {
- return i < ETypes.size() ? ETypes[i].get() : 0;
+ return ETypes[i].get();
}
virtual unsigned getNumContainedTypes() const { return ETypes.size(); }
@@ -289,7 +288,7 @@
inline const Type *getElementType() const { return ElementType; }
virtual const Type *getContainedType(unsigned i) const {
- return i == 0 ? ElementType.get() : 0;
+ return ElementType.get();
}
virtual unsigned getNumContainedTypes() const { return 1; }
More information about the llvm-commits
mailing list