From 8199d5ac704e785e5fca88f7ba103ade119a1550 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 27 Jan 2009 18:53:04 +0000 Subject: Fix function compilation. git-svn-id: http://svn.drobilla.net/resp/llvm-lisp@26 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- ll.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ll.cpp b/ll.cpp index 1441171..368a3cd 100644 --- a/ll.cpp +++ b/ll.cpp @@ -663,12 +663,12 @@ compileFunction(CEnv& cenv, const std::string& name, ASTTuple& prot, const Type* const TupV& texp = cenv.tenv.type(&prot)->tup; vector cprot; for (size_t i = 0; i < texp.size(); ++i) { - const Type* t = cenv.tenv.type(texp[i])->ctype; - if (!t) throw CompileError("Function parameter is untyped"); - cprot.push_back(t); + const AType* at = dynamic_cast(texp[i]); assert(at); + if (!at->ctype) throw CompileError("Parameter is untyped"); + cprot.push_back(at->ctype); } - if (!retT) throw CompileError("Function return is untyped"); + if (!retT) throw CompileError("Return is untyped"); FunctionType* fT = FunctionType::get(retT, cprot, false); Function* f = Function::Create(fT, linkage, name, cenv.module); -- cgit v1.2.1