[LLVMdev] ConstantInt::getRawValue

Vladimir Prus ghost at cs.msu.su
Sat Jun 19 05:38:01 PDT 2004


Chris Lattner wrote:

> > If  getRawValue is moved to ConstantIntegral, I'd simply write
> >
> >   if (ConstantIntegral* CI = dyn_cast<ConstantInt>(V)) {
> >      BuildMI(*MBB, IPt, NM::MOVE, 1, Reg).addImm(CI->getRawValue());
> >   } ...
> >
> > which is a bit nicer. Of course, if you think it's a good idea, I can
> > send a patch.
>
> Sure that sounds great.  It increases the size of the ConstantBool class,
> but since there are only two instances of it ever created, I think we can
> live with this. :)

I actually meant making getRawValue into a virtual function, so the size of 
ConstantBool won't change, but speed might change. I'm not at all sure that 
the virtual call overhead will be noticable, but if you prefer to move both 
getRawValue and Val into ConstantIntergal, that's fine with me, too -- I can 
make a change either way.

- Volodya




More information about the llvm-dev mailing list