[llvm-commits] ConstantRange
Nick Lewycky
nicholas at mxc.ca
Wed Feb 28 16:29:45 PST 2007
Chris Lattner wrote:
> 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.
In my tree, I have an additional constructor for ConstantRange that
takes an ICmpInst::Predicate and a ConstantRange. It returns the range
where all of the values in the range satisfy the predicate against any
of the values in the argument range.
Where would a method like this fit, assuming that it doesn't belong in a
pass?
Nick
More information about the llvm-commits
mailing list