diff options
author | David Robillard <d@drobilla.net> | 2009-01-27 18:53:04 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-01-27 18:53:04 +0000 |
commit | 8199d5ac704e785e5fca88f7ba103ade119a1550 (patch) | |
tree | ef09e97e62fdb9577fd68f29c6bdb48d75922193 | |
parent | d68c73f6c6e04f02d153d1b879463e0a3fd6f218 (diff) | |
download | resp-8199d5ac704e785e5fca88f7ba103ade119a1550.tar.gz resp-8199d5ac704e785e5fca88f7ba103ade119a1550.tar.bz2 resp-8199d5ac704e785e5fca88f7ba103ade119a1550.zip |
Fix function compilation.
git-svn-id: http://svn.drobilla.net/resp/llvm-lisp@26 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r-- | ll.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -663,12 +663,12 @@ compileFunction(CEnv& cenv, const std::string& name, ASTTuple& prot, const Type* const TupV& texp = cenv.tenv.type(&prot)->tup; vector<const Type*> 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<AType*>(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); |