Skip to content

Commit

Permalink
Merge pull request #2224 from b-scholz/functors
Browse files Browse the repository at this point in the history
Fix#2223
  • Loading branch information
XiaowenHu96 authored Mar 17, 2022
2 parents 2ba5996 + 6eb3ad0 commit b5ba13b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/synthesiser/Synthesiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ void Synthesiser::emitCode(std::ostream& out, const Statement& stmt) {

auto args = op.getArguments();
if (op.isStateful()) {
out << name << "(&symTable, &recordTable";
out << "functors::" << name << "(&symTable, &recordTable";
for (auto& arg : args) {
out << ",";
dispatch(*arg, out);
Expand All @@ -2323,7 +2323,7 @@ void Synthesiser::emitCode(std::ostream& out, const Statement& stmt) {
if (op.getReturnType() == TypeAttribute::Symbol) {
out << "symTable.encode(";
}
out << name << "(";
out << "functors::" << name << "(";

for (std::size_t i = 0; i < args.size(); i++) {
if (i > 0) {
Expand Down Expand Up @@ -2524,7 +2524,7 @@ void Synthesiser::generateCode(std::ostream& sos, const std::string& id, bool& w
}
withSharedLibrary = true;
});
os << "extern \"C\" {\n";
os << "namespace functors {\n extern \"C\" {\n";
for (const auto& f : functors) {
// std::size_t arity = f.second.length() - 1;
const std::string& name = f.first;
Expand Down Expand Up @@ -2558,7 +2558,7 @@ void Synthesiser::generateCode(std::ostream& sos, const std::string& id, bool& w
join(map(argsTypes, cppTypeDecl), ","));
}
}
os << "}\n";
os << "}\n}\n";
os << "\n";
os << "namespace souffle {\n";
os << "static const RamDomain RAM_BIT_SHIFT_MASK = RAM_DOMAIN_SIZE - 1;\n";
Expand Down

0 comments on commit b5ba13b

Please sign in to comment.