From e40b51ae710b1d0f4f4981069ec55d7aed61590a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 8 Dec 2010 19:16:03 +0000 Subject: Consistent naming for Engine compile methods. git-svn-id: http://svn.drobilla.net/resp/resp@314 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/c.cpp | 4 ++-- src/compile.cpp | 2 +- src/llvm.cpp | 4 ++-- src/resp.hpp | 24 ++++++++++++++---------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/c.cpp b/src/c.cpp index 2373846..4e71eae 100644 --- a/src/c.cpp +++ b/src/c.cpp @@ -162,7 +162,7 @@ struct CEngine : public Engine { CVal compileIf(CEnv& cenv, const ATuple* aif); CVal compileMatch(CEnv& cenv, const ATuple* match); CVal compileGlobal(CEnv& cenv, const AType* type, const string& sym, CVal val); - CVal getGlobal(CEnv& cenv, const string& sym, CVal val); + CVal compileGlobalGet(CEnv& cenv, const string& sym, CVal val); void writeModule(CEnv& cenv, std::ostream& os) { os << out; @@ -304,7 +304,7 @@ CEngine::compileGlobal(CEnv& cenv, const AType* type, const string& sym, CVal va } CVal -CEngine::getGlobal(CEnv& cenv, const string& sym, CVal val) +CEngine::compileGlobalGet(CEnv& cenv, const string& sym, CVal val) { return NULL; } diff --git a/src/compile.cpp b/src/compile.cpp index 647c7d5..65721fc 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -27,7 +27,7 @@ static CVal compile_symbol(CEnv& cenv, const ASymbol* sym) throw() { if (cenv.vals.topLevel(sym) && cenv.type(sym)->head()->str() != "Fn") { - return cenv.engine()->getGlobal(cenv, sym->cppstr, *cenv.vals.ref(sym)); + return cenv.engine()->compileGlobalGet(cenv, sym->cppstr, *cenv.vals.ref(sym)); } else { return *cenv.vals.ref(sym); } diff --git a/src/llvm.cpp b/src/llvm.cpp index 32aedf7..73935bb 100644 --- a/src/llvm.cpp +++ b/src/llvm.cpp @@ -208,7 +208,7 @@ struct LLVMEngine : public Engine { CVal compileIf(CEnv& cenv, const ATuple* aif); CVal compileMatch(CEnv& cenv, const ATuple* match); CVal compileGlobal(CEnv& cenv, const AType* type, const string& sym, CVal val); - CVal getGlobal(CEnv& cenv, const string& sym, CVal val); + CVal compileGlobalGet(CEnv& cenv, const string& sym, CVal val); typedef pair IfBranch; typedef vector IfBranches; @@ -548,7 +548,7 @@ LLVMEngine::compileGlobal(CEnv& cenv, const AType* type, const string& sym, CVal } CVal -LLVMEngine::getGlobal(CEnv& cenv, const string& sym, CVal val) +LLVMEngine::compileGlobalGet(CEnv& cenv, const string& sym, CVal val) { LLVMEngine* engine = reinterpret_cast(cenv.engine()); return engine->builder.CreateLoad(llVal(val), sym + "Ptr"); diff --git a/src/resp.hpp b/src/resp.hpp index 7c88be4..593205d 100644 --- a/src/resp.hpp +++ b/src/resp.hpp @@ -700,16 +700,19 @@ struct Engine { typedef const vector ValVec; - virtual CFunc startFunction( - CEnv& cenv, - const std::string& name, - const ATuple* args, - const AType* type) = 0; + virtual CFunc startFunction(CEnv& cenv, + const std::string& name, + const ATuple* args, + const AType* type) = 0; - virtual void pushFunctionArgs(CEnv& cenv, const ATuple* prot, const AType* type, CFunc f) = 0; + virtual void pushFunctionArgs(CEnv& cenv, + const ATuple* prot, + const AType* type, + CFunc f) = 0; + + virtual void finishFunction(CEnv& cenv, CFunc f, CVal ret) = 0; + virtual void eraseFunction(CEnv& cenv, CFunc f) = 0; - virtual void finishFunction(CEnv& cenv, CFunc f, CVal ret) = 0; - virtual void eraseFunction(CEnv& cenv, CFunc f) = 0; virtual CVal compileCons(CEnv& cenv, const AType* t, CVal rtti, ValVec& f) = 0; virtual CVal compileDot(CEnv& cenv, CVal tup, int32_t index) = 0; virtual CVal compileLiteral(CEnv& cenv, const AST* lit) = 0; @@ -719,8 +722,9 @@ struct Engine { virtual CVal compileIf(CEnv& cenv, const ATuple* aif) = 0; virtual CVal compileMatch(CEnv& cenv, const ATuple* match) = 0; virtual CVal compileGlobal(CEnv& cenv, const AType* t, const string& sym, CVal val) = 0; - virtual CVal getGlobal(CEnv& cenv, const string& sym, CVal val) = 0; - virtual void writeModule(CEnv& cenv, std::ostream& os) = 0; + virtual CVal compileGlobalGet(CEnv& cenv, const string& sym, CVal val) = 0; + + virtual void writeModule(CEnv& cenv, std::ostream& os) = 0; virtual const string call(CEnv& cenv, CFunc f, const AType* retT) = 0; }; -- cgit v1.2.1