[LLVMdev] SignlessTypes: Removal of Constant[SU]Int

Reid Spencer rspencer at reidspencer.com
Fri Oct 20 00:27:31 PDT 2006


All,

Just in case you're not on the llvm-commits list, the classes
ConstantSInt and ConstantUInt have been removed from the LLVM C++ IR.
This affects only the CVS HEAD. A patch to llvm-gcc4 to compensate for
this should be available in the next day or so, depending on when it
gets committed and updated.

If you're maintaining a language front end or other llvm-based software,
you'll probably need to make a few simple changes. In most cases just
removing the "S" or "U" from the class name should be all you need. For
example:

ConstantSInt::get(Type::IntTy, 0)  -> ConstantInt::get(Type::IntTy, 0)

Changes To Make:
1. ConstantUInt -> ConstantInt
2. ConstantSInt -> ConstantInt
3. The getRawValue method is gone. Use getZExtValue() instead.
4. The getValue method is gone. Use either getZExtValue (zero extended)
or 
   getSExtValue (sign extended) depending on the context.

These changes pass both dejagnu and llvm-test test suites at the time of
being committed.

Reid.




More information about the llvm-dev mailing list