lower builtin_object_size result to the correct integer
intptr_t width. This returns -1 as -1 on 64-bit targets
instead of as 4294967295. rdar://6416760
llvm-svn: 60528
diff --git a/llvm-gcc-4.2/gcc/llvm-convert.cpp b/llvm-gcc-4.2/gcc/llvm-convert.cpp
index 14f62cc..6f4ea79 100644
--- a/llvm-gcc-4.2/gcc/llvm-convert.cpp
+++ b/llvm-gcc-4.2/gcc/llvm-convert.cpp
@@ -4575,9 +4575,9 @@
}
if (tree_low_cst (ObjSizeTree, 0) < 2)
- Result = ConstantInt::getAllOnesValue(Type::Int32Ty);
+ Result = ConstantInt::getAllOnesValue(TD.getIntPtrType());
else
- Result = ConstantInt::get(Type::Int32Ty, 0);
+ Result = ConstantInt::get(TD.getIntPtrType(), 0);
return true;
}
// Unary bit counting intrinsics.