summaryrefslogtreecommitdiff
path: root/src/reduce.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2016-02-19 16:12:41 +0100
committerAdrian Thurston <thurston@complang.org>2016-02-19 16:12:41 +0100
commit6dd6b970b79e89b165cfc86e30e127fecfe1212f (patch)
tree78c632f2d90eada3ab2dcf4499d6a0d1722fab8c /src/reduce.cc
parent78ab04bcdc09256e11b0723932eba3e8c1d5c247 (diff)
downloadcolm-6dd6b970b79e89b165cfc86e30e127fecfe1212f.tar.gz
host adapters now have unique names are are accessed with func pointers
This eliminates symbol collisions present when linking multiple colm programs into the same executable.
Diffstat (limited to 'src/reduce.cc')
-rw-r--r--src/reduce.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/reduce.cc b/src/reduce.cc
index bf842f76..5c7acd45 100644
--- a/src/reduce.cc
+++ b/src/reduce.cc
@@ -43,17 +43,17 @@
void Compiler::writeCommitStub()
{
*outStream <<
- "void commit_reduce_forward( program_t *prg, tree_t **root,\n"
+ "void " << objectName << "_commit_reduce_forward( program_t *prg, tree_t **root,\n"
" struct pda_run *pda_run, parse_tree_t *pt )\n"
"{\n"
" commit_clear_parse_tree( prg, root, pda_run, pt->child );\n"
"}\n"
"\n"
- "long commit_union_sz( int reducer ) { return 0; }\n"
- "void init_need() {}\n"
- "int reducer_need_tok( program_t *prg, "
+ "long " << objectName << "_commit_union_sz( int reducer ) { return 0; }\n"
+ "void " << objectName << "_init_need() {}\n"
+ "int " << objectName << "_reducer_need_tok( program_t *prg, "
"struct pda_run *pda_run, int id ) { return COLM_RN_BOTH; }\n"
- "int reducer_need_ign( program_t *prg, "
+ "int " << objectName << "_reducer_need_ign( program_t *prg, "
"struct pda_run *pda_run ) { return COLM_RN_BOTH; }\n"
"\n";
;
@@ -346,7 +346,7 @@ void Compiler::writeNeeds()
"\n";
*outStream <<
- "extern \"C\" void init_need()\n"
+ "extern \"C\" void " << objectName << "_init_need()\n"
"{\n";
for ( ReductionVect::Iter r = rootNamespace->reductions; r.lte(); r++ ) {
@@ -374,7 +374,7 @@ void Compiler::writeNeeds()
"}\n";
*outStream <<
- "extern \"C\" int reducer_need_tok( program_t *prg, "
+ "extern \"C\" int " << objectName << "_reducer_need_tok( program_t *prg, "
"struct pda_run *pda_run, int id )\n"
"{\n"
" if ( pda_run->reducer > 0 ) {\n"
@@ -386,7 +386,7 @@ void Compiler::writeNeeds()
" return COLM_RN_BOTH;\n"
"}\n"
"\n"
- "extern \"C\" int reducer_need_ign( program_t *prg, struct pda_run *pda_run )\n"
+ "extern \"C\" int " << objectName << "_reducer_need_ign( program_t *prg, struct pda_run *pda_run )\n"
"{\n"
// Using this requires finding a solution for backtracking push back.
//" if ( pda_run->reducer > 0 )\n"
@@ -453,14 +453,14 @@ void Compiler::writeCommit()
"\n";
*outStream <<
- "long commit_union_sz( int reducer )\n"
+ "extern \"C\" long " << objectName << "_commit_union_sz( int reducer )\n"
"{\n"
" return sizeof( commit_reduce_union );\n"
"}\n";
*outStream <<
"\n"
- "void commit_reduce_forward( program_t *prg, tree_t **root,\n"
+ "extern \"C\" void " << objectName << "_commit_reduce_forward( program_t *prg, tree_t **root,\n"
" struct pda_run *pda_run, parse_tree_t *pt )\n"
"{\n"
" switch ( pda_run->reducer ) {\n";