mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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
This commit is contained in:
@@ -156,8 +156,7 @@ public:
|
||||
|
||||
|
||||
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 @@ public:
|
||||
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 @@ public:
|
||||
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; }
|
||||
|
||||
|
Reference in New Issue
Block a user