summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
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
commit636a3d618ca8217e3fc77b0e47596a9114864aed (patch)
treecc77af62ca8eec4a0419cb4bb871a5889353a24a /llvm/lib/VMCore/Instructions.cpp
parenta4704ab080703a2f761b6319eb1f73ba02d3be5f (diff)
downloadbcm5719-llvm-636a3d618ca8217e3fc77b0e47596a9114864aed.tar.gz
bcm5719-llvm-636a3d618ca8217e3fc77b0e47596a9114864aed.zip
Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
llvm-svn: 150918
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index d113aca7308..11fd5b6eae4 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/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");
}
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud