aboutsummaryrefslogtreecommitdiffstats
path: root/ll.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'll.cpp')
-rw-r--r--ll.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/ll.cpp b/ll.cpp
index 824f8a7..1441171 100644
--- a/ll.cpp
+++ b/ll.cpp
@@ -544,15 +544,12 @@ compose(const TSubst& delta, const TSubst& gamma) // TAPL 22.1.1
{
TSubst r;
for (TSubst::const_iterator g = gamma.begin(); g != gamma.end(); ++g) {
- TSubst::const_iterator i = delta.find(g->second);
- if (i != delta.end())
- r.insert(make_pair(g->first, ((i != delta.end()) ? i : g)->second));
- else
- r.insert(make_pair(g->first, g->second));
+ TSubst::const_iterator d = delta.find(g->second);
+ r.insert(make_pair(g->first, ((d != delta.end()) ? d : g)->second));
}
for (TSubst::const_iterator d = delta.begin(); d != delta.end(); ++d) {
if (gamma.find(d->first) == gamma.end())
- r.insert(make_pair(d->first, d->second));
+ r.insert(*d);
}
return r;
}
@@ -667,11 +664,11 @@ compileFunction(CEnv& cenv, const std::string& name, ASTTuple& prot, const Type*
vector<const Type*> cprot;
for (size_t i = 0; i < texp.size(); ++i) {
const Type* t = cenv.tenv.type(texp[i])->ctype;
- if (!t) throw CompileError("Function prototype contains NULL");
+ if (!t) throw CompileError("Function parameter is untyped");
cprot.push_back(t);
}
- if (!retT) throw CompileError("Function return value type is NULL");
+ if (!retT) throw CompileError("Function return is untyped");
FunctionType* fT = FunctionType::get(retT, cprot, false);
Function* f = Function::Create(fT, linkage, name, cenv.module);