aboutsummaryrefslogtreecommitdiffstats
path: root/src/c.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/c.cpp')
-rw-r--r--src/c.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/c.cpp b/src/c.cpp
index b1eafe5..4d53436 100644
--- a/src/c.cpp
+++ b/src/c.cpp
@@ -243,16 +243,16 @@ CEngine::compileIf(CEnv& cenv, const AIf* aif)
if (idx > 1)
out += "else {\n";
- Value* condV = llVal((*i)->compile(cenv));
+ Value* condV = llVal(resp_compile(cenv, *i));
out += (format("if (%s) {\n") % *condV).str();
- Value* thenV = llVal((*next)->compile(cenv));
+ Value* thenV = llVal(resp_compile(cenv, *next));
out += (format("%s = %s;\n}\n") % *varname % *thenV).str();
}
// Emit final else block
out += "else {\n";
- Value* elseV = llVal(aif->list_last()->compile(cenv));
+ Value* elseV = llVal(resp_compile(cenv, aif->list_last()));
out += (format("%s = %s;\n}\n") % *varname % *elseV).str();
for (size_t i = 1; i < idx / 2; ++i)
@@ -273,8 +273,8 @@ CEngine::compilePrimitive(CEnv& cenv, const APrimitive* prim)
APrimitive::const_iterator i = prim->begin();
++i;
- Value* a = llVal((*i++)->compile(cenv));
- Value* b = llVal((*i++)->compile(cenv));
+ Value* a = llVal(resp_compile(cenv, *i++));
+ Value* b = llVal(resp_compile(cenv, *i++));
const string n = prim->head()->to<const ASymbol*>()->str();
string op = n;
@@ -289,7 +289,7 @@ CEngine::compilePrimitive(CEnv& cenv, const APrimitive* prim)
string val("(");
val += *a + op + *b;
while (i != prim->end())
- val += op + *llVal((*i++)->compile(cenv));
+ val += op + *llVal(resp_compile(cenv, *i++));
val += ")";
Value* varname = new string(cenv.penv.gensymstr("x"));