summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-09-08 16:45:59 +0000
committerDan Gohman <gohman@apple.com>2008-09-08 16:45:59 +0000
commitc05dca95a21825dc10fd788781d64a585e347767 (patch)
treef0549569b036794d2b963df5abc19e0d2b06ab10 /llvm/lib
parentfd18d630bc65840c151fcf87754fc7173027a28c (diff)
downloadbcm5719-llvm-c05dca95a21825dc10fd788781d64a585e347767.tar.gz
bcm5719-llvm-c05dca95a21825dc10fd788781d64a585e347767.zip
Bitcasting two or from aggregate types is not permitted. Update
LangRef.html, and teach the verifier to check bitcast instructions. llvm-svn: 55921
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Verifier.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp
index aa6963d94a2..805fb2564a4 100644
--- a/llvm/lib/VMCore/Verifier.cpp
+++ b/llvm/lib/VMCore/Verifier.cpp
@@ -883,6 +883,12 @@ void Verifier::visitBitCastInst(BitCastInst &I) {
"Bitcast requires both operands to be pointer or neither", &I);
Assert1(SrcBitSize == DestBitSize, "Bitcast requies types of same width", &I);
+ // Disallow aggregates.
+ Assert1(!SrcTy->isAggregateType(),
+ "Bitcast operand must not be aggregate", &I);
+ Assert1(!DestTy->isAggregateType(),
+ "Bitcast type must not be aggregate", &I);
+
visitInstruction(I);
}
OpenPOWER on IntegriCloud