diff options
author | Devang Patel <dpatel@apple.com> | 2008-02-21 01:54:02 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-02-21 01:54:02 +0000 |
commit | 1f00b535e13befad8e07de33f5abecb009958e38 (patch) | |
tree | 5b087b1118b4ff5807fb03faaa8264299d104efa /llvm/lib/VMCore/Value.cpp | |
parent | a2417c9d8b0bf63f3008383f7ae8938e41dceeda (diff) | |
download | bcm5719-llvm-1f00b535e13befad8e07de33f5abecb009958e38.tar.gz bcm5719-llvm-1f00b535e13befad8e07de33f5abecb009958e38.zip |
Let function call return aggregate.
Now, we have very first multiple return value testcase!
llvm-svn: 47424
Diffstat (limited to 'llvm/lib/VMCore/Value.cpp')
-rw-r--r-- | llvm/lib/VMCore/Value.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Value.cpp b/llvm/lib/VMCore/Value.cpp index 7b9d7f02b37..440e0a63fdb 100644 --- a/llvm/lib/VMCore/Value.cpp +++ b/llvm/lib/VMCore/Value.cpp @@ -14,6 +14,7 @@ #include "llvm/Constant.h" #include "llvm/DerivedTypes.h" #include "llvm/InstrTypes.h" +#include "llvm/Instructions.h" #include "llvm/Module.h" #include "llvm/ValueSymbolTable.h" #include "llvm/Support/Debug.h" @@ -33,7 +34,11 @@ 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<Constant>(this) && !isa<BasicBlock>(this)) + if (isa<CallInst>(this)) + assert((Ty->isFirstClassType() || Ty == Type::VoidTy || + isa<OpaqueType>(ty) || Ty->getTypeID() == Type::StructTyID) && + "invalid CallInst type!"); + else if (!isa<Constant>(this) && !isa<BasicBlock>(this)) assert((Ty->isFirstClassType() || Ty == Type::VoidTy || isa<OpaqueType>(ty)) && "Cannot create non-first-class values except for constants!"); |