mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-28 03:25:23 +00:00
Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150918 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2559,9 +2559,8 @@ CastInst::getCastOpcode(
|
||||
assert(DestBits == SrcBits &&
|
||||
"Casting vector to floating point of different width");
|
||||
return BitCast; // same size, no-op cast
|
||||
} else {
|
||||
llvm_unreachable("Casting pointer or non-first class to float");
|
||||
}
|
||||
llvm_unreachable("Casting pointer or non-first class to float");
|
||||
} else if (DestTy->isVectorTy()) {
|
||||
assert(DestBits == SrcBits &&
|
||||
"Illegal cast to vector (wrong type or size)");
|
||||
@@ -2571,24 +2570,16 @@ CastInst::getCastOpcode(
|
||||
return BitCast; // ptr -> ptr
|
||||
} else if (SrcTy->isIntegerTy()) {
|
||||
return IntToPtr; // int -> ptr
|
||||
} else {
|
||||
llvm_unreachable("Casting pointer to other than pointer or int");
|
||||
}
|
||||
llvm_unreachable("Casting pointer to other than pointer or int");
|
||||
} else if (DestTy->isX86_MMXTy()) {
|
||||
if (SrcTy->isVectorTy()) {
|
||||
assert(DestBits == SrcBits && "Casting vector of wrong width to X86_MMX");
|
||||
return BitCast; // 64-bit vector to MMX
|
||||
} else {
|
||||
llvm_unreachable("Illegal cast to X86_MMX");
|
||||
}
|
||||
} else {
|
||||
llvm_unreachable("Casting to type that is not first-class");
|
||||
llvm_unreachable("Illegal cast to X86_MMX");
|
||||
}
|
||||
|
||||
// If we fall through to here we probably hit an assertion cast above
|
||||
// and assertions are not turned on. Anything we return is an error, so
|
||||
// BitCast is as good a choice as any.
|
||||
return BitCast;
|
||||
llvm_unreachable("Casting to type that is not first-class");
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
Reference in New Issue
Block a user