aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-03-29 00:29:36 +0000
committerChris Lattner <sabre@nondot.org>2004-03-29 00:29:36 +0000
commit944cfafe76c9567cab806e8a6f7ad67686dfe717 (patch)
treeb7bdefc8ba2abb8cdf11c7e08e68f0c2e187f18e
parente83593b2d301073c5c4bbad232bee5aca214bbe5 (diff)
downloadexternal_llvm-944cfafe76c9567cab806e8a6f7ad67686dfe717.zip
external_llvm-944cfafe76c9567cab806e8a6f7ad67686dfe717.tar.gz
external_llvm-944cfafe76c9567cab806e8a6f7ad67686dfe717.tar.bz2
Add another check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12525 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/VMCore/Verifier.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 73285cd..feaef83 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -493,6 +493,11 @@ void Verifier::visitInstruction(Instruction &I) {
Assert1(I.getType() != Type::VoidTy || !I.hasName(),
"Instruction has a name, but provides a void value!", &I);
+ // Check that the return value of the instruction is either void or a legal
+ // value type.
+ Assert1(I.getType() == Type::VoidTy || I.getType()->isFirstClassType(),
+ "Instruction returns a non-scalar type!", &I);
+
// Check that all uses of the instruction, if they are instructions
// themselves, actually have parent basic blocks. If the use is not an
// instruction, it is an error!