aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-02-21 02:14:01 +0000
committerDevang Patel <dpatel@apple.com>2008-02-21 02:14:01 +0000
commitdb71d63467bdb7b629641fee3272b47bd028e09f (patch)
tree5e63eaab6c1d58126fb437b8dca636411ba59a51 /lib
parentbb4f8d40458eb086cb901e19c4be0777e2a73dce (diff)
downloadexternal_llvm-db71d63467bdb7b629641fee3272b47bd028e09f.zip
external_llvm-db71d63467bdb7b629641fee3272b47bd028e09f.tar.gz
external_llvm-db71d63467bdb7b629641fee3272b47bd028e09f.tar.bz2
Let invoke return aggregate value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47425 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Value.cpp2
-rw-r--r--lib/VMCore/Verifier.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/VMCore/Value.cpp b/lib/VMCore/Value.cpp
index 440e0a6..9f8f56e 100644
--- a/lib/VMCore/Value.cpp
+++ b/lib/VMCore/Value.cpp
@@ -34,7 +34,7 @@ static inline const Type *checkType(const Type *Ty) {
Value::Value(const Type *ty, unsigned scid)
: SubclassID(scid), SubclassData(0), Ty(checkType(ty)),
UseList(0), Name(0) {
- if (isa<CallInst>(this))
+ if (isa<CallInst>(this) || isa<InvokeInst>(this))
assert((Ty->isFirstClassType() || Ty == Type::VoidTy ||
isa<OpaqueType>(ty) || Ty->getTypeID() == Type::StructTyID) &&
"invalid CallInst type!");
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 27adc08..2eb306b 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -1072,7 +1072,8 @@ void Verifier::visitInstruction(Instruction &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()
- || (isa<CallInst>(I) && I.getType()->getTypeID() == Type::StructTyID),
+ || ((isa<CallInst>(I) || isa<InvokeInst>(I))
+ && I.getType()->getTypeID() == Type::StructTyID),
"Instruction returns a non-scalar type!", &I);
// Check that all uses of the instruction, if they are instructions
@@ -1096,7 +1097,7 @@ void Verifier::visitInstruction(Instruction &I) {
if (isa<ReturnInst>(I) || isa<GetResultInst>(I))
Assert1(I.getOperand(i)->getType()->getTypeID() == Type::StructTyID,
"Invalid ReturnInst operands!", &I);
- else if (isa<CallInst>(I)) {
+ else if (isa<CallInst>(I) || isa<InvokeInst>(I)) {
if (const PointerType *PT = dyn_cast<PointerType>
(I.getOperand(i)->getType())) {
const Type *ETy = PT->getElementType();