Catch aggregates passed by value sooner rather than later.
authorChris Lattner <sabre@nondot.org>
Tue, 13 Jul 2004 20:09:51 +0000 (20:09 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 13 Jul 2004 20:09:51 +0000 (20:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14800 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Type.cpp

index 32b783b0d134ece709108ce92513a62d43245e7f..c6ce34701cf1907ae74061f2d0436d793877a81e 100644 (file)
@@ -364,6 +364,9 @@ FunctionType::FunctionType(const Type *Result,
   ContainedTys.push_back(PATypeHandle(Result, this));
 
   for (unsigned i = 0; i != Params.size(); ++i) {
+    assert((Params[i]->isFirstClassType() || isa<OpaqueType>(Params[i])) &&
+           "Function arguments must be value types!");
+
     ContainedTys.push_back(PATypeHandle(Params[i], this));
     isAbstract |= Params[i]->isAbstract();
   }