summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorAhmed Charles <ace2001ac@gmail.com>2012-02-19 11:37:01 +0000
committerAhmed Charles <ace2001ac@gmail.com>2012-02-19 11:37:01 +0000
commitb0934ab7d811e23bf530371976b8b35f3242169c (patch)
tree11a0f1c5a9a90a6084360819fbc67b6933a11bc0 /lib/VMCore
parentd7ace3f8d1b7216d7381c408b26259e1201f7c29 (diff)
downloadllvm-b0934ab7d811e23bf530371976b8b35f3242169c.tar.gz
llvm-b0934ab7d811e23bf530371976b8b35f3242169c.tar.bz2
llvm-b0934ab7d811e23bf530371976b8b35f3242169c.tar.xz
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
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Instructions.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index d113aca730..11fd5b6eae 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -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");
}
//===----------------------------------------------------------------------===//