aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-01-28 05:01:05 +0000
committerDavid Robillard <d@drobilla.net>2009-01-28 05:01:05 +0000
commitbb4c9c5fd9b47092eb526fa177771c3eac7815e0 (patch)
treef4d6a264ef9bb32f2f30f4a78c07b43b25f4d33d
parenta66ac0edecd4dcd446e4d7b6fe55657346bb1d0b (diff)
downloadresp-bb4c9c5fd9b47092eb526fa177771c3eac7815e0.tar.gz
resp-bb4c9c5fd9b47092eb526fa177771c3eac7815e0.tar.bz2
resp-bb4c9c5fd9b47092eb526fa177771c3eac7815e0.zip
Shrink.
git-svn-id: http://svn.drobilla.net/resp/llvm-lisp@30 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r--ll.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/ll.cpp b/ll.cpp
index 8bd14ac..6c876e7 100644
--- a/ll.cpp
+++ b/ll.cpp
@@ -704,10 +704,8 @@ Value*
ASTSymbol::compile(CEnv& cenv)
{
AST** c = cenv.code.ref(this);
- if (c)
- return cenv.vals.def(this, cenv.compile(*c));
-
- throw SyntaxError((string("Undefined symbol '") + cppstr + "'").c_str());
+ if (!c) throw SyntaxError((string("Undefined symbol: ") + cppstr).c_str());
+ return cenv.vals.def(this, cenv.compile(*c));
}
void
@@ -787,14 +785,7 @@ ASTCall::lift(CEnv& cenv)
Value*
ASTCall::compile(CEnv& cenv)
{
- ASTClosure* c = dynamic_cast<ASTClosure*>(tup[0]);
- if (!c) {
- AST** val = cenv.code.ref(tup[0]);
- c = (val) ? dynamic_cast<ASTClosure*>(*val) : c;
- }
-
- assert(c);
- Function* f = dynamic_cast<Function*>(cenv.compile(c));
+ Function* f = dynamic_cast<Function*>(cenv.compile(tup[0]));
if (!f) throw CompileError("Callee failed to compile");
vector<Value*> params(tup.size() - 1);