Check return types of functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10146 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2003-11-21 22:32:23 +00:00
parent 1f254d50eb
commit c282f5a380
3 changed files with 9 additions and 0 deletions

View File

@@ -1395,6 +1395,9 @@ FunctionHeaderH : TypesV Name '(' ArgList ')' {
UnEscapeLexed($2);
std::string FunctionName($2);
if (!(*$1)->isFirstClassType() && *$1 != Type::VoidTy)
ThrowException("LLVM functions cannot return aggregate types!");
std::vector<const Type*> ParamTypeList;
if ($4) { // If there are arguments...
for (std::vector<std::pair<PATypeHolder*,char*> >::iterator I = $4->begin();