Skip to content

Commit

Permalink
chore(context): remove unused constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Samy-33 committed Nov 23, 2024
1 parent 87843fc commit 878834b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 59 deletions.
1 change: 0 additions & 1 deletion compiler+runtime/include/cpp/jank/jit/processor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ namespace jank::jit

struct processor
{
processor(native_integer const optimization_level);
processor(util::cli::options const &opts);
~processor();

Expand Down
1 change: 0 additions & 1 deletion compiler+runtime/include/cpp/jank/runtime/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ namespace jank::runtime
{
context();
context(util::cli::options const &opts);
context(context const &);
context(context &&) = delete;
~context();

Expand Down
7 changes: 1 addition & 6 deletions compiler+runtime/src/cpp/jank/jit/processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,6 @@ namespace jank::jit
return output_path;
}

processor::processor(native_integer const optimization_level)
: optimization_level{ optimization_level }
{
}

processor::processor(util::cli::options const &opts)
: optimization_level{ opts.optimization_level }
{
Expand Down Expand Up @@ -250,7 +245,7 @@ namespace jank::jit
auto const &lib_name{ shared_lib_name(lib) };
for(auto const &lib_dir : library_dirs)
{
auto lib_abs_path{ fmt::format("{}/{}", lib_dir, lib_name) };
auto lib_abs_path{ fmt::format("{}/{}", lib_dir.string(), lib_name) };
if(boost::filesystem::exists(lib_abs_path.c_str()))
{
return lib_abs_path;
Expand Down
51 changes: 0 additions & 51 deletions compiler+runtime/src/cpp/jank/runtime/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,57 +68,6 @@ namespace jank::runtime
.expect_ok();
}

/* TODO: Remove this. */
context::context(context const &ctx)
: jit_prc{ ctx.jit_prc.optimization_level }
, module_dependencies{ ctx.module_dependencies }
, output_dir{ ctx.output_dir }
, module_loader{ *this, ctx.module_loader.paths }
{
{
auto ns_lock(namespaces.wlock());
for(auto const &ns : *ctx.namespaces.rlock())
{
ns_lock->insert({ ns.first, ns.second->clone(*this) });
}
*keywords.wlock() = *ctx.keywords.rlock();
}

auto &tbfs(thread_binding_frames[this]);
auto const &other_tbfs(thread_binding_frames[&ctx]);
for(auto const &v : other_tbfs)
{
thread_binding_frame frame{ obj::persistent_hash_map::empty() };
for(auto it(v.bindings->fresh_seq()); it != nullptr; it = runtime::next_in_place(it))
{
auto const entry(it->first());
auto const var(expect_object<var>(entry->data[0]));
auto const value(entry->data[1]);
auto const new_var(intern_var(var->n->name->name, var->name->name).expect_ok());
frame.bindings = frame.bindings->assoc(new_var, value);
}

/* We push to the back, since we're looping from the front of the other list. If we
* pushed to the front of this one, we'd reverse the order. */
tbfs.push_back(std::move(frame));
}

auto const core(intern_ns(make_box<obj::symbol>("clojure.core")));
current_ns_var = core->intern_var(make_box<obj::symbol>("clojure.core/*ns*"));

in_ns_var = intern_var(make_box<obj::symbol>("clojure.core/in-ns")).expect_ok();
compile_files_var
= intern_var(make_box<obj::symbol>("clojure.core/*compile-files*")).expect_ok();
assert_var = core->intern_var(make_box<obj::symbol>("clojure.core/*assert*"));

current_module_var
= make_box<runtime::var>(core, make_box<obj::symbol>("*current-module*"))->set_dynamic(true);
no_recur_var
= make_box<runtime::var>(core, make_box<obj::symbol>("*no-recur*"))->set_dynamic(true);
gensym_env_var
= make_box<runtime::var>(core, make_box<obj::symbol>("*gensym-env*"))->set_dynamic(true);
}

context::~context()
{
thread_binding_frames.erase(this);
Expand Down

0 comments on commit 878834b

Please sign in to comment.