aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-01-27 18:53:04 +0000
committerDavid Robillard <d@drobilla.net>2009-01-27 18:53:04 +0000
commit8199d5ac704e785e5fca88f7ba103ade119a1550 (patch)
treeef09e97e62fdb9577fd68f29c6bdb48d75922193
parentd68c73f6c6e04f02d153d1b879463e0a3fd6f218 (diff)
downloadresp-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.cpp8
1 files 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<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);