[llvm-commits] [llvm] r72029 - /llvm/trunk/lib/VMCore/Instructions.cpp
Dan Gohman
gohman at apple.com
Mon May 18 11:55:40 PDT 2009
Author: djg
Date: Mon May 18 13:55:39 2009
New Revision: 72029
URL: http://llvm.org/viewvc/llvm-project?rev=72029&view=rev
Log:
Revert r72025. It is possible for clients to convert between signed types
and pointer types safely if they only do so when the sizes are the same.
llvm-gcc is such a client.
Modified:
llvm/trunk/lib/VMCore/Instructions.cpp
Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=72029&r1=72028&r2=72029&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Mon May 18 13:55:39 2009
@@ -2220,8 +2220,6 @@
} else {
assert(isa<PointerType>(SrcTy) &&
"Casting from a value that is not first-class type");
- assert(!SrcIsSigned &&
- "Pointer types cannot be considered signed for conversions!");
return PtrToInt; // ptr -> int
}
} else if (DestTy->isFloatingPoint()) { // Casting to floating pt
@@ -2261,7 +2259,6 @@
if (isa<PointerType>(SrcTy)) {
return BitCast; // ptr -> ptr
} else if (SrcTy->isInteger()) {
- assert(!SrcIsSigned && "Cannot cast signed integer to pointer!");
return IntToPtr; // int -> ptr
} else {
assert(!"Casting pointer to other than pointer or int");
More information about the llvm-commits
mailing list