diff options
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r-- | llvm/lib/IR/Value.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp index 33b61c9..c3796f1 100644 --- a/llvm/lib/IR/Value.cpp +++ b/llvm/lib/IR/Value.cpp @@ -58,10 +58,13 @@ Value::Value(Type *ty, unsigned scid) // FIXME: Why isn't this in the subclass gunk?? // Note, we cannot call isa<CallInst> before the CallInst has been // constructed. - if (SubclassID == Instruction::Call || SubclassID == Instruction::Invoke || - SubclassID == Instruction::CallBr) + unsigned OpCode = 0; + if (SubclassID >= InstructionVal) + OpCode = SubclassID - InstructionVal; + if (OpCode == Instruction::Call || OpCode == Instruction::Invoke || + OpCode == Instruction::CallBr) assert((VTy->isFirstClassType() || VTy->isVoidTy() || VTy->isStructTy()) && - "invalid CallInst type!"); + "invalid CallBase type!"); else if (SubclassID != BasicBlockVal && (/*SubclassID < ConstantFirstVal ||*/ SubclassID > ConstantLastVal)) assert((VTy->isFirstClassType() || VTy->isVoidTy()) && |