diff options
author | Chris Lattner <sabre@nondot.org> | 2004-03-29 00:29:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-03-29 00:29:36 +0000 |
commit | 5f126b74d3303556fb3b38db3049ab79828bae4b (patch) | |
tree | ba9c0f70cdff80fa422654e81c983a338a629a7e /llvm/lib/VMCore/Verifier.cpp | |
parent | 587a9f14168dc87b3aa208c9c025fa1b17f7ec55 (diff) | |
download | bcm5719-llvm-5f126b74d3303556fb3b38db3049ab79828bae4b.tar.gz bcm5719-llvm-5f126b74d3303556fb3b38db3049ab79828bae4b.zip |
Add another check
llvm-svn: 12525
Diffstat (limited to 'llvm/lib/VMCore/Verifier.cpp')
-rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index 73285cddde6..feaef83bbb3 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/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! |