[llvm-commits] [llvm-gcc-4.2] r45751 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Chris Lattner
sabre at nondot.org
Tue Jan 8 10:21:54 PST 2008
Author: lattner
Date: Tue Jan 8 12:21:54 2008
New Revision: 45751
URL: http://llvm.org/viewvc/llvm-project?rev=45751&view=rev
Log:
cleanups suggested by duncan, thanks Duncan!
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=45751&r1=45750&r2=45751&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Tue Jan 8 12:21:54 2008
@@ -988,13 +988,13 @@
// next size power-of-two register (e.g. i64). This should be reevaluated
// when we have good support for unusual sized integers in the code generator.
if (Result && TREE_CODE(TREE_TYPE(exp)) == INTEGER_TYPE) {
- unsigned LLVMWidth = cast<IntegerType>(Result->getType())->getBitWidth();
+ unsigned LLVMWidth = Result->getType()->getPrimitiveSizeInBits();
unsigned TreeWidth = TYPE_PRECISION(TREE_TYPE(exp));
if (LLVMWidth > TreeWidth && lang_hooks.reduce_bit_field_operations) {
if (TYPE_UNSIGNED(TREE_TYPE(exp))) {
// Use an 'and' to clear excess top bits.
Constant *Mask =
- ConstantInt::get(APInt::getLowBitsSet(LLVMWidth, TreeWidth));
+ ConstantInt::get(APInt::getLowBitsSet(LLVMWidth, TreeWidth));
Result = Builder.CreateAnd(Result, Mask, "mask");
} else {
// Shift Left then shift right.
More information about the llvm-commits
mailing list