diff options
author | David Robillard <d@drobilla.net> | 2009-03-15 01:14:53 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-03-15 01:14:53 +0000 |
commit | bd68b2c74ed41efcad5a965ad81abacb17235aad (patch) | |
tree | 203c749ce517ac9b106ce7748dbe4c025ba2cdea /llvm.cpp | |
parent | 117b9fbb3d0737f44cf3f8f3f1a3f964b1f9e777 (diff) | |
download | resp-bd68b2c74ed41efcad5a965ad81abacb17235aad.tar.gz resp-bd68b2c74ed41efcad5a965ad81abacb17235aad.tar.bz2 resp-bd68b2c74ed41efcad5a965ad81abacb17235aad.zip |
Fix polymorphism when evaluation files.
Shut up debug output.
git-svn-id: http://svn.drobilla.net/resp/tuplr@90 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'llvm.cpp')
-rw-r--r-- | llvm.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -124,7 +124,6 @@ CEnv::compile(AST* obj) void CEnv::optimise(CFunction f) { - _pimpl->module->dump(); verifyFunction(*static_cast<Function*>(f)); _pimpl->opt.run(*static_cast<Function*>(f)); } @@ -264,10 +263,9 @@ AClosure::liftCall(CEnv& cenv, const vector<AType*>& argsT) argsSubst[dynamic_cast<AType*>(genericProtT->at(i))] = dynamic_cast<AType*>(argsT.at(i)); AType* thisType = new AType(*dynamic_cast<ATuple*>(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<SExp, AST*> > 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; |