aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-03-12 06:35:16 +0000
committerDavid Robillard <d@drobilla.net>2009-03-12 06:35:16 +0000
commit534a30b988ffc35687feb05765c10131a3f85ead (patch)
treecc3ad12c375e99c9e691bce8fbd5173257c8b35b
parent22b5ef111e00af6c1b3c56283b71337d2fda351b (diff)
downloadresp-534a30b988ffc35687feb05765c10131a3f85ead.tar.gz
resp-534a30b988ffc35687feb05765c10131a3f85ead.tar.bz2
resp-534a30b988ffc35687feb05765c10131a3f85ead.zip
Remove useless Log class.
git-svn-id: http://svn.drobilla.net/resp/tuplr@86 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r--llvm.cpp19
-rw-r--r--tuplr.hpp12
2 files changed, 12 insertions, 19 deletions
diff --git a/llvm.cpp b/llvm.cpp
index 48e9849..baaeb9e 100644
--- a/llvm.cpp
+++ b/llvm.cpp
@@ -95,11 +95,10 @@ struct CEnv::PImpl {
Module* module;
ExistingModuleProvider emp;
FunctionPassManager opt;
- Function* alloc;
};
CEnv::CEnv(PEnv& p, TEnv& t, CEngine e, ostream& os, ostream& es)
- : penv(p), tenv(t), symID(0), alloc(0), log(os, es), _pimpl(new PImpl((LLVMEngine*)e))
+ : out(os), err(es), penv(p), tenv(t), symID(0), alloc(0), _pimpl(new PImpl((LLVMEngine*)e))
{
}
@@ -551,10 +550,10 @@ eval(CEnv& cenv, const string& name, istream& is)
llengine(cenv)->builder.CreateRet(val);
cenv.optimise(f);
- cenv.log.out << call(resultType, llengine(cenv)->engine->getPointerToFunction(f))
+ cenv.out << call(resultType, llengine(cenv)->engine->getPointerToFunction(f))
<< " : " << resultType << endl;
} catch (Error& e) {
- cenv.log.err << e.what() << endl;
+ cenv.err << e.what() << endl;
return 1;
}
return 0;
@@ -564,8 +563,8 @@ int
repl(CEnv& cenv)
{
while (1) {
- cenv.log.out << "() ";
- cenv.log.out.flush();
+ cenv.out << "() ";
+ cenv.out.flush();
Cursor cursor("(stdin)");
try {
SExp exp = readExpression(cursor, std::cin);
@@ -592,13 +591,13 @@ repl(CEnv& cenv)
f->eraseFromParent(); // Error reading body, remove function
throw e;
}
- cenv.log.out << call(bodyT, llengine(cenv)->engine->getPointerToFunction(f));
+ cenv.out << call(bodyT, llengine(cenv)->engine->getPointerToFunction(f));
} else {
- cenv.log.out << "; " << cenv.compile(body);
+ cenv.out << "; " << cenv.compile(body);
}
- cenv.log.out << " : " << cenv.tenv.type(body) << endl;
+ cenv.out << " : " << cenv.tenv.type(body) << endl;
} catch (Error& e) {
- cenv.log.err << e.what() << endl;
+ cenv.err << e.what() << endl;
}
}
return 0;
diff --git a/tuplr.hpp b/tuplr.hpp
index f5da1ac..68e55f3 100644
--- a/tuplr.hpp
+++ b/tuplr.hpp
@@ -55,13 +55,6 @@ struct Error {
Cursor loc;
};
-/// Output streams (standard and error)
-struct Log {
- Log(ostream& o, ostream& e) : out(o), err(e) {}
- ostream& out;
- ostream& err;
-};
-
/// Expression ::= Atom | (Expression*)
template<typename Atom>
struct Exp {
@@ -436,13 +429,14 @@ struct CEnv {
void optimise(CFunction f);
void write(std::ostream& os);
+ ostream& out;
+ ostream& err;
PEnv& penv;
- TEnv tenv;
+ TEnv& tenv;
Code code;
Vals vals;
unsigned symID;
CFunction alloc;
- Log log;
private:
struct PImpl; ///< Private Implementation