D2: pass static arrays into functions by value

This commit is contained in:
Alexey Prokhin
2011-04-30 15:30:57 +04:00
parent 069f0a6262
commit 805fb5cfc1
5 changed files with 22 additions and 27 deletions

View File

@@ -176,7 +176,7 @@ const llvm::Type * IrTypeSArray::sarray2llvm(Type * t)
const llvm::Type* elemType = DtoType(t->nextOf());
if (elemType == llvm::Type::getVoidTy(llvm::getGlobalContext()))
elemType = llvm::Type::getInt8Ty(llvm::getGlobalContext());
return llvm::ArrayType::get(elemType, dim);
return llvm::ArrayType::get(elemType, dim == 0 ? 1 : dim);
}
//////////////////////////////////////////////////////////////////////////////