[llvm-commits] [gcc-plugin] r82033 - /gcc-plugin/trunk/llvm-types.cpp
Duncan Sands
baldrick at free.fr
Wed Sep 16 02:11:38 PDT 2009
Author: baldrick
Date: Wed Sep 16 04:11:38 2009
New Revision: 82033
URL: http://llvm.org/viewvc/llvm-project?rev=82033&view=rev
Log:
Convert booleans based on the type precision, the
same as is done for integer types. This stops us
crashing when GCC does an implicit conversion from
a boolean type with one bit of precision to an
integer type with one bit of precision: before we
thought this was an i8 -> i1 type conversion, and
didn't like it. Now it is i1 -> i1.
Modified:
gcc-plugin/trunk/llvm-types.cpp
Modified: gcc-plugin/trunk/llvm-types.cpp
URL: http://llvm.org/viewvc/llvm-project/gcc-plugin/trunk/llvm-types.cpp?rev=82033&r1=82032&r2=82033&view=diff
==============================================================================
--- gcc-plugin/trunk/llvm-types.cpp (original)
+++ gcc-plugin/trunk/llvm-types.cpp Wed Sep 16 04:11:38 2009
@@ -661,8 +661,7 @@
case BOOLEAN_TYPE: {
if (const Type *Ty = GET_TYPE_LLVM(type))
return Ty;
- return SET_TYPE_LLVM(type,
- IntegerType::get(Context, TREE_INT_CST_LOW(TYPE_SIZE(type))));
+ return SET_TYPE_LLVM(type, IntegerType::get(Context, TYPE_PRECISION(type)));
}
case ENUMERAL_TYPE:
// Use of an enum that is implicitly declared?
More information about the llvm-commits
mailing list