From bd68b2c74ed41efcad5a965ad81abacb17235aad Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 15 Mar 2009 01:14:53 +0000 Subject: Fix polymorphism when evaluation files. Shut up debug output. git-svn-id: http://svn.drobilla.net/resp/tuplr@90 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- llvm.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'llvm.cpp') diff --git a/llvm.cpp b/llvm.cpp index a599872..f4576ce 100644 --- a/llvm.cpp +++ b/llvm.cpp @@ -124,7 +124,6 @@ CEnv::compile(AST* obj) void CEnv::optimise(CFunction f) { - _pimpl->module->dump(); verifyFunction(*static_cast(f)); _pimpl->opt.run(*static_cast(f)); } @@ -264,10 +263,9 @@ AClosure::liftCall(CEnv& cenv, const vector& argsT) argsSubst[dynamic_cast(genericProtT->at(i))] = dynamic_cast(argsT.at(i)); AType* thisType = new AType(*dynamic_cast(argsSubst.apply(genericType)), loc); - cenv.err << "THIS TYPE: " << thisType << endl; - //if (!thisType->concrete()) - // throw Error("unable to resolve concrete type for function", loc); + if (!thisType->concrete()) + throw Error("unable to resolve concrete type for function", loc); if (funcs.find(thisType)) return; @@ -601,15 +599,15 @@ eval(CEnv& cenv, const string& name, istream& is) list< pair > exprs; Cursor cursor(name); try { - Constraints c; while (true) { SExp exp = readExpression(cursor, is); if (exp.type == SExp::LIST && exp.list.empty()) break; result = cenv.penv.parse(exp); // Parse input + Constraints c; result->constrain(cenv.tenv, c); // Constrain types - cenv.tsubst = TEnv::unify(c); // Solve type constraints + cenv.tsubst = Subst::compose(cenv.tsubst, TEnv::unify(c)); // Solve type constraints resultType = cenv.type(result); result->lift(cenv); // Lift functions exprs.push_back(make_pair(exp, result)); @@ -650,7 +648,6 @@ repl(CEnv& cenv) Cursor cursor("(stdin)"); Constraints c; try { - SExp exp = readExpression(cursor, std::cin); if (exp.type == SExp::LIST && exp.list.empty()) break; -- cgit v1.2.1