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.

llvm-svn: 72029
This commit is contained in:
Dan Gohman 2009-05-18 18:55:39 +00:00
parent 8089763f48
commit f0974de75e
1 changed files with 0 additions and 3 deletions

View File

@ -2220,8 +2220,6 @@ CastInst::getCastOpcode(
} 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 @@ CastInst::getCastOpcode(
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");