refactor(library/compiler): mk_unused_name ==> mk_compiler_unused_name
This commit is contained in:
parent
058520d6e4
commit
73eda00ba3
5 changed files with 5 additions and 5 deletions
|
|
@ -113,7 +113,7 @@ protected:
|
|||
aux = abstract_locals(aux, abst_locals);
|
||||
/* Create expr (rec_fn) for representing recursive calls. */
|
||||
expr aux_decl_type = ctx().infer(aux);
|
||||
name aux_decl_name = mk_unused_name(m_env, m_prefix, "_rec", m_idx);
|
||||
name aux_decl_name = mk_compiler_unused_name(m_env, m_prefix, "_rec", m_idx);
|
||||
expr rec_fn = mk_rec_fn_macro(aux_decl_name, aux_decl_type);
|
||||
/* Create new locals for aux.
|
||||
The operating abstract_locals creates a lambda-abstraction around aux if it uses
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class extract_values_fn : public compiler_step_visitor {
|
|||
auto it = m_cache.find(e);
|
||||
if (it != m_cache.end())
|
||||
return it->second;
|
||||
name aux = mk_unused_name(env(), m_prefix, "_val", m_idx);
|
||||
name aux = mk_compiler_unused_name(env(), m_prefix, "_val", m_idx);
|
||||
m_new_procs.push_back(procedure(aux, m_pos, e));
|
||||
expr r = mk_constant(aux);
|
||||
m_cache.insert(mk_pair(e, r));
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class lambda_lifting_fn : public compiler_step_visitor {
|
|||
|
||||
buffer<expr> locals;
|
||||
new_e = abstract_locals(new_e, locals);
|
||||
name aux_name = mk_unused_name(env(), m_prefix, "_lambda", m_idx);
|
||||
name aux_name = mk_compiler_unused_name(env(), m_prefix, "_lambda", m_idx);
|
||||
m_new_procs.emplace_back(aux_name, get_pos_info(e), new_e);
|
||||
return mk_rev_app(mk_constant(aux_name), locals);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ bool is_pack_unpack(environment const & env, expr const & e) {
|
|||
return is_ginductive_pack(env, n) || is_ginductive_unpack(env, n);
|
||||
}
|
||||
|
||||
name mk_unused_name(environment const & env, name const & prefix, char const * suffix, unsigned & idx) {
|
||||
name mk_compiler_unused_name(environment const & env, name const & prefix, char const * suffix, unsigned & idx) {
|
||||
while (true) {
|
||||
name curr(prefix, suffix);
|
||||
curr = curr.append_after(idx);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace lean {
|
|||
class type_context;
|
||||
/** \brief Create a new name of the form prefix.suffix_idx that is not the name of a declaration and/or VM function.
|
||||
It also updates the index idx. */
|
||||
name mk_unused_name(environment const & env, name const & prefix, char const * suffix, unsigned & idx);
|
||||
name mk_compiler_unused_name(environment const & env, name const & prefix, char const * suffix, unsigned & idx);
|
||||
|
||||
/** \brief Return true iff \c e is computationally irrelevant */
|
||||
bool is_comp_irrelevant(type_context & ctx, expr const & e);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue