[LLVMdev] Re: Re: [PATCH] BasicBlock::getFirstNonPHI
Vladimir Prus
ghost at cs.msu.su
Thu Jun 8 08:47:04 PDT 2006
Chris Lattner wrote:
> On Mon, 5 Jun 2006, Vladimir Prus wrote:
>>> Sure, sounds good. A couple requests:
>>>
>>> 1. Please add a const version that returns a const Instruction* also.
>>
>> I was considering it, but then decided that given that you can't pass
>> 'const Instruction*' as 'insert before' parameter of any other
>> instruction, there's no point in adding it.
>
> Ok, that makes sense.
>
>> Maybe, the method should be
>>
>> Instruction* getFirstNonPHI() const
>>
>> ? Given that in C++ constness is generally not deep -- i.e. don't apply
>> to contained objects.
>
> True, but that would break "logical constness" which is more useful. :)
> I'd prefer either two versions or just the single non-const version.
Okay, I've checked in the version with single non-const method.
Thanks,
Volodya
More information about the llvm-dev
mailing list