aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-12-08 19:16:03 +0000
committerDavid Robillard <d@drobilla.net>2010-12-08 19:16:03 +0000
commite40b51ae710b1d0f4f4981069ec55d7aed61590a (patch)
tree7c67fd3270764386a3bbcd47db093aaf369c6685
parentd02fe43f0f6e50f8f22321aa0080283ee2ecc9fc (diff)
downloadresp-e40b51ae710b1d0f4f4981069ec55d7aed61590a.tar.gz
resp-e40b51ae710b1d0f4f4981069ec55d7aed61590a.tar.bz2
resp-e40b51ae710b1d0f4f4981069ec55d7aed61590a.zip
Consistent naming for Engine compile methods.
git-svn-id: http://svn.drobilla.net/resp/resp@314 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r--src/c.cpp4
-rw-r--r--src/compile.cpp2
-rw-r--r--src/llvm.cpp4
-rw-r--r--src/resp.hpp24
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<Value*, BasicBlock*> IfBranch;
typedef vector<IfBranch> 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<LLVMEngine*>(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<CVal> 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;
};