diff options
author | David Robillard <d@drobilla.net> | 2009-10-15 16:50:14 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-10-15 16:50:14 +0000 |
commit | 0ee5ad002dbe88c791bfa48e392094bade72a12c (patch) | |
tree | 918300d71be5f8b18ce6274ec9bcb2de986916c1 /src/llvm.cpp | |
parent | 9fe6831a3f9f0b9c062f3cd570327bfb828667d9 (diff) | |
download | resp-0ee5ad002dbe88c791bfa48e392094bade72a12c.tar.gz resp-0ee5ad002dbe88c791bfa48e392094bade72a12c.tar.bz2 resp-0ee5ad002dbe88c791bfa48e392094bade72a12c.zip |
Clean up function type system.
Unify function types globally, rather than construct a "generic type" locally, since this didn't
take into consideration captured bindings, leaving the generic type not as solved as it could be.
git-svn-id: http://svn.drobilla.net/resp/tuplr@226 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/llvm.cpp')
-rw-r--r-- | src/llvm.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/llvm.cpp b/src/llvm.cpp index d022413..1b01e4d 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -224,10 +224,8 @@ LLVMEngine::compileLiteral(CEnv& cenv, AST* lit) CFunc LLVMEngine::compileFunction(CEnv& cenv, AFn* fn, const AType& argsT) { - TEnv::GenericTypes::const_iterator gt = cenv.tenv.genericTypes.find(fn); - assert(gt != cenv.tenv.genericTypes.end()); LLVMEngine* engine = reinterpret_cast<LLVMEngine*>(cenv.engine()); - AType* genericType = new AType(*gt->second); + AType* genericType = cenv.type(cenv.resolve(fn)); AType* thisType = genericType; Subst argsSubst; @@ -259,7 +257,7 @@ LLVMEngine::compileFunction(CEnv& cenv, AFn* fn, const AType& argsT) cenv.push(); Subst oldSubst = cenv.tsubst; - cenv.tsubst = Subst::compose(cenv.tsubst, Subst::compose(argsSubst, fn->subst)); + cenv.tsubst = Subst::compose(cenv.tsubst, argsSubst); // Bind argument values in CEnv vector<Value*> args; |