[llvm-commits] ConstantRange

Chris Lattner clattner at apple.com
Wed Feb 28 12:04:05 PST 2007


On Feb 28, 2007, at 11:46 AM, Reid Spencer wrote:

> Chris,
>
> One last bugaboo on this. Right now, ConstantRange depends on VMCore
> because it needs Instructions.h to get the ICmp predicates. This is  
> now
> the only reason for it to be in lib/Analysis.  I would like to  
> propose a
> change:
>
> 1. Put the bulk of ConstantRange into a new class, APRange in
> lib/Support.
> 2. Derive ConstantRange from APRange and add the one constructor that
>    needs to use Instructions.h
>
> Does this make sense to you?  If so, can you copy  
> ConstantRange.cpp,v to
> APRange.cpp,v in lib/Support?

Better yet: just have a global function (or method of ConstantInt) in  
VMCore that constructs the appropriate ConstantRange and returns it.

-chris

> Thanks,
>
> Reid.
>
> On Wed, 2007-02-28 at 10:21 -0800, Reid Spencer wrote:
>> On Wed, 2007-02-28 at 10:11 -0800, Chris Lattner wrote:
>>> On Feb 28, 2007, at 8:29 AM, Reid Spencer wrote:
>>>
>>>> Chris,
>>>>
>>>> I have converted ConstantRange to use APInt internally. This
>>>> simplified
>>>> it and got rid of some of the helper functions inside ConstantRange
>>>> (because they have equivalents in APInt). Now I'm thinking that
>>>> ConstantRange should completely avoid the use of ConstantInt in its
>>>> API
>>>> and replace all such uses with APInt. This would mean that the  
>>>> class
>>>> could be implemented in lib/Support instead of lib/Analysis  
>>>> because it
>>>> would no longer depend on lib/VMCore.
>>>>
>>>> Is this a desirable change?
>>>
>>> Very desirable!
>>>
>>>> Or, do you want the interface to still work
>>>> with ConstantInt?
>>>
>>> No need, the clients of ConstantRange can do the xlation.
>>
>> Okay, I will make it so in increments.
>>
>>>
>>> -Chris
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list