[llvm-commits] CVS: llvm/lib/VMCore/Type.cpp
Chris Lattner
clattner at apple.com
Fri Jan 5 18:18:11 PST 2007
>>> + if (getTypeID() == Type::PointerTyID)
>>> + return isa<PointerType>(Ty);
>>> return false; // Other types have no identity values
>>> }
>>
>> What is Type::canLosslesslyBitCastTo used by now? Can we just
>> eliminate it?
>
> InstCombine.
-raise is now the only pass using it. I added a note to PR1072 so
that it is removed when -raise is.
>>
>>
>>> +FunctionType::ParameterAttributes
>>> +FunctionType::getParamAttrs(unsigned Idx) const {
>>> + if (!ParamAttrs)
>>> + return ParameterAttributes(0);
>>> + if (Idx > ParamAttrs->size())
>>> + return ParameterAttributes(0);
>>> + return (*ParamAttrs)[Idx];
>>> +}
>>
>> Why does this map an out-of-range index onto attr 0? Shouldn't this
>> be an assert?
>
> No, I'm trying to save space. If you don't set any attributes or don't
> set them on all the parameters then it isn't an error, you just get
> "none Set". In a subsequent patch I made this clear by returning
> NoAttributeSet enum (has value 0).
>
> This saves space by not requiring the ParamAttrs vector to have an
> entry
> for each parameter and not requiring it to even be allocated if there
> aren't any parameter attributes.
Ah, cool!
Thanks Reid,
-Chris
More information about the llvm-commits
mailing list