[llvm-commits] CVS: llvm/lib/VMCore/Type.cpp

Chris Lattner lattner at cs.uiuc.edu
Tue Jul 6 18:26:02 PDT 2004


Changes in directory llvm/lib/VMCore:

Type.cpp updated: 1.105 -> 1.106

---
Log message:

Make sure people don't make functiontypes with an invalid return type


---
Diffs of the changes:  (+2 -0)

Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.105 llvm/lib/VMCore/Type.cpp:1.106
--- llvm/lib/VMCore/Type.cpp:1.105	Sun Jul  4 07:15:11 2004
+++ llvm/lib/VMCore/Type.cpp	Tue Jul  6 18:25:19 2004
@@ -402,6 +402,8 @@
                            const std::vector<const Type*> &Params, 
                            bool IsVarArgs) : DerivedType(FunctionTyID), 
                                              isVarArgs(IsVarArgs) {
+  assert((Result->isFirstClassType() || Result == Type::VoidTy) && 
+         "LLVM functions cannot return aggregates");
   bool isAbstract = Result->isAbstract();
   ContainedTys.reserve(Params.size()+1);
   ContainedTys.push_back(PATypeHandle(Result, this));





More information about the llvm-commits mailing list