From 16d423dab697b03ce0d93e48fa90c2d502af3137 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Wed, 26 Jun 2019 10:54:47 -0700 Subject: [PATCH] feat(frontends/lean): switch to `[extern]` implemented in Lean This commit also changes how we represent attribute parameters as Syntax objects. --- library/init/lean/attributes.lean | 15 + library/init/lean/compiler/exportattr.lean | 4 +- library/init/lean/compiler/initattr.lean | 13 +- src/frontends/lean/decl_attributes.cpp | 25 +- src/frontends/lean/decl_attributes.h | 2 + src/frontends/lean/decl_util.cpp | 2 +- src/library/compiler/extern_attribute.cpp | 238 +---- src/library/compiler/extern_attribute.h | 9 - src/library/compiler/ir.cpp | 5 +- src/stage0/init/lean/attributes.cpp | 845 +++++++++-------- src/stage0/init/lean/compiler/exportattr.cpp | 421 +++++---- src/stage0/init/lean/compiler/externattr.cpp | 912 +++++++------------ src/stage0/init/lean/compiler/initattr.cpp | 621 +++++++------ src/stage0/init/lean/compiler/ir/boxing.cpp | 1 - src/stage0/init/lean/compiler/ir/emitcpp.cpp | 5 - src/stage0/init/lean/syntax.cpp | 2 +- 16 files changed, 1446 insertions(+), 1674 deletions(-) diff --git a/library/init/lean/attributes.lean b/library/init/lean/attributes.lean index 5c8cd17003..48f8887e83 100644 --- a/library/init/lean/attributes.lean +++ b/library/init/lean/attributes.lean @@ -405,4 +405,19 @@ else end EnumAttributes +/- Helper function for converting a Syntax object representing attribute parameters into an identifier. + It returns `none` if the parameter is not a simple identifier. + + Remark: in the future, attributes should define their own parsers, and we should use `match_syntax` to + decode the Syntax object. -/ +def attrParamSyntaxToIdentifier (s : Syntax) : Option Name := +match s with +| Syntax.node k args _ := + if k == nullKind && args.size == 1 then match args.get 0 with + | Syntax.ident _ _ id _ _ := some id + | _ := none + else + none +| _ := none + end Lean diff --git a/library/init/lean/compiler/exportattr.lean b/library/init/lean/compiler/exportattr.lean index 2397a5fabe..ea6fda55c5 100644 --- a/library/init/lean/compiler/exportattr.lean +++ b/library/init/lean/compiler/exportattr.lean @@ -19,8 +19,8 @@ private def isValidCppName : Name → Bool def mkExportAttr : IO (ParametricAttribute Name) := registerParametricAttribute `export "name to be used by code generators" $ λ _ _ stx, - match stx with - | Syntax.ident _ _ exportName _ _ := + match attrParamSyntaxToIdentifier stx with + | some exportName := if isValidCppName exportName then Except.ok exportName else Except.error "invalid 'export' function name, is not a valid C++ identifier" | _ := Except.error "unexpected kind of argument" diff --git a/library/init/lean/compiler/initattr.lean b/library/init/lean/compiler/initattr.lean index 958725bd2b..f32601d51c 100644 --- a/library/init/lean/compiler/initattr.lean +++ b/library/init/lean/compiler/initattr.lean @@ -27,8 +27,8 @@ registerParametricAttribute `init "initialization procedure for global reference match env.find declName with | none := Except.error "unknown declaration" | some decl := - match stx with - | Syntax.ident _ _ initFnName _ _ := + match attrParamSyntaxToIdentifier stx with + | some initFnName := match env.find initFnName with | none := Except.error ("unknown initialization function '" ++ toString initFnName ++ "'") | some initDecl := @@ -37,10 +37,11 @@ registerParametricAttribute `init "initialization procedure for global reference | some initTypeArg := if decl.type == initTypeArg then Except.ok initFnName else Except.error ("initialization function '" ++ toString initFnName ++ "' type mismatch") - | Syntax.missing := - if isIOUnit decl.type then Except.ok Name.anonymous - else Except.error "initialization function must have type `IO Unit`" - | _ := Except.error "unexpected kind of argument" + | _ := match stx with + | Syntax.missing := + if isIOUnit decl.type then Except.ok Name.anonymous + else Except.error "initialization function must have type `IO Unit`" + | _ := Except.error "unexpected kind of argument" @[init mkInitAttr] constant initAttr : ParametricAttribute Name := default _ diff --git a/src/frontends/lean/decl_attributes.cpp b/src/frontends/lean/decl_attributes.cpp index c35002eb79..f0dae6f380 100644 --- a/src/frontends/lean/decl_attributes.cpp +++ b/src/frontends/lean/decl_attributes.cpp @@ -115,8 +115,6 @@ syntax decl_attributes::expr_to_syntax(expr const & e) { switch (new_args.size()) { case 0: return syntax(box(0)); - case 1: - return new_args[0]; default: return mk_syntax_list(new_args); } @@ -234,6 +232,29 @@ attr_data_ptr decl_attributes::get_attribute(environment const & env, name const return nullptr; } +bool decl_attributes::has_attribute(list const & entries, name const & attr_name) const { + for (auto entry : entries) { + if (entry.m_attr == attr_name) + return true; + } + return false; +} + +bool decl_attributes::has_attribute(environment const & env, name const & attr_name) const { + if (is_attribute(env, attr_name)) { + auto const & attr = ::lean::get_attribute(env, attr_name); + for (entry const & e : m_entries) { + if (e.m_attr == &attr) + return true; + } + return false; + } else if (is_new_attribute(attr_name)) { + return has_attribute(m_after_tc_entries, attr_name) || has_attribute(m_after_comp_entries, attr_name); + } else { + throw exception(sstream() << "unknown attribute [" << attr_name << "]"); + } +} + environment decl_attributes::apply_new_entries(environment env, list const & es, name const & d) const { buffer new_entries; to_buffer(es, new_entries); diff --git a/src/frontends/lean/decl_attributes.h b/src/frontends/lean/decl_attributes.h index a2aee1d828..c7b1dbb89f 100644 --- a/src/frontends/lean/decl_attributes.h +++ b/src/frontends/lean/decl_attributes.h @@ -36,10 +36,12 @@ private: expr parse_attr_arg(parser & p, name const & attr_id); syntax expr_to_syntax(expr const & e); environment apply_new_entries(environment env, list const & es, name const & d) const; + bool has_attribute(list const & entries, name const & attr_name) const; public: decl_attributes(bool persistent = true): m_persistent(persistent) {} void set_attribute(environment const & env, name const & attr_name, attr_data_ptr data = get_default_attr_data()); attr_data_ptr get_attribute(environment const & env, name const & attr_name) const; + bool has_attribute(environment const & env, name const & attr_name) const; /* attributes: zero-or-more [ ... ] */ void parse(parser & p); /* Parse attributes after `@[` ... ] */ diff --git a/src/frontends/lean/decl_util.cpp b/src/frontends/lean/decl_util.cpp index a265c4e901..4d63a2f2af 100644 --- a/src/frontends/lean/decl_util.cpp +++ b/src/frontends/lean/decl_util.cpp @@ -391,7 +391,7 @@ declaration_info_scope::declaration_info_scope(parser const & p, decl_cmd_kind k declaration_info_scope(get_namespace(p.env()), kind, modifiers, is_extern) {} declaration_info_scope::declaration_info_scope(parser const & p, decl_cmd_kind kind, cmd_meta const & meta): - declaration_info_scope(p, kind, meta.m_modifiers, static_cast(meta.m_attrs.get_attribute(p.env(), "extern"))) {} + declaration_info_scope(p, kind, meta.m_modifiers, meta.m_attrs.has_attribute(p.env(), "extern")) {} declaration_info_scope::~declaration_info_scope() { get_definition_info() = definition_info(); diff --git a/src/library/compiler/extern_attribute.cpp b/src/library/compiler/extern_attribute.cpp index eaeacc9e5a..25db2621d9 100644 --- a/src/library/compiler/extern_attribute.cpp +++ b/src/library/compiler/extern_attribute.cpp @@ -18,216 +18,20 @@ Authors: Leonardo de Moura #include "library/compiler/extern_attribute.h" namespace lean { -object* mk_adhoc_ext_entry_core(object*); -object* mk_inline_ext_entry_core(object*, object*); -object* mk_std_ext_entry_core(object*, object*); -object* mk_foreign_ext_entry_core(object*, object*); -object* mk_extern_call_core(object*, object*, object*); -object* mk_extern_attr_data_core(object*, object*); -object* mk_extern_call_core(object*, object*, object*); -object* get_extern_entry_for_core(object*, object*); - -typedef object_ref extern_entry; -typedef list_ref extern_entries; - -extern_entry mk_adhoc_ext_entry(name const & backend) { - inc(backend.raw()); - return extern_entry(mk_adhoc_ext_entry_core(backend.raw())); -} -extern_entry mk_inline_ext_entry(name const & backend, char const * pattern) { - inc(backend.raw()); - return extern_entry(mk_inline_ext_entry_core(backend.raw(), mk_string(pattern))); -} -extern_entry mk_std_ext_entry(name const & backend, char const * fn) { - inc(backend.raw()); - return extern_entry(mk_std_ext_entry_core(backend.raw(), mk_string(fn))); -} -extern_entry mk_foreign_ext_entry(name const & backend, char const * fn) { - inc(backend.raw()); - return extern_entry(mk_foreign_ext_entry_core(backend.raw(), mk_string(fn))); -} -extern_attr_data_value mk_extern_attr_data_value(optional const & arity, buffer const & es) { - object * _arity; - if (arity) { - _arity = alloc_cnstr(1, 1, 0); cnstr_set(_arity, 0, mk_nat_obj(*arity)); - } else { - _arity = box(0); - } - return extern_attr_data_value(mk_extern_attr_data_core(_arity, extern_entries(es).steal())); -} - -struct extern_attr_data : public attr_data { - extern_attr_data_value m_value; - extern_attr_data(extern_attr_data_value const & ref): m_value(ref) {} - extern_attr_data() {} - - virtual unsigned hash() const override { return 0; } - void write(serializer & s) const { s.write_object(m_value.raw()); } - void read(deserializer & d) { m_value = extern_attr_data_value(d.read_object(), true); } - - /* - Examples: - - - `@[extern]` - - `@[extern "level_hash"]` - - `@[extern cpp "lean::string_size" llvm "lean_str_size"]` - - `@[extern cpp inline "#1 + #2"]` - - `@[extern cpp "foo" llvm adhoc]` - - `@[extern 2 cpp "io_prim_println"] - */ - virtual void parse(expr const & e) override { - buffer args; get_app_args(e, args); - auto it = args.begin(); - buffer entries; - optional arity; - if (it == args.end()) { - // - `@[extern]` - entries.push_back(mk_adhoc_ext_entry("all")); - m_value = mk_extern_attr_data_value(arity, entries); - return; - } - expr arg = unwrap_pos(*it); - if (is_nat_lit(arg)) { - arity = lit_value(arg).get_nat().get_small_value(); - it++; - } - if (it != args.end() && is_string_lit(arg = unwrap_pos(*it))) { - // - `@[extern "level_hash"]` - // - `@[extern 2 "level_hash"]` - std::string lit = lit_value(arg).get_string().to_std_string(); - entries.push_back(mk_std_ext_entry("all", lit.c_str())); - m_value = mk_extern_attr_data_value(arity, entries); - return; - } - while (it != args.end()) { - arg = extract_mdata(*it); - if (!is_const(arg)) - throw parser_error("constant expected", get_pos_info_provider()->get_pos_info_or_some(*it)); - name backend = const_name(arg); - it++; - if (it != args.end() && is_const(extract_mdata(*it), "inline")) { - it++; - if (it == args.end() || !is_string_lit(arg = extract_mdata(*it))) - throw parser_error("string literal expected", get_pos_info_provider()->get_pos_info_or_some(*it)); - std::string fn = lit_value(arg).get_string().to_std_string(); - entries.push_back(mk_inline_ext_entry(backend, fn.c_str())); - } else if (it != args.end() && is_const(extract_mdata(*it), "adhoc")) { - entries.push_back(mk_adhoc_ext_entry(backend)); - } else { - if (it == args.end() || !is_string_lit(arg = extract_mdata(*it))) - throw parser_error("string literal expected", get_pos_info_provider()->get_pos_info_or_some(*it)); - std::string fn = lit_value(arg).get_string().to_std_string(); - entries.push_back(mk_std_ext_entry(backend, fn.c_str())); - } - it++; - } - m_value = mk_extern_attr_data_value(arity, entries); - } - virtual void print(std::ostream & out) override { - out << "<>"; - } -}; - -typedef typed_attribute extern_attr; - -extern_attr const & get_extern_attr() { - return static_cast(get_system_attribute("extern")); -} +object* get_extern_attr_data_core(object* env, object* n); optional get_extern_attr_data(environment const & env, name const & fn) { - if (std::shared_ptr const & data = get_extern_attr().get(env, fn)) { - extern_attr_data_value const & v = data->m_value; - return optional(v); - } else { - return optional(); - } -} - -extern "C" object * lean_get_extern_attr_data(b_obj_arg env, b_obj_arg fn) { - return to_object(get_extern_attr_data(environment(env, true), name(fn, true))); -} - -optional get_extern_name_for(environment const & env, name const & backend, name const & fn) { - if (std::shared_ptr const & data = get_extern_attr().get(env, fn)) { - extern_attr_data_value const & v = data->m_value; - inc(v.raw()); inc(backend.raw()); - /* get_extern_entry_for_core : extern_attr_data -> name -> option extern_entry */ - object * opt_entry = get_extern_entry_for_core(v.raw(), backend.raw()); - if (is_scalar(opt_entry)) return optional(); - object * entry = cnstr_get(opt_entry, 0); - /* - inductive extern_entry - | adhoc (backend : name) - | inline (backend : name) (pattern : string) - | standard (backend : name) (fn : string) - | foreign (backend : name) (fn : string) - */ - if (cnstr_tag(entry) == 0 || cnstr_tag(entry) == 1) return optional(); - object * fname = cnstr_get(entry, 1); - std::string r = string_to_std(fname); - dec(opt_entry); - return optional(r); - } else { - return optional(); - } -} - -static name * g_all = nullptr; - -bool is_extern_c(environment const & env, name const & fn) { - if (std::shared_ptr const & data = get_extern_attr().get(env, fn)) { - extern_attr_data_value const & v = data->m_value; - inc(v.raw()); inc(g_all->raw()); - /* get_extern_entry_for_core : extern_attr_data -> name -> option extern_entry */ - object * opt_entry = get_extern_entry_for_core(v.raw(), g_all->raw()); - if (is_scalar(opt_entry)) return false; - object * entry = cnstr_get(opt_entry, 0); - /* - inductive extern_entry - | adhoc (backend : name) - | inline (backend : name) (pattern : string) - | standard (backend : name) (fn : string) - | foreign (backend : name) (fn : string) - */ - bool r = (cnstr_tag(entry) == 2); - dec(opt_entry); - return r; - } else { - return false; - } -} - -bool emit_extern_call_core(std::ostream & out, environment const & env, name const & backend, name const & fn, string_refs const & attrs) { - if (std::shared_ptr const & data = get_extern_attr().get(env, fn)) { - extern_attr_data_value const & v = data->m_value; - inc(v.raw()); inc(backend.raw()); inc(attrs.raw()); - object * r = mk_extern_call_core(v.raw(), backend.raw(), attrs.raw()); - if (is_scalar(r)) return false; - object * s = cnstr_get(r, 0); - out << string_cstr(s); - dec(r); - return true; - } else { - return false; - } -} - -void emit_extern_call(std::ostream & out, environment const & env, name const & backend, name const & fn, string_refs const & attrs) { - emit_extern_call_core(out, env, backend, fn, attrs); -} - -static inline bool is_extern_constant_core(environment const & env, name const & c) { - return static_cast(get_extern_attr().get(env, c)); + return to_optional(get_extern_attr_data_core(env.to_obj_arg(), fn.to_obj_arg())); } bool is_extern_constant(environment const & env, name const & c) { - return is_extern_constant_core(env, c); + return static_cast(get_extern_attr_data(env, c)); } static optional get_given_arity(environment const & env, name const & c) { - lean_assert(is_extern_constant_core(env, c)); - extern_attr_data_value v = get_extern_attr().get(env, c)->m_value; - object * arity = cnstr_get(v.raw(), 0); + optional v = get_extern_attr_data(env, c); + lean_assert(v); + object * arity = cnstr_get(v->raw(), 0); if (is_scalar(arity)) return optional(); // none // arity is (some v) arity = cnstr_get(arity, 0); @@ -236,9 +40,10 @@ static optional get_given_arity(environment const & env, name const & } optional get_extern_constant_arity(environment const & env, name const & c) { - if (is_extern_constant_core(env, c)) { - if (optional given_arity = get_given_arity(env, c)) + if (is_extern_constant(env, c)) { + if (optional given_arity = get_given_arity(env, c)) { return given_arity; + } /* Infer arity from type */ return optional(get_arity(env.get(c).get_type())); } @@ -246,7 +51,7 @@ optional get_extern_constant_arity(environment const & env, name const } bool get_extern_borrowed_info(environment const & env, name const & c, buffer & borrowed_args, bool & borrowed_res) { - if (is_extern_constant_core(env, c)) { + if (is_extern_constant(env, c)) { /* Extract borrowed info from type */ expr type = env.get(c).get_type(); unsigned arity = 0; @@ -273,7 +78,7 @@ bool get_extern_borrowed_info(environment const & env, name const & c, buffer get_extern_constant_ll_type(environment const & env, name const & c) { - if (is_extern_constant_core(env, c)) { + if (is_extern_constant(env, c)) { unsigned arity = 0; expr type = env.get(c).get_type(); type_checker::state st(env); @@ -317,29 +122,8 @@ optional get_extern_constant_ll_type(environment const & env, name const & } void initialize_extern_attribute() { - g_all = new name("all"); - register_system_attribute(extern_attr("extern", "builtin and foreign functions", - [](environment const & env, io_state const &, name const & n, unsigned, bool persistent) { - if (!persistent) throw exception("invalid [extern] attribute, it must be persistent"); - if (optional cinfo = env.find(n)) { - if (cinfo->is_constructor()) { - /* Hack: we can mark constructors as `extern`. - The compiler is not invoked for constructors. So, we - register them in the IR here. */ - return ir::add_extern(env, n); - } - if (is_projection(env, n)) { - /* Hack: we can also mark automatically generated projections as `extern`. - After they have been generated by the structure compiler. - So, we register them in the IR here. */ - return ir::add_extern(env, n); - } - } - return env; - })); } void finalize_extern_attribute() { - delete g_all; } } diff --git a/src/library/compiler/extern_attribute.h b/src/library/compiler/extern_attribute.h index aace9deafd..e5ecbc0f7d 100644 --- a/src/library/compiler/extern_attribute.h +++ b/src/library/compiler/extern_attribute.h @@ -17,15 +17,6 @@ optional get_extern_attr_data(environment const & env, n borrowed_res which arguments/results are marked as borrowed. */ bool get_extern_borrowed_info(environment const & env, name const & c, buffer & borrowed_args, bool & borrowed_res); -bool emit_extern_call_core(std::ostream & out, environment const & env, name const & backend, name const & fn, string_refs const & attrs); -void emit_extern_call(std::ostream & out, environment const & env, name const & backend, name const & fn, string_refs const & attrs); - -optional get_extern_name_for(environment const & env, name const & backend, name const & fn); - -/* We say a Lean function marked as `[extern ""]` is for all backends, and it is implemented using `extern "C"`. - Thus, there is no name mangling. */ -bool is_extern_c(environment const & env, name const & fn); - void initialize_extern_attribute(); void finalize_extern_attribute(); } diff --git a/src/library/compiler/ir.cpp b/src/library/compiler/ir.cpp index ca0614f6fb..06c3223404 100644 --- a/src/library/compiler/ir.cpp +++ b/src/library/compiler/ir.cpp @@ -539,9 +539,10 @@ environment add_extern(environment const & env, name const & fn) { extern "C" object* lean_add_extern(object * env, object * fn) { try { - environment env = add_extern(environment(env), name(fn)); - return mk_except_ok(env); + environment new_env = add_extern(environment(env), name(fn)); + return mk_except_ok(new_env); } catch (exception & ex) { + throw; return mk_except_error_string(ex.what()); } } diff --git a/src/stage0/init/lean/attributes.cpp b/src/stage0/init/lean/attributes.cpp index 9940c7987f..f57bf6975f 100644 --- a/src/stage0/init/lean/attributes.cpp +++ b/src/stage0/init/lean/attributes.cpp @@ -21,6 +21,7 @@ obj* l_RBNode_fold___main___at_Lean_registerEnumAttributes___spec__1(obj*); obj* l_Lean_attributeArrayRef; obj* l_List_map___main___at_Lean_registerEnumAttributes___spec__7___rarg___lambda__1(obj*, obj*, obj*, obj*, obj*, obj*, obj*, uint8, obj*); obj* l_Lean_ParametricAttribute_getParam(obj*); +obj* l_Lean_attrParamSyntaxToIdentifier(obj*); extern "C" uint8 lean_name_dec_eq(obj*, obj*); obj* l_Lean_AttributeImpl_inhabited___lambda__4___boxed(obj*, obj*, obj*); obj* l_Lean_AttributeImpl_inhabited___lambda__2___closed__1; @@ -32,6 +33,7 @@ namespace lean { obj* nat_sub(obj*, obj*); } obj* l_Lean_mkAttributeArrayRef(obj*); +extern obj* l_Lean_stxInh; obj* l_RBNode_find___main___at_Lean_ParametricAttribute_getParam___spec__1___rarg(obj*, obj*); obj* l_Array_binSearchAux___main___at_Lean_EnumAttributes_getValue___spec__2(obj*); obj* l_Lean_registerTagAttribute___lambda__7(obj*, obj*, obj*, uint8, obj*); @@ -43,7 +45,7 @@ obj* l_Array_mkArray(obj*, obj*, obj*); obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_registerEnumAttributes___spec__3___rarg___boxed(obj*, obj*, obj*, obj*, obj*, obj*); obj* l_List_foldl___main___at_Lean_Environment_toValidNamespace___spec__1___boxed(obj*, obj*, obj*, obj*); obj* l_HashMapImp_expand___at_Lean_registerAttribute___spec__4(obj*, obj*); -obj* l_Lean_registerParametricAttribute___rarg(obj*, obj*, obj*, obj*, obj*); +obj* l_Lean_registerParametricAttribute___rarg(obj*, obj*, obj*, obj*, obj*, obj*); obj* l_Lean_registerEnumAttributes___rarg(obj*, obj*, obj*, obj*, obj*); obj* l_Lean_AttributeImpl_inhabited___lambda__3___boxed(obj*, obj*, obj*, obj*); obj* l_Array_miterateAux___main___at_Lean_getAttributeNames___spec__2(obj*, obj*, obj*, obj*); @@ -91,7 +93,7 @@ obj* l_Lean_SimplePersistentEnvExtension_getState___rarg(obj*, obj*); obj* l_Lean_scopeManagerExt; obj* l_AssocList_mfoldl___main___at_Lean_registerAttribute___spec__6(obj*, obj*); extern obj* l_Lean_Inhabited; -obj* l_Lean_registerParametricAttribute___rarg___lambda__4(obj*, obj*, obj*, obj*, obj*, obj*, uint8, obj*); +obj* l_Lean_registerParametricAttribute___rarg___lambda__4(obj*, obj*, obj*, obj*, obj*, obj*, obj*, uint8, obj*); obj* l_Array_uset(obj*, obj*, usize, obj*, obj*); obj* l_Lean_ScopeManagerState_Inhabited; obj* l_List_redLength___main___rarg(obj*); @@ -208,6 +210,7 @@ obj* add_attribute_core(obj*, obj*, obj*, obj*, uint8, obj*); } obj* l_Lean_PersistentEnvExtension_getModuleEntries___rarg(obj*, obj*, obj*); obj* l_Lean_registerTagAttribute___lambda__5___closed__5; +extern obj* l_Lean_nullKind; namespace lean { uint8 is_namespace_core(obj*, obj*); } @@ -244,7 +247,7 @@ uint8 l_Lean_TagAttribute_hasTag(obj*, obj*, obj*); obj* l_Lean_scopeManagerExt___elambda__2___boxed(obj*); uint8 l_Array_binSearchAux___main___at_Lean_TagAttribute_hasTag___spec__1(obj*, obj*, obj*, obj*); obj* l_Lean_registerTagAttribute___lambda__5___closed__2; -obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*); +obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*); obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_registerParametricAttribute___spec__4___rarg___boxed(obj*, obj*, obj*, obj*, obj*, obj*); obj* l_Array_miterateAux___main___at_Lean_Environment_activateScopedAttributes___spec__1(obj*, obj*, obj*, obj*, obj*, obj*); obj* l_AssocList_find___main___at_Lean_getAttributeImpl___spec__2(obj*, obj*); @@ -288,6 +291,7 @@ obj* l_Array_miterateAux___main___at_Lean_Environment_pushScope___spec__1___boxe obj* l_List_map___main___at_Lean_registerEnumAttributes___spec__7___rarg___lambda__1___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*); obj* l_Array_binSearchAux___main___at_Lean_EnumAttributes_getValue___spec__2___rarg(obj*, obj*, obj*, obj*, obj*); obj* l_Lean_registerTagAttribute___lambda__6(obj*, obj*, obj*, obj*, obj*); +obj* l_Lean_attrParamSyntaxToIdentifier___boxed(obj*); obj* l_Lean_PersistentEnvExtension_inhabited___rarg___lambda__2___boxed(obj*); obj* l_Array_size(obj*, obj*); obj* l_Lean_registerEnumAttributes___rarg___lambda__1(obj*, obj*); @@ -6623,233 +6627,264 @@ lean::cnstr_set_scalar(x_8, sizeof(void*)*2, x_6); return x_8; } } -obj* l_Lean_registerParametricAttribute___rarg___lambda__4(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6, uint8 x_7, obj* x_8) { +obj* l_Lean_registerParametricAttribute___rarg___lambda__4(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6, obj* x_7, uint8 x_8, obj* x_9) { _start: { -if (x_7 == 0) +if (x_8 == 0) { -uint8 x_9; +uint8 x_10; +lean::dec(x_7); lean::dec(x_6); lean::dec(x_5); lean::dec(x_4); lean::dec(x_3); lean::dec(x_2); -x_9 = !lean::is_exclusive(x_8); -if (x_9 == 0) +x_10 = !lean::is_exclusive(x_9); +if (x_10 == 0) { -obj* x_10; obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; -x_10 = lean::cnstr_get(x_8, 0); -lean::dec(x_10); -x_11 = l_Lean_Name_toString___closed__1; -x_12 = l_Lean_Name_toStringWithSep___main(x_11, x_1); -x_13 = l_Lean_registerTagAttribute___lambda__5___closed__1; -x_14 = lean::string_append(x_13, x_12); -lean::dec(x_12); -x_15 = l_Lean_registerTagAttribute___lambda__5___closed__3; -x_16 = lean::string_append(x_14, x_15); -lean::cnstr_set_tag(x_8, 1); -lean::cnstr_set(x_8, 0, x_16); -return x_8; +obj* x_11; obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; +x_11 = lean::cnstr_get(x_9, 0); +lean::dec(x_11); +x_12 = l_Lean_Name_toString___closed__1; +x_13 = l_Lean_Name_toStringWithSep___main(x_12, x_1); +x_14 = l_Lean_registerTagAttribute___lambda__5___closed__1; +x_15 = lean::string_append(x_14, x_13); +lean::dec(x_13); +x_16 = l_Lean_registerTagAttribute___lambda__5___closed__3; +x_17 = lean::string_append(x_15, x_16); +lean::cnstr_set_tag(x_9, 1); +lean::cnstr_set(x_9, 0, x_17); +return x_9; } else { -obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; -x_17 = lean::cnstr_get(x_8, 1); -lean::inc(x_17); -lean::dec(x_8); -x_18 = l_Lean_Name_toString___closed__1; -x_19 = l_Lean_Name_toStringWithSep___main(x_18, x_1); -x_20 = l_Lean_registerTagAttribute___lambda__5___closed__1; -x_21 = lean::string_append(x_20, x_19); -lean::dec(x_19); -x_22 = l_Lean_registerTagAttribute___lambda__5___closed__3; -x_23 = lean::string_append(x_21, x_22); -x_24 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_24, 0, x_23); -lean::cnstr_set(x_24, 1, x_17); -return x_24; +obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; obj* x_23; obj* x_24; obj* x_25; +x_18 = lean::cnstr_get(x_9, 1); +lean::inc(x_18); +lean::dec(x_9); +x_19 = l_Lean_Name_toString___closed__1; +x_20 = l_Lean_Name_toStringWithSep___main(x_19, x_1); +x_21 = l_Lean_registerTagAttribute___lambda__5___closed__1; +x_22 = lean::string_append(x_21, x_20); +lean::dec(x_20); +x_23 = l_Lean_registerTagAttribute___lambda__5___closed__3; +x_24 = lean::string_append(x_22, x_23); +x_25 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_25, 0, x_24); +lean::cnstr_set(x_25, 1, x_18); +return x_25; } } else { -uint8 x_25; -x_25 = !lean::is_exclusive(x_8); -if (x_25 == 0) +uint8 x_26; +x_26 = !lean::is_exclusive(x_9); +if (x_26 == 0) { -obj* x_26; obj* x_27; -x_26 = lean::cnstr_get(x_8, 0); -lean::dec(x_26); -x_27 = l_Lean_Environment_getModuleIdxFor(x_4, x_5); -if (lean::obj_tag(x_27) == 0) -{ -obj* x_28; -lean::inc(x_5); -x_28 = lean::apply_3(x_2, x_4, x_5, x_6); +obj* x_27; obj* x_28; +x_27 = lean::cnstr_get(x_9, 0); +lean::dec(x_27); +x_28 = l_Lean_Environment_getModuleIdxFor(x_5, x_6); if (lean::obj_tag(x_28) == 0) { -obj* x_29; obj* x_30; obj* x_31; obj* x_32; obj* x_33; obj* x_34; obj* x_35; obj* x_36; -lean::dec(x_5); -lean::dec(x_3); -x_29 = lean::cnstr_get(x_28, 0); -lean::inc(x_29); -lean::dec(x_28); -x_30 = l_Lean_Name_toString___closed__1; -x_31 = l_Lean_Name_toStringWithSep___main(x_30, x_1); -x_32 = l_Lean_registerTagAttribute___lambda__5___closed__1; -x_33 = lean::string_append(x_32, x_31); -lean::dec(x_31); -x_34 = l_Lean_registerTagAttribute___lambda__5___closed__4; -x_35 = lean::string_append(x_33, x_34); -x_36 = lean::string_append(x_35, x_29); -lean::dec(x_29); -lean::cnstr_set_tag(x_8, 1); -lean::cnstr_set(x_8, 0, x_36); -return x_8; -} -else -{ -obj* x_37; uint8 x_38; -lean::dec(x_1); -x_37 = lean::cnstr_get(x_28, 0); -lean::inc(x_37); -lean::dec(x_28); -x_38 = !lean::is_exclusive(x_37); -if (x_38 == 0) -{ -obj* x_39; obj* x_40; obj* x_41; -x_39 = lean::cnstr_get(x_37, 0); -x_40 = lean::cnstr_get(x_37, 1); -lean::cnstr_set(x_37, 1, x_39); -lean::cnstr_set(x_37, 0, x_5); -x_41 = l_Lean_PersistentEnvExtension_addEntry___rarg(x_3, x_40, x_37); -lean::cnstr_set(x_8, 0, x_41); -return x_8; -} -else -{ -obj* x_42; obj* x_43; obj* x_44; obj* x_45; -x_42 = lean::cnstr_get(x_37, 0); -x_43 = lean::cnstr_get(x_37, 1); -lean::inc(x_43); -lean::inc(x_42); -lean::dec(x_37); -x_44 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_44, 0, x_5); -lean::cnstr_set(x_44, 1, x_42); -x_45 = l_Lean_PersistentEnvExtension_addEntry___rarg(x_3, x_43, x_44); -lean::cnstr_set(x_8, 0, x_45); -return x_8; -} -} -} -else -{ -obj* x_46; obj* x_47; obj* x_48; obj* x_49; obj* x_50; obj* x_51; -lean::dec(x_27); -lean::dec(x_6); -lean::dec(x_5); -lean::dec(x_4); -lean::dec(x_3); -lean::dec(x_2); -x_46 = l_Lean_Name_toString___closed__1; -x_47 = l_Lean_Name_toStringWithSep___main(x_46, x_1); -x_48 = l_Lean_registerTagAttribute___lambda__5___closed__1; -x_49 = lean::string_append(x_48, x_47); -lean::dec(x_47); -x_50 = l_Lean_registerTagAttribute___lambda__5___closed__5; -x_51 = lean::string_append(x_49, x_50); -lean::cnstr_set_tag(x_8, 1); -lean::cnstr_set(x_8, 0, x_51); -return x_8; -} -} -else -{ -obj* x_52; obj* x_53; -x_52 = lean::cnstr_get(x_8, 1); -lean::inc(x_52); -lean::dec(x_8); -x_53 = l_Lean_Environment_getModuleIdxFor(x_4, x_5); -if (lean::obj_tag(x_53) == 0) -{ -obj* x_54; +obj* x_29; +lean::inc(x_6); lean::inc(x_5); -x_54 = lean::apply_3(x_2, x_4, x_5, x_6); -if (lean::obj_tag(x_54) == 0) +x_29 = lean::apply_3(x_2, x_5, x_6, x_7); +if (lean::obj_tag(x_29) == 0) { -obj* x_55; obj* x_56; obj* x_57; obj* x_58; obj* x_59; obj* x_60; obj* x_61; obj* x_62; obj* x_63; +obj* x_30; obj* x_31; obj* x_32; obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; +lean::dec(x_6); lean::dec(x_5); +lean::dec(x_4); lean::dec(x_3); -x_55 = lean::cnstr_get(x_54, 0); -lean::inc(x_55); -lean::dec(x_54); -x_56 = l_Lean_Name_toString___closed__1; -x_57 = l_Lean_Name_toStringWithSep___main(x_56, x_1); -x_58 = l_Lean_registerTagAttribute___lambda__5___closed__1; -x_59 = lean::string_append(x_58, x_57); -lean::dec(x_57); -x_60 = l_Lean_registerTagAttribute___lambda__5___closed__4; -x_61 = lean::string_append(x_59, x_60); -x_62 = lean::string_append(x_61, x_55); -lean::dec(x_55); -x_63 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_63, 0, x_62); -lean::cnstr_set(x_63, 1, x_52); -return x_63; +x_30 = lean::cnstr_get(x_29, 0); +lean::inc(x_30); +lean::dec(x_29); +x_31 = l_Lean_Name_toString___closed__1; +x_32 = l_Lean_Name_toStringWithSep___main(x_31, x_1); +x_33 = l_Lean_registerTagAttribute___lambda__5___closed__1; +x_34 = lean::string_append(x_33, x_32); +lean::dec(x_32); +x_35 = l_Lean_registerTagAttribute___lambda__5___closed__4; +x_36 = lean::string_append(x_34, x_35); +x_37 = lean::string_append(x_36, x_30); +lean::dec(x_30); +lean::cnstr_set_tag(x_9, 1); +lean::cnstr_set(x_9, 0, x_37); +return x_9; } else { -obj* x_64; obj* x_65; obj* x_66; obj* x_67; obj* x_68; obj* x_69; obj* x_70; +obj* x_38; obj* x_39; obj* x_40; obj* x_41; +x_38 = lean::cnstr_get(x_29, 0); +lean::inc(x_38); +lean::dec(x_29); +lean::inc(x_38); +lean::inc(x_6); +x_39 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_39, 0, x_6); +lean::cnstr_set(x_39, 1, x_38); +x_40 = l_Lean_PersistentEnvExtension_addEntry___rarg(x_3, x_5, x_39); +x_41 = lean::apply_3(x_4, x_40, x_6, x_38); +if (lean::obj_tag(x_41) == 0) +{ +obj* x_42; obj* x_43; obj* x_44; obj* x_45; obj* x_46; obj* x_47; obj* x_48; obj* x_49; +x_42 = lean::cnstr_get(x_41, 0); +lean::inc(x_42); +lean::dec(x_41); +x_43 = l_Lean_Name_toString___closed__1; +x_44 = l_Lean_Name_toStringWithSep___main(x_43, x_1); +x_45 = l_Lean_registerTagAttribute___lambda__5___closed__1; +x_46 = lean::string_append(x_45, x_44); +lean::dec(x_44); +x_47 = l_Lean_registerTagAttribute___lambda__5___closed__4; +x_48 = lean::string_append(x_46, x_47); +x_49 = lean::string_append(x_48, x_42); +lean::dec(x_42); +lean::cnstr_set_tag(x_9, 1); +lean::cnstr_set(x_9, 0, x_49); +return x_9; +} +else +{ +obj* x_50; lean::dec(x_1); -x_64 = lean::cnstr_get(x_54, 0); -lean::inc(x_64); -lean::dec(x_54); -x_65 = lean::cnstr_get(x_64, 0); -lean::inc(x_65); -x_66 = lean::cnstr_get(x_64, 1); -lean::inc(x_66); -if (lean::is_exclusive(x_64)) { - lean::cnstr_release(x_64, 0); - lean::cnstr_release(x_64, 1); - x_67 = x_64; -} else { - lean::dec_ref(x_64); - x_67 = lean::box(0); +x_50 = lean::cnstr_get(x_41, 0); +lean::inc(x_50); +lean::dec(x_41); +lean::cnstr_set(x_9, 0, x_50); +return x_9; } -if (lean::is_scalar(x_67)) { - x_68 = lean::alloc_cnstr(0, 2, 0); -} else { - x_68 = x_67; -} -lean::cnstr_set(x_68, 0, x_5); -lean::cnstr_set(x_68, 1, x_65); -x_69 = l_Lean_PersistentEnvExtension_addEntry___rarg(x_3, x_66, x_68); -x_70 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_70, 0, x_69); -lean::cnstr_set(x_70, 1, x_52); -return x_70; } } else { -obj* x_71; obj* x_72; obj* x_73; obj* x_74; obj* x_75; obj* x_76; obj* x_77; -lean::dec(x_53); +obj* x_51; obj* x_52; obj* x_53; obj* x_54; obj* x_55; obj* x_56; +lean::dec(x_28); +lean::dec(x_7); lean::dec(x_6); lean::dec(x_5); lean::dec(x_4); lean::dec(x_3); lean::dec(x_2); -x_71 = l_Lean_Name_toString___closed__1; -x_72 = l_Lean_Name_toStringWithSep___main(x_71, x_1); -x_73 = l_Lean_registerTagAttribute___lambda__5___closed__1; -x_74 = lean::string_append(x_73, x_72); +x_51 = l_Lean_Name_toString___closed__1; +x_52 = l_Lean_Name_toStringWithSep___main(x_51, x_1); +x_53 = l_Lean_registerTagAttribute___lambda__5___closed__1; +x_54 = lean::string_append(x_53, x_52); +lean::dec(x_52); +x_55 = l_Lean_registerTagAttribute___lambda__5___closed__5; +x_56 = lean::string_append(x_54, x_55); +lean::cnstr_set_tag(x_9, 1); +lean::cnstr_set(x_9, 0, x_56); +return x_9; +} +} +else +{ +obj* x_57; obj* x_58; +x_57 = lean::cnstr_get(x_9, 1); +lean::inc(x_57); +lean::dec(x_9); +x_58 = l_Lean_Environment_getModuleIdxFor(x_5, x_6); +if (lean::obj_tag(x_58) == 0) +{ +obj* x_59; +lean::inc(x_6); +lean::inc(x_5); +x_59 = lean::apply_3(x_2, x_5, x_6, x_7); +if (lean::obj_tag(x_59) == 0) +{ +obj* x_60; obj* x_61; obj* x_62; obj* x_63; obj* x_64; obj* x_65; obj* x_66; obj* x_67; obj* x_68; +lean::dec(x_6); +lean::dec(x_5); +lean::dec(x_4); +lean::dec(x_3); +x_60 = lean::cnstr_get(x_59, 0); +lean::inc(x_60); +lean::dec(x_59); +x_61 = l_Lean_Name_toString___closed__1; +x_62 = l_Lean_Name_toStringWithSep___main(x_61, x_1); +x_63 = l_Lean_registerTagAttribute___lambda__5___closed__1; +x_64 = lean::string_append(x_63, x_62); +lean::dec(x_62); +x_65 = l_Lean_registerTagAttribute___lambda__5___closed__4; +x_66 = lean::string_append(x_64, x_65); +x_67 = lean::string_append(x_66, x_60); +lean::dec(x_60); +x_68 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_68, 0, x_67); +lean::cnstr_set(x_68, 1, x_57); +return x_68; +} +else +{ +obj* x_69; obj* x_70; obj* x_71; obj* x_72; +x_69 = lean::cnstr_get(x_59, 0); +lean::inc(x_69); +lean::dec(x_59); +lean::inc(x_69); +lean::inc(x_6); +x_70 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_70, 0, x_6); +lean::cnstr_set(x_70, 1, x_69); +x_71 = l_Lean_PersistentEnvExtension_addEntry___rarg(x_3, x_5, x_70); +x_72 = lean::apply_3(x_4, x_71, x_6, x_69); +if (lean::obj_tag(x_72) == 0) +{ +obj* x_73; obj* x_74; obj* x_75; obj* x_76; obj* x_77; obj* x_78; obj* x_79; obj* x_80; obj* x_81; +x_73 = lean::cnstr_get(x_72, 0); +lean::inc(x_73); lean::dec(x_72); -x_75 = l_Lean_registerTagAttribute___lambda__5___closed__5; -x_76 = lean::string_append(x_74, x_75); -x_77 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_77, 0, x_76); -lean::cnstr_set(x_77, 1, x_52); -return x_77; +x_74 = l_Lean_Name_toString___closed__1; +x_75 = l_Lean_Name_toStringWithSep___main(x_74, x_1); +x_76 = l_Lean_registerTagAttribute___lambda__5___closed__1; +x_77 = lean::string_append(x_76, x_75); +lean::dec(x_75); +x_78 = l_Lean_registerTagAttribute___lambda__5___closed__4; +x_79 = lean::string_append(x_77, x_78); +x_80 = lean::string_append(x_79, x_73); +lean::dec(x_73); +x_81 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_81, 0, x_80); +lean::cnstr_set(x_81, 1, x_57); +return x_81; +} +else +{ +obj* x_82; obj* x_83; +lean::dec(x_1); +x_82 = lean::cnstr_get(x_72, 0); +lean::inc(x_82); +lean::dec(x_72); +x_83 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_83, 0, x_82); +lean::cnstr_set(x_83, 1, x_57); +return x_83; +} +} +} +else +{ +obj* x_84; obj* x_85; obj* x_86; obj* x_87; obj* x_88; obj* x_89; obj* x_90; +lean::dec(x_58); +lean::dec(x_7); +lean::dec(x_6); +lean::dec(x_5); +lean::dec(x_4); +lean::dec(x_3); +lean::dec(x_2); +x_84 = l_Lean_Name_toString___closed__1; +x_85 = l_Lean_Name_toStringWithSep___main(x_84, x_1); +x_86 = l_Lean_registerTagAttribute___lambda__5___closed__1; +x_87 = lean::string_append(x_86, x_85); +lean::dec(x_85); +x_88 = l_Lean_registerTagAttribute___lambda__5___closed__5; +x_89 = lean::string_append(x_87, x_88); +x_90 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_90, 0, x_89); +lean::cnstr_set(x_90, 1, x_57); +return x_90; } } } @@ -6871,230 +6906,233 @@ x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttri return x_1; } } -obj* l_Lean_registerParametricAttribute___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) { +obj* l_Lean_registerParametricAttribute___rarg(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6) { _start: { -obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; -x_6 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__2___boxed), 2, 1); -lean::closure_set(x_6, 0, x_1); -x_7 = l_Lean_registerTagAttribute___closed__1; -x_8 = l_Lean_registerParametricAttribute___rarg___closed__1; -x_9 = l_Lean_registerParametricAttribute___rarg___closed__2; +obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; obj* x_12; +x_7 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__2___boxed), 2, 1); +lean::closure_set(x_7, 0, x_1); +x_8 = l_Lean_registerTagAttribute___closed__1; +x_9 = l_Lean_registerParametricAttribute___rarg___closed__1; +x_10 = l_Lean_registerParametricAttribute___rarg___closed__2; lean::inc(x_2); -x_10 = lean::alloc_cnstr(0, 5, 0); -lean::cnstr_set(x_10, 0, x_2); -lean::cnstr_set(x_10, 1, x_7); -lean::cnstr_set(x_10, 2, x_8); -lean::cnstr_set(x_10, 3, x_6); -lean::cnstr_set(x_10, 4, x_9); -x_11 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg(x_10, x_5); -if (lean::obj_tag(x_11) == 0) +x_11 = lean::alloc_cnstr(0, 5, 0); +lean::cnstr_set(x_11, 0, x_2); +lean::cnstr_set(x_11, 1, x_8); +lean::cnstr_set(x_11, 2, x_9); +lean::cnstr_set(x_11, 3, x_7); +lean::cnstr_set(x_11, 4, x_10); +x_12 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg(x_11, x_6); +if (lean::obj_tag(x_12) == 0) { -uint8 x_12; -x_12 = !lean::is_exclusive(x_11); -if (x_12 == 0) +uint8 x_13; +x_13 = !lean::is_exclusive(x_12); +if (x_13 == 0) { -obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; uint8 x_20; obj* x_21; obj* x_22; -x_13 = lean::cnstr_get(x_11, 0); -x_14 = lean::box(0); -lean::cnstr_set(x_11, 0, x_14); -lean::inc(x_13); +obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; uint8 x_21; obj* x_22; obj* x_23; +x_14 = lean::cnstr_get(x_12, 0); +x_15 = lean::box(0); +lean::cnstr_set(x_12, 0, x_15); +lean::inc(x_14); lean::inc(x_2); -x_15 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 8, 3); -lean::closure_set(x_15, 0, x_2); -lean::closure_set(x_15, 1, x_4); -lean::closure_set(x_15, 2, x_13); -lean::inc(x_2); -x_16 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); +x_16 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 9, 4); lean::closure_set(x_16, 0, x_2); +lean::closure_set(x_16, 1, x_4); +lean::closure_set(x_16, 2, x_14); +lean::closure_set(x_16, 3, x_5); lean::inc(x_2); -x_17 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +x_17 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); lean::closure_set(x_17, 0, x_2); -x_18 = l_Lean_registerTagAttribute___closed__5; -x_19 = l_Lean_registerTagAttribute___closed__6; -x_20 = 0; -x_21 = lean::alloc_cnstr(0, 8, 1); -lean::cnstr_set(x_21, 0, x_2); -lean::cnstr_set(x_21, 1, x_3); -lean::cnstr_set(x_21, 2, x_15); -lean::cnstr_set(x_21, 3, x_16); -lean::cnstr_set(x_21, 4, x_17); -lean::cnstr_set(x_21, 5, x_18); -lean::cnstr_set(x_21, 6, x_19); -lean::cnstr_set(x_21, 7, x_19); -lean::cnstr_set_scalar(x_21, sizeof(void*)*8, x_20); -lean::inc(x_21); -x_22 = l_Lean_registerAttribute(x_21, x_11); -if (lean::obj_tag(x_22) == 0) +lean::inc(x_2); +x_18 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +lean::closure_set(x_18, 0, x_2); +x_19 = l_Lean_registerTagAttribute___closed__5; +x_20 = l_Lean_registerTagAttribute___closed__6; +x_21 = 0; +x_22 = lean::alloc_cnstr(0, 8, 1); +lean::cnstr_set(x_22, 0, x_2); +lean::cnstr_set(x_22, 1, x_3); +lean::cnstr_set(x_22, 2, x_16); +lean::cnstr_set(x_22, 3, x_17); +lean::cnstr_set(x_22, 4, x_18); +lean::cnstr_set(x_22, 5, x_19); +lean::cnstr_set(x_22, 6, x_20); +lean::cnstr_set(x_22, 7, x_20); +lean::cnstr_set_scalar(x_22, sizeof(void*)*8, x_21); +lean::inc(x_22); +x_23 = l_Lean_registerAttribute(x_22, x_12); +if (lean::obj_tag(x_23) == 0) { -uint8 x_23; -x_23 = !lean::is_exclusive(x_22); -if (x_23 == 0) +uint8 x_24; +x_24 = !lean::is_exclusive(x_23); +if (x_24 == 0) { -obj* x_24; obj* x_25; -x_24 = lean::cnstr_get(x_22, 0); -lean::dec(x_24); -x_25 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_25, 0, x_21); -lean::cnstr_set(x_25, 1, x_13); -lean::cnstr_set(x_22, 0, x_25); -return x_22; +obj* x_25; obj* x_26; +x_25 = lean::cnstr_get(x_23, 0); +lean::dec(x_25); +x_26 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_26, 0, x_22); +lean::cnstr_set(x_26, 1, x_14); +lean::cnstr_set(x_23, 0, x_26); +return x_23; } else { -obj* x_26; obj* x_27; obj* x_28; -x_26 = lean::cnstr_get(x_22, 1); -lean::inc(x_26); -lean::dec(x_22); -x_27 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_27, 0, x_21); -lean::cnstr_set(x_27, 1, x_13); +obj* x_27; obj* x_28; obj* x_29; +x_27 = lean::cnstr_get(x_23, 1); +lean::inc(x_27); +lean::dec(x_23); x_28 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_28, 0, x_27); -lean::cnstr_set(x_28, 1, x_26); -return x_28; +lean::cnstr_set(x_28, 0, x_22); +lean::cnstr_set(x_28, 1, x_14); +x_29 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_29, 0, x_28); +lean::cnstr_set(x_29, 1, x_27); +return x_29; } } else { -uint8 x_29; -lean::dec(x_21); -lean::dec(x_13); -x_29 = !lean::is_exclusive(x_22); -if (x_29 == 0) -{ -return x_22; -} -else -{ -obj* x_30; obj* x_31; obj* x_32; -x_30 = lean::cnstr_get(x_22, 0); -x_31 = lean::cnstr_get(x_22, 1); -lean::inc(x_31); -lean::inc(x_30); +uint8 x_30; lean::dec(x_22); -x_32 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_32, 0, x_30); -lean::cnstr_set(x_32, 1, x_31); -return x_32; +lean::dec(x_14); +x_30 = !lean::is_exclusive(x_23); +if (x_30 == 0) +{ +return x_23; +} +else +{ +obj* x_31; obj* x_32; obj* x_33; +x_31 = lean::cnstr_get(x_23, 0); +x_32 = lean::cnstr_get(x_23, 1); +lean::inc(x_32); +lean::inc(x_31); +lean::dec(x_23); +x_33 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_33, 0, x_31); +lean::cnstr_set(x_33, 1, x_32); +return x_33; } } } else { -obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; obj* x_41; uint8 x_42; obj* x_43; obj* x_44; -x_33 = lean::cnstr_get(x_11, 0); -x_34 = lean::cnstr_get(x_11, 1); +obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; obj* x_41; obj* x_42; uint8 x_43; obj* x_44; obj* x_45; +x_34 = lean::cnstr_get(x_12, 0); +x_35 = lean::cnstr_get(x_12, 1); +lean::inc(x_35); +lean::inc(x_34); +lean::dec(x_12); +x_36 = lean::box(0); +x_37 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_37, 0, x_36); +lean::cnstr_set(x_37, 1, x_35); lean::inc(x_34); -lean::inc(x_33); -lean::dec(x_11); -x_35 = lean::box(0); -x_36 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_36, 0, x_35); -lean::cnstr_set(x_36, 1, x_34); -lean::inc(x_33); lean::inc(x_2); -x_37 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 8, 3); -lean::closure_set(x_37, 0, x_2); -lean::closure_set(x_37, 1, x_4); -lean::closure_set(x_37, 2, x_33); -lean::inc(x_2); -x_38 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); +x_38 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 9, 4); lean::closure_set(x_38, 0, x_2); +lean::closure_set(x_38, 1, x_4); +lean::closure_set(x_38, 2, x_34); +lean::closure_set(x_38, 3, x_5); lean::inc(x_2); -x_39 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +x_39 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); lean::closure_set(x_39, 0, x_2); -x_40 = l_Lean_registerTagAttribute___closed__5; -x_41 = l_Lean_registerTagAttribute___closed__6; -x_42 = 0; -x_43 = lean::alloc_cnstr(0, 8, 1); -lean::cnstr_set(x_43, 0, x_2); -lean::cnstr_set(x_43, 1, x_3); -lean::cnstr_set(x_43, 2, x_37); -lean::cnstr_set(x_43, 3, x_38); -lean::cnstr_set(x_43, 4, x_39); -lean::cnstr_set(x_43, 5, x_40); -lean::cnstr_set(x_43, 6, x_41); -lean::cnstr_set(x_43, 7, x_41); -lean::cnstr_set_scalar(x_43, sizeof(void*)*8, x_42); -lean::inc(x_43); -x_44 = l_Lean_registerAttribute(x_43, x_36); -if (lean::obj_tag(x_44) == 0) +lean::inc(x_2); +x_40 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +lean::closure_set(x_40, 0, x_2); +x_41 = l_Lean_registerTagAttribute___closed__5; +x_42 = l_Lean_registerTagAttribute___closed__6; +x_43 = 0; +x_44 = lean::alloc_cnstr(0, 8, 1); +lean::cnstr_set(x_44, 0, x_2); +lean::cnstr_set(x_44, 1, x_3); +lean::cnstr_set(x_44, 2, x_38); +lean::cnstr_set(x_44, 3, x_39); +lean::cnstr_set(x_44, 4, x_40); +lean::cnstr_set(x_44, 5, x_41); +lean::cnstr_set(x_44, 6, x_42); +lean::cnstr_set(x_44, 7, x_42); +lean::cnstr_set_scalar(x_44, sizeof(void*)*8, x_43); +lean::inc(x_44); +x_45 = l_Lean_registerAttribute(x_44, x_37); +if (lean::obj_tag(x_45) == 0) { -obj* x_45; obj* x_46; obj* x_47; obj* x_48; -x_45 = lean::cnstr_get(x_44, 1); -lean::inc(x_45); -if (lean::is_exclusive(x_44)) { - lean::cnstr_release(x_44, 0); - lean::cnstr_release(x_44, 1); - x_46 = x_44; +obj* x_46; obj* x_47; obj* x_48; obj* x_49; +x_46 = lean::cnstr_get(x_45, 1); +lean::inc(x_46); +if (lean::is_exclusive(x_45)) { + lean::cnstr_release(x_45, 0); + lean::cnstr_release(x_45, 1); + x_47 = x_45; } else { - lean::dec_ref(x_44); - x_46 = lean::box(0); + lean::dec_ref(x_45); + x_47 = lean::box(0); } -x_47 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_47, 0, x_43); -lean::cnstr_set(x_47, 1, x_33); -if (lean::is_scalar(x_46)) { - x_48 = lean::alloc_cnstr(0, 2, 0); +x_48 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_48, 0, x_44); +lean::cnstr_set(x_48, 1, x_34); +if (lean::is_scalar(x_47)) { + x_49 = lean::alloc_cnstr(0, 2, 0); } else { - x_48 = x_46; + x_49 = x_47; } -lean::cnstr_set(x_48, 0, x_47); -lean::cnstr_set(x_48, 1, x_45); -return x_48; +lean::cnstr_set(x_49, 0, x_48); +lean::cnstr_set(x_49, 1, x_46); +return x_49; } else { -obj* x_49; obj* x_50; obj* x_51; obj* x_52; -lean::dec(x_43); -lean::dec(x_33); -x_49 = lean::cnstr_get(x_44, 0); -lean::inc(x_49); -x_50 = lean::cnstr_get(x_44, 1); +obj* x_50; obj* x_51; obj* x_52; obj* x_53; +lean::dec(x_44); +lean::dec(x_34); +x_50 = lean::cnstr_get(x_45, 0); lean::inc(x_50); -if (lean::is_exclusive(x_44)) { - lean::cnstr_release(x_44, 0); - lean::cnstr_release(x_44, 1); - x_51 = x_44; +x_51 = lean::cnstr_get(x_45, 1); +lean::inc(x_51); +if (lean::is_exclusive(x_45)) { + lean::cnstr_release(x_45, 0); + lean::cnstr_release(x_45, 1); + x_52 = x_45; } else { - lean::dec_ref(x_44); - x_51 = lean::box(0); + lean::dec_ref(x_45); + x_52 = lean::box(0); } -if (lean::is_scalar(x_51)) { - x_52 = lean::alloc_cnstr(1, 2, 0); +if (lean::is_scalar(x_52)) { + x_53 = lean::alloc_cnstr(1, 2, 0); } else { - x_52 = x_51; + x_53 = x_52; } -lean::cnstr_set(x_52, 0, x_49); -lean::cnstr_set(x_52, 1, x_50); -return x_52; +lean::cnstr_set(x_53, 0, x_50); +lean::cnstr_set(x_53, 1, x_51); +return x_53; } } } else { -uint8 x_53; +uint8 x_54; +lean::dec(x_5); lean::dec(x_4); lean::dec(x_3); lean::dec(x_2); -x_53 = !lean::is_exclusive(x_11); -if (x_53 == 0) +x_54 = !lean::is_exclusive(x_12); +if (x_54 == 0) { -return x_11; +return x_12; } else { -obj* x_54; obj* x_55; obj* x_56; -x_54 = lean::cnstr_get(x_11, 0); -x_55 = lean::cnstr_get(x_11, 1); +obj* x_55; obj* x_56; obj* x_57; +x_55 = lean::cnstr_get(x_12, 0); +x_56 = lean::cnstr_get(x_12, 1); +lean::inc(x_56); lean::inc(x_55); -lean::inc(x_54); -lean::dec(x_11); -x_56 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_56, 0, x_54); -lean::cnstr_set(x_56, 1, x_55); -return x_56; +lean::dec(x_12); +x_57 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_57, 0, x_55); +lean::cnstr_set(x_57, 1, x_56); +return x_57; } } } @@ -7103,7 +7141,7 @@ obj* l_Lean_registerParametricAttribute(obj* x_1) { _start: { obj* x_2; -x_2 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg), 5, 0); +x_2 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg), 6, 0); return x_2; } } @@ -7183,14 +7221,14 @@ lean::dec(x_1); return x_2; } } -obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6, obj* x_7, obj* x_8) { +obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5, obj* x_6, obj* x_7, obj* x_8, obj* x_9) { _start: { -uint8 x_9; obj* x_10; -x_9 = lean::unbox(x_7); -lean::dec(x_7); -x_10 = l_Lean_registerParametricAttribute___rarg___lambda__4(x_1, x_2, x_3, x_4, x_5, x_6, x_9, x_8); -return x_10; +uint8 x_10; obj* x_11; +x_10 = lean::unbox(x_8); +lean::dec(x_8); +x_11 = l_Lean_registerParametricAttribute___rarg___lambda__4(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_10, x_9); +return x_11; } } obj* _init_l_Lean_ParametricAttribute_Inhabited___closed__1() { @@ -9406,6 +9444,78 @@ lean::dec(x_1); return x_3; } } +obj* l_Lean_attrParamSyntaxToIdentifier(obj* x_1) { +_start: +{ +if (lean::obj_tag(x_1) == 1) +{ +obj* x_2; obj* x_3; obj* x_4; uint8 x_5; +x_2 = lean::cnstr_get(x_1, 0); +x_3 = lean::cnstr_get(x_1, 1); +x_4 = l_Lean_nullKind; +x_5 = lean_name_dec_eq(x_2, x_4); +if (x_5 == 0) +{ +obj* x_6; +x_6 = lean::box(0); +return x_6; +} +else +{ +obj* x_7; obj* x_8; uint8 x_9; +x_7 = lean::array_get_size(x_3); +x_8 = lean::mk_nat_obj(1u); +x_9 = lean::nat_dec_eq(x_7, x_8); +lean::dec(x_7); +if (x_9 == 0) +{ +obj* x_10; +x_10 = lean::box(0); +return x_10; +} +else +{ +obj* x_11; obj* x_12; obj* x_13; +x_11 = l_Lean_stxInh; +x_12 = lean::mk_nat_obj(0u); +x_13 = lean::array_get(x_11, x_3, x_12); +if (lean::obj_tag(x_13) == 3) +{ +obj* x_14; obj* x_15; +x_14 = lean::cnstr_get(x_13, 2); +lean::inc(x_14); +lean::dec(x_13); +x_15 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_15, 0, x_14); +return x_15; +} +else +{ +obj* x_16; +lean::dec(x_13); +x_16 = lean::box(0); +return x_16; +} +} +} +} +else +{ +obj* x_17; +x_17 = lean::box(0); +return x_17; +} +} +} +obj* l_Lean_attrParamSyntaxToIdentifier___boxed(obj* x_1) { +_start: +{ +obj* x_2; +x_2 = l_Lean_attrParamSyntaxToIdentifier(x_1); +lean::dec(x_1); +return x_2; +} +} obj* initialize_init_lean_environment(obj*); obj* initialize_init_lean_syntax(obj*); static bool _G_initialized = false; @@ -9551,5 +9661,6 @@ lean::mark_persistent(l_Lean_EnumAttributes_setValue___rarg___closed__1); l_Lean_EnumAttributes_setValue___rarg___closed__2 = _init_l_Lean_EnumAttributes_setValue___rarg___closed__2(); lean::mark_persistent(l_Lean_EnumAttributes_setValue___rarg___closed__2); REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name(lean::mk_const_name("Lean"), "EnumAttributes"), "setValue"), 1, l_Lean_EnumAttributes_setValue); +REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "attrParamSyntaxToIdentifier"), 1, l_Lean_attrParamSyntaxToIdentifier___boxed); return w; } diff --git a/src/stage0/init/lean/compiler/exportattr.cpp b/src/stage0/init/lean/compiler/exportattr.cpp index a9101626e4..9fd711a834 100644 --- a/src/stage0/init/lean/compiler/exportattr.cpp +++ b/src/stage0/init/lean/compiler/exportattr.cpp @@ -14,6 +14,7 @@ typedef lean::uint32 uint32; typedef lean::uint64 uint64; #pragma GCC diagnostic ignored "-Wunused-label" #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif +obj* l_Lean_attrParamSyntaxToIdentifier(obj*); extern "C" uint8 lean_name_dec_eq(obj*, obj*); obj* l_Lean_AttributeImpl_inhabited___lambda__4___boxed(obj*, obj*, obj*); extern obj* l_Array_empty___closed__1; @@ -21,7 +22,8 @@ namespace lean { obj* nat_sub(obj*, obj*); } obj* l_Lean_mkExportAttr___closed__2; -obj* l_Lean_registerParametricAttribute___at_Lean_mkExportAttr___spec__1(obj*, obj*, obj*, obj*); +obj* l_Lean_registerParametricAttribute___at_Lean_mkExportAttr___spec__1(obj*, obj*, obj*, obj*, obj*); +obj* l_Lean_mkExportAttr___closed__4; obj* l_Lean_AttributeImpl_inhabited___lambda__3___boxed(obj*, obj*, obj*, obj*); namespace lean { obj* get_export_name_for_core(obj*, obj*); @@ -73,11 +75,13 @@ namespace lean { uint32 string_utf8_get(obj*, obj*); } uint8 l_UInt32_decEq(uint32, uint32); +obj* l_Lean_mkExportAttr___lambda__2___boxed(obj*, obj*, obj*); obj* l___private_init_lean_compiler_exportattr_1__isValidCppId___boxed(obj*); -obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*); +obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*); uint8 l_Char_isDigit(uint32); obj* l_Lean_registerParametricAttribute___at_Lean_mkExportAttr___spec__1___closed__1; obj* l_Lean_mkExportAttr___lambda__1___closed__1; +obj* l_Lean_mkExportAttr___lambda__2(obj*, obj*, obj*); obj* l_Lean_registerTagAttribute___lambda__7___boxed(obj*, obj*, obj*, obj*, obj*); obj* l_Lean_exportAttr; uint8 l_Lean_Name_quickLt(obj*, obj*); @@ -632,229 +636,232 @@ x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttri return x_1; } } -obj* l_Lean_registerParametricAttribute___at_Lean_mkExportAttr___spec__1(obj* x_1, obj* x_2, obj* x_3, obj* x_4) { +obj* l_Lean_registerParametricAttribute___at_Lean_mkExportAttr___spec__1(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) { _start: { -obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; -x_5 = l_Lean_registerTagAttribute___closed__1; -x_6 = l_Lean_registerParametricAttribute___rarg___closed__1; -x_7 = l_Lean_registerParametricAttribute___at_Lean_mkExportAttr___spec__1___closed__1; -x_8 = l_Lean_registerParametricAttribute___rarg___closed__2; +obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; +x_6 = l_Lean_registerTagAttribute___closed__1; +x_7 = l_Lean_registerParametricAttribute___rarg___closed__1; +x_8 = l_Lean_registerParametricAttribute___at_Lean_mkExportAttr___spec__1___closed__1; +x_9 = l_Lean_registerParametricAttribute___rarg___closed__2; lean::inc(x_1); -x_9 = lean::alloc_cnstr(0, 5, 0); -lean::cnstr_set(x_9, 0, x_1); -lean::cnstr_set(x_9, 1, x_5); -lean::cnstr_set(x_9, 2, x_6); -lean::cnstr_set(x_9, 3, x_7); -lean::cnstr_set(x_9, 4, x_8); -x_10 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg(x_9, x_4); -if (lean::obj_tag(x_10) == 0) +x_10 = lean::alloc_cnstr(0, 5, 0); +lean::cnstr_set(x_10, 0, x_1); +lean::cnstr_set(x_10, 1, x_6); +lean::cnstr_set(x_10, 2, x_7); +lean::cnstr_set(x_10, 3, x_8); +lean::cnstr_set(x_10, 4, x_9); +x_11 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg(x_10, x_5); +if (lean::obj_tag(x_11) == 0) { -uint8 x_11; -x_11 = !lean::is_exclusive(x_10); -if (x_11 == 0) +uint8 x_12; +x_12 = !lean::is_exclusive(x_11); +if (x_12 == 0) { -obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; uint8 x_19; obj* x_20; obj* x_21; -x_12 = lean::cnstr_get(x_10, 0); -x_13 = lean::box(0); -lean::cnstr_set(x_10, 0, x_13); -lean::inc(x_12); +obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; uint8 x_20; obj* x_21; obj* x_22; +x_13 = lean::cnstr_get(x_11, 0); +x_14 = lean::box(0); +lean::cnstr_set(x_11, 0, x_14); +lean::inc(x_13); lean::inc(x_1); -x_14 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 8, 3); -lean::closure_set(x_14, 0, x_1); -lean::closure_set(x_14, 1, x_3); -lean::closure_set(x_14, 2, x_12); -lean::inc(x_1); -x_15 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); +x_15 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 9, 4); lean::closure_set(x_15, 0, x_1); +lean::closure_set(x_15, 1, x_3); +lean::closure_set(x_15, 2, x_13); +lean::closure_set(x_15, 3, x_4); lean::inc(x_1); -x_16 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +x_16 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); lean::closure_set(x_16, 0, x_1); -x_17 = l_Lean_registerTagAttribute___closed__5; -x_18 = l_Lean_registerTagAttribute___closed__6; -x_19 = 0; -x_20 = lean::alloc_cnstr(0, 8, 1); -lean::cnstr_set(x_20, 0, x_1); -lean::cnstr_set(x_20, 1, x_2); -lean::cnstr_set(x_20, 2, x_14); -lean::cnstr_set(x_20, 3, x_15); -lean::cnstr_set(x_20, 4, x_16); -lean::cnstr_set(x_20, 5, x_17); -lean::cnstr_set(x_20, 6, x_18); -lean::cnstr_set(x_20, 7, x_18); -lean::cnstr_set_scalar(x_20, sizeof(void*)*8, x_19); -lean::inc(x_20); -x_21 = l_Lean_registerAttribute(x_20, x_10); -if (lean::obj_tag(x_21) == 0) +lean::inc(x_1); +x_17 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +lean::closure_set(x_17, 0, x_1); +x_18 = l_Lean_registerTagAttribute___closed__5; +x_19 = l_Lean_registerTagAttribute___closed__6; +x_20 = 0; +x_21 = lean::alloc_cnstr(0, 8, 1); +lean::cnstr_set(x_21, 0, x_1); +lean::cnstr_set(x_21, 1, x_2); +lean::cnstr_set(x_21, 2, x_15); +lean::cnstr_set(x_21, 3, x_16); +lean::cnstr_set(x_21, 4, x_17); +lean::cnstr_set(x_21, 5, x_18); +lean::cnstr_set(x_21, 6, x_19); +lean::cnstr_set(x_21, 7, x_19); +lean::cnstr_set_scalar(x_21, sizeof(void*)*8, x_20); +lean::inc(x_21); +x_22 = l_Lean_registerAttribute(x_21, x_11); +if (lean::obj_tag(x_22) == 0) { -uint8 x_22; -x_22 = !lean::is_exclusive(x_21); -if (x_22 == 0) +uint8 x_23; +x_23 = !lean::is_exclusive(x_22); +if (x_23 == 0) { -obj* x_23; obj* x_24; -x_23 = lean::cnstr_get(x_21, 0); -lean::dec(x_23); -x_24 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_24, 0, x_20); -lean::cnstr_set(x_24, 1, x_12); -lean::cnstr_set(x_21, 0, x_24); -return x_21; +obj* x_24; obj* x_25; +x_24 = lean::cnstr_get(x_22, 0); +lean::dec(x_24); +x_25 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_25, 0, x_21); +lean::cnstr_set(x_25, 1, x_13); +lean::cnstr_set(x_22, 0, x_25); +return x_22; } else { -obj* x_25; obj* x_26; obj* x_27; -x_25 = lean::cnstr_get(x_21, 1); -lean::inc(x_25); -lean::dec(x_21); -x_26 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_26, 0, x_20); -lean::cnstr_set(x_26, 1, x_12); +obj* x_26; obj* x_27; obj* x_28; +x_26 = lean::cnstr_get(x_22, 1); +lean::inc(x_26); +lean::dec(x_22); x_27 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_27, 0, x_26); -lean::cnstr_set(x_27, 1, x_25); -return x_27; +lean::cnstr_set(x_27, 0, x_21); +lean::cnstr_set(x_27, 1, x_13); +x_28 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_28, 0, x_27); +lean::cnstr_set(x_28, 1, x_26); +return x_28; } } else { -uint8 x_28; -lean::dec(x_20); -lean::dec(x_12); -x_28 = !lean::is_exclusive(x_21); -if (x_28 == 0) -{ -return x_21; -} -else -{ -obj* x_29; obj* x_30; obj* x_31; -x_29 = lean::cnstr_get(x_21, 0); -x_30 = lean::cnstr_get(x_21, 1); -lean::inc(x_30); -lean::inc(x_29); +uint8 x_29; lean::dec(x_21); -x_31 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_31, 0, x_29); -lean::cnstr_set(x_31, 1, x_30); -return x_31; +lean::dec(x_13); +x_29 = !lean::is_exclusive(x_22); +if (x_29 == 0) +{ +return x_22; +} +else +{ +obj* x_30; obj* x_31; obj* x_32; +x_30 = lean::cnstr_get(x_22, 0); +x_31 = lean::cnstr_get(x_22, 1); +lean::inc(x_31); +lean::inc(x_30); +lean::dec(x_22); +x_32 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_32, 0, x_30); +lean::cnstr_set(x_32, 1, x_31); +return x_32; } } } else { -obj* x_32; obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; uint8 x_41; obj* x_42; obj* x_43; -x_32 = lean::cnstr_get(x_10, 0); -x_33 = lean::cnstr_get(x_10, 1); +obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; obj* x_41; uint8 x_42; obj* x_43; obj* x_44; +x_33 = lean::cnstr_get(x_11, 0); +x_34 = lean::cnstr_get(x_11, 1); +lean::inc(x_34); +lean::inc(x_33); +lean::dec(x_11); +x_35 = lean::box(0); +x_36 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_36, 0, x_35); +lean::cnstr_set(x_36, 1, x_34); lean::inc(x_33); -lean::inc(x_32); -lean::dec(x_10); -x_34 = lean::box(0); -x_35 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_35, 0, x_34); -lean::cnstr_set(x_35, 1, x_33); -lean::inc(x_32); lean::inc(x_1); -x_36 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 8, 3); -lean::closure_set(x_36, 0, x_1); -lean::closure_set(x_36, 1, x_3); -lean::closure_set(x_36, 2, x_32); -lean::inc(x_1); -x_37 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); +x_37 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 9, 4); lean::closure_set(x_37, 0, x_1); +lean::closure_set(x_37, 1, x_3); +lean::closure_set(x_37, 2, x_33); +lean::closure_set(x_37, 3, x_4); lean::inc(x_1); -x_38 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +x_38 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); lean::closure_set(x_38, 0, x_1); -x_39 = l_Lean_registerTagAttribute___closed__5; -x_40 = l_Lean_registerTagAttribute___closed__6; -x_41 = 0; -x_42 = lean::alloc_cnstr(0, 8, 1); -lean::cnstr_set(x_42, 0, x_1); -lean::cnstr_set(x_42, 1, x_2); -lean::cnstr_set(x_42, 2, x_36); -lean::cnstr_set(x_42, 3, x_37); -lean::cnstr_set(x_42, 4, x_38); -lean::cnstr_set(x_42, 5, x_39); -lean::cnstr_set(x_42, 6, x_40); -lean::cnstr_set(x_42, 7, x_40); -lean::cnstr_set_scalar(x_42, sizeof(void*)*8, x_41); -lean::inc(x_42); -x_43 = l_Lean_registerAttribute(x_42, x_35); -if (lean::obj_tag(x_43) == 0) +lean::inc(x_1); +x_39 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +lean::closure_set(x_39, 0, x_1); +x_40 = l_Lean_registerTagAttribute___closed__5; +x_41 = l_Lean_registerTagAttribute___closed__6; +x_42 = 0; +x_43 = lean::alloc_cnstr(0, 8, 1); +lean::cnstr_set(x_43, 0, x_1); +lean::cnstr_set(x_43, 1, x_2); +lean::cnstr_set(x_43, 2, x_37); +lean::cnstr_set(x_43, 3, x_38); +lean::cnstr_set(x_43, 4, x_39); +lean::cnstr_set(x_43, 5, x_40); +lean::cnstr_set(x_43, 6, x_41); +lean::cnstr_set(x_43, 7, x_41); +lean::cnstr_set_scalar(x_43, sizeof(void*)*8, x_42); +lean::inc(x_43); +x_44 = l_Lean_registerAttribute(x_43, x_36); +if (lean::obj_tag(x_44) == 0) { -obj* x_44; obj* x_45; obj* x_46; obj* x_47; -x_44 = lean::cnstr_get(x_43, 1); -lean::inc(x_44); -if (lean::is_exclusive(x_43)) { - lean::cnstr_release(x_43, 0); - lean::cnstr_release(x_43, 1); - x_45 = x_43; +obj* x_45; obj* x_46; obj* x_47; obj* x_48; +x_45 = lean::cnstr_get(x_44, 1); +lean::inc(x_45); +if (lean::is_exclusive(x_44)) { + lean::cnstr_release(x_44, 0); + lean::cnstr_release(x_44, 1); + x_46 = x_44; } else { - lean::dec_ref(x_43); - x_45 = lean::box(0); + lean::dec_ref(x_44); + x_46 = lean::box(0); } -x_46 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_46, 0, x_42); -lean::cnstr_set(x_46, 1, x_32); -if (lean::is_scalar(x_45)) { - x_47 = lean::alloc_cnstr(0, 2, 0); +x_47 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_47, 0, x_43); +lean::cnstr_set(x_47, 1, x_33); +if (lean::is_scalar(x_46)) { + x_48 = lean::alloc_cnstr(0, 2, 0); } else { - x_47 = x_45; + x_48 = x_46; } -lean::cnstr_set(x_47, 0, x_46); -lean::cnstr_set(x_47, 1, x_44); -return x_47; +lean::cnstr_set(x_48, 0, x_47); +lean::cnstr_set(x_48, 1, x_45); +return x_48; } else { -obj* x_48; obj* x_49; obj* x_50; obj* x_51; -lean::dec(x_42); -lean::dec(x_32); -x_48 = lean::cnstr_get(x_43, 0); -lean::inc(x_48); -x_49 = lean::cnstr_get(x_43, 1); +obj* x_49; obj* x_50; obj* x_51; obj* x_52; +lean::dec(x_43); +lean::dec(x_33); +x_49 = lean::cnstr_get(x_44, 0); lean::inc(x_49); -if (lean::is_exclusive(x_43)) { - lean::cnstr_release(x_43, 0); - lean::cnstr_release(x_43, 1); - x_50 = x_43; +x_50 = lean::cnstr_get(x_44, 1); +lean::inc(x_50); +if (lean::is_exclusive(x_44)) { + lean::cnstr_release(x_44, 0); + lean::cnstr_release(x_44, 1); + x_51 = x_44; } else { - lean::dec_ref(x_43); - x_50 = lean::box(0); + lean::dec_ref(x_44); + x_51 = lean::box(0); } -if (lean::is_scalar(x_50)) { - x_51 = lean::alloc_cnstr(1, 2, 0); +if (lean::is_scalar(x_51)) { + x_52 = lean::alloc_cnstr(1, 2, 0); } else { - x_51 = x_50; + x_52 = x_51; } -lean::cnstr_set(x_51, 0, x_48); -lean::cnstr_set(x_51, 1, x_49); -return x_51; +lean::cnstr_set(x_52, 0, x_49); +lean::cnstr_set(x_52, 1, x_50); +return x_52; } } } else { -uint8 x_52; +uint8 x_53; +lean::dec(x_4); lean::dec(x_3); lean::dec(x_2); lean::dec(x_1); -x_52 = !lean::is_exclusive(x_10); -if (x_52 == 0) +x_53 = !lean::is_exclusive(x_11); +if (x_53 == 0) { -return x_10; +return x_11; } else { -obj* x_53; obj* x_54; obj* x_55; -x_53 = lean::cnstr_get(x_10, 0); -x_54 = lean::cnstr_get(x_10, 1); +obj* x_54; obj* x_55; obj* x_56; +x_54 = lean::cnstr_get(x_11, 0); +x_55 = lean::cnstr_get(x_11, 1); +lean::inc(x_55); lean::inc(x_54); -lean::inc(x_53); -lean::dec(x_10); -x_55 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_55, 0, x_53); -lean::cnstr_set(x_55, 1, x_54); -return x_55; +lean::dec(x_11); +x_56 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_56, 0, x_54); +lean::cnstr_set(x_56, 1, x_55); +return x_56; } } } @@ -882,39 +889,47 @@ return x_2; obj* l_Lean_mkExportAttr___lambda__1(obj* x_1, obj* x_2, obj* x_3) { _start: { -if (lean::obj_tag(x_3) == 3) +obj* x_4; +x_4 = l_Lean_attrParamSyntaxToIdentifier(x_3); +if (lean::obj_tag(x_4) == 0) { -obj* x_4; uint8 x_5; -x_4 = lean::cnstr_get(x_3, 2); -x_5 = l___private_init_lean_compiler_exportattr_2__isValidCppName___main(x_4); -if (x_5 == 0) -{ -obj* x_6; -lean::dec(x_1); -x_6 = l_Lean_mkExportAttr___lambda__1___closed__2; -return x_6; +obj* x_5; +x_5 = l_Lean_mkExportAttr___lambda__1___closed__1; +return x_5; } else { -obj* x_7; obj* x_8; -lean::inc(x_4); -x_7 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_7, 0, x_4); -lean::cnstr_set(x_7, 1, x_1); -x_8 = lean::alloc_cnstr(1, 1, 0); -lean::cnstr_set(x_8, 0, x_7); +obj* x_6; uint8 x_7; +x_6 = lean::cnstr_get(x_4, 0); +lean::inc(x_6); +lean::dec(x_4); +x_7 = l___private_init_lean_compiler_exportattr_2__isValidCppName___main(x_6); +if (x_7 == 0) +{ +obj* x_8; +lean::dec(x_6); +x_8 = l_Lean_mkExportAttr___lambda__1___closed__2; return x_8; } -} else { obj* x_9; -lean::dec(x_1); -x_9 = l_Lean_mkExportAttr___lambda__1___closed__1; +x_9 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_9, 0, x_6); return x_9; } } } +} +obj* l_Lean_mkExportAttr___lambda__2(obj* x_1, obj* x_2, obj* x_3) { +_start: +{ +obj* x_4; +x_4 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_4, 0, x_1); +return x_4; +} +} obj* _init_l_Lean_mkExportAttr___closed__1() { _start: { @@ -941,15 +956,24 @@ x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_mkExportAttr___lambda__ return x_1; } } +obj* _init_l_Lean_mkExportAttr___closed__4() { +_start: +{ +obj* x_1; +x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_mkExportAttr___lambda__2___boxed), 3, 0); +return x_1; +} +} obj* l_Lean_mkExportAttr(obj* x_1) { _start: { -obj* x_2; obj* x_3; obj* x_4; obj* x_5; +obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_6; x_2 = l_Lean_mkExportAttr___closed__1; x_3 = l_Lean_mkExportAttr___closed__2; x_4 = l_Lean_mkExportAttr___closed__3; -x_5 = l_Lean_registerParametricAttribute___at_Lean_mkExportAttr___spec__1(x_2, x_3, x_4, x_1); -return x_5; +x_5 = l_Lean_mkExportAttr___closed__4; +x_6 = l_Lean_registerParametricAttribute___at_Lean_mkExportAttr___spec__1(x_2, x_3, x_4, x_5, x_1); +return x_6; } } obj* l_RBNode_fold___main___at_Lean_mkExportAttr___spec__2___boxed(obj* x_1, obj* x_2) { @@ -996,6 +1020,17 @@ obj* x_4; x_4 = l_Lean_mkExportAttr___lambda__1(x_1, x_2, x_3); lean::dec(x_3); lean::dec(x_2); +lean::dec(x_1); +return x_4; +} +} +obj* l_Lean_mkExportAttr___lambda__2___boxed(obj* x_1, obj* x_2, obj* x_3) { +_start: +{ +obj* x_4; +x_4 = l_Lean_mkExportAttr___lambda__2(x_1, x_2, x_3); +lean::dec(x_3); +lean::dec(x_2); return x_4; } } @@ -1295,6 +1330,8 @@ l_Lean_mkExportAttr___closed__2 = _init_l_Lean_mkExportAttr___closed__2(); lean::mark_persistent(l_Lean_mkExportAttr___closed__2); l_Lean_mkExportAttr___closed__3 = _init_l_Lean_mkExportAttr___closed__3(); lean::mark_persistent(l_Lean_mkExportAttr___closed__3); +l_Lean_mkExportAttr___closed__4 = _init_l_Lean_mkExportAttr___closed__4(); +lean::mark_persistent(l_Lean_mkExportAttr___closed__4); REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "mkExportAttr"), 1, l_Lean_mkExportAttr); w = l_Lean_mkExportAttr(w); if (io_result_is_error(w)) return w; diff --git a/src/stage0/init/lean/compiler/externattr.cpp b/src/stage0/init/lean/compiler/externattr.cpp index 54d2085ef9..bc00626922 100644 --- a/src/stage0/init/lean/compiler/externattr.cpp +++ b/src/stage0/init/lean/compiler/externattr.cpp @@ -46,7 +46,6 @@ obj* l_Lean_ParametricAttribute_getParam___at_Lean_getExternAttrData___spec__1(o obj* l_List_intersperse___main___rarg(obj*, obj*); obj* l_Lean_AttributeImpl_inhabited___lambda__3___boxed(obj*, obj*, obj*, obj*); obj* l_Lean_expandExternEntry(obj*, obj*); -obj* l_Lean_getExternAttrDataOld___boxed(obj*, obj*); obj* l_Lean_PersistentEnvExtension_inhabited___rarg___lambda__1___boxed(obj*); obj* l_List_getOpt___main___rarg(obj*, obj*); obj* l_Lean_mkProjectionFnInfoExtension___lambda__2___boxed(obj*); @@ -100,6 +99,7 @@ obj* string_append(obj*, obj*); } uint8 l_UInt32_decLe(uint32, uint32); extern obj* l_List_reprAux___main___rarg___closed__1; +obj* l_Lean_mkExternAttr___lambda__2(obj*, obj*, obj*); obj* l_Lean_expandExternPatternAux___main___boxed(obj*, obj*, obj*, obj*); extern obj* l_Lean_registerParametricAttribute___rarg___closed__2; extern obj* l_Option_HasRepr___rarg___closed__3; @@ -108,7 +108,7 @@ obj* l___private_init_lean_compiler_externattr_1__syntaxToExternEntries___main__ namespace lean { uint8 nat_dec_lt(obj*, obj*); } -obj* l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1(obj*, obj*, obj*, obj*); +obj* l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1(obj*, obj*, obj*, obj*, obj*); uint8 l_Lean_isExternC(obj*, obj*); extern obj* l_Lean_registerTagAttribute___closed__6; obj* l_Lean_expandExternPatternAux___main(obj*, obj*, obj*, obj*); @@ -139,10 +139,11 @@ uint8 l_UInt32_decEq(uint32, uint32); namespace lean { obj* mk_inline_ext_entry_core(obj*, obj*); } -obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*); +obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*); obj* l_Lean_registerTagAttribute___lambda__7___boxed(obj*, obj*, obj*, obj*, obj*); obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkExternAttr___spec__4(obj*, obj*, obj*, obj*, obj*); uint8 l_Lean_Name_quickLt(obj*, obj*); +obj* l_Lean_mkExternAttr___lambda__2___boxed(obj*, obj*, obj*); obj* l___private_init_lean_compiler_externattr_2__syntaxToExternAttrData___closed__1; obj* l_Lean_PersistentEnvExtension_inhabited___rarg___lambda__2___boxed(obj*); obj* l_Lean_mkExternAttr(obj*); @@ -179,12 +180,12 @@ extern "C" obj* lean_add_extern(obj*, obj*); obj* l___private_init_lean_compiler_externattr_1__syntaxToExternEntries___boxed(obj*, obj*, obj*); obj* l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1___lambda__1___boxed(obj*); obj* l_Lean_registerPersistentEnvExtensionUnsafe___rarg(obj*, obj*); +obj* l_Lean_mkExternAttr___closed__4; obj* l___private_init_lean_compiler_externattr_1__syntaxToExternEntries___main___closed__2; namespace lean { obj* nat_mul(obj*, obj*); } obj* l_Lean_Syntax_isIdOrAtom___main(obj*); -extern "C" obj* lean_get_extern_attr_data(obj*, obj*); obj* l_Lean_ExternEntry_backend___main(obj*); obj* l_Array_qsortAux___main___at_Lean_mkExternAttr___spec__3(obj*, obj*, obj*); obj* l___private_init_lean_compiler_externattr_1__syntaxToExternEntries___main(obj*, obj*, obj*); @@ -1144,229 +1145,232 @@ x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttri return x_1; } } -obj* l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1(obj* x_1, obj* x_2, obj* x_3, obj* x_4) { +obj* l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) { _start: { -obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; -x_5 = l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1___closed__1; -x_6 = l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1___closed__2; -x_7 = l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1___closed__3; -x_8 = l_Lean_registerParametricAttribute___rarg___closed__2; +obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; +x_6 = l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1___closed__1; +x_7 = l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1___closed__2; +x_8 = l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1___closed__3; +x_9 = l_Lean_registerParametricAttribute___rarg___closed__2; lean::inc(x_1); -x_9 = lean::alloc_cnstr(0, 5, 0); -lean::cnstr_set(x_9, 0, x_1); -lean::cnstr_set(x_9, 1, x_5); -lean::cnstr_set(x_9, 2, x_6); -lean::cnstr_set(x_9, 3, x_7); -lean::cnstr_set(x_9, 4, x_8); -x_10 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg(x_9, x_4); -if (lean::obj_tag(x_10) == 0) +x_10 = lean::alloc_cnstr(0, 5, 0); +lean::cnstr_set(x_10, 0, x_1); +lean::cnstr_set(x_10, 1, x_6); +lean::cnstr_set(x_10, 2, x_7); +lean::cnstr_set(x_10, 3, x_8); +lean::cnstr_set(x_10, 4, x_9); +x_11 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg(x_10, x_5); +if (lean::obj_tag(x_11) == 0) { -uint8 x_11; -x_11 = !lean::is_exclusive(x_10); -if (x_11 == 0) +uint8 x_12; +x_12 = !lean::is_exclusive(x_11); +if (x_12 == 0) { -obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; uint8 x_19; obj* x_20; obj* x_21; -x_12 = lean::cnstr_get(x_10, 0); -x_13 = lean::box(0); -lean::cnstr_set(x_10, 0, x_13); -lean::inc(x_12); +obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; uint8 x_20; obj* x_21; obj* x_22; +x_13 = lean::cnstr_get(x_11, 0); +x_14 = lean::box(0); +lean::cnstr_set(x_11, 0, x_14); +lean::inc(x_13); lean::inc(x_1); -x_14 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 8, 3); -lean::closure_set(x_14, 0, x_1); -lean::closure_set(x_14, 1, x_3); -lean::closure_set(x_14, 2, x_12); -lean::inc(x_1); -x_15 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); +x_15 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 9, 4); lean::closure_set(x_15, 0, x_1); +lean::closure_set(x_15, 1, x_3); +lean::closure_set(x_15, 2, x_13); +lean::closure_set(x_15, 3, x_4); lean::inc(x_1); -x_16 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +x_16 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); lean::closure_set(x_16, 0, x_1); -x_17 = l_Lean_registerTagAttribute___closed__5; -x_18 = l_Lean_registerTagAttribute___closed__6; -x_19 = 0; -x_20 = lean::alloc_cnstr(0, 8, 1); -lean::cnstr_set(x_20, 0, x_1); -lean::cnstr_set(x_20, 1, x_2); -lean::cnstr_set(x_20, 2, x_14); -lean::cnstr_set(x_20, 3, x_15); -lean::cnstr_set(x_20, 4, x_16); -lean::cnstr_set(x_20, 5, x_17); -lean::cnstr_set(x_20, 6, x_18); -lean::cnstr_set(x_20, 7, x_18); -lean::cnstr_set_scalar(x_20, sizeof(void*)*8, x_19); -lean::inc(x_20); -x_21 = l_Lean_registerAttribute(x_20, x_10); -if (lean::obj_tag(x_21) == 0) +lean::inc(x_1); +x_17 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +lean::closure_set(x_17, 0, x_1); +x_18 = l_Lean_registerTagAttribute___closed__5; +x_19 = l_Lean_registerTagAttribute___closed__6; +x_20 = 0; +x_21 = lean::alloc_cnstr(0, 8, 1); +lean::cnstr_set(x_21, 0, x_1); +lean::cnstr_set(x_21, 1, x_2); +lean::cnstr_set(x_21, 2, x_15); +lean::cnstr_set(x_21, 3, x_16); +lean::cnstr_set(x_21, 4, x_17); +lean::cnstr_set(x_21, 5, x_18); +lean::cnstr_set(x_21, 6, x_19); +lean::cnstr_set(x_21, 7, x_19); +lean::cnstr_set_scalar(x_21, sizeof(void*)*8, x_20); +lean::inc(x_21); +x_22 = l_Lean_registerAttribute(x_21, x_11); +if (lean::obj_tag(x_22) == 0) { -uint8 x_22; -x_22 = !lean::is_exclusive(x_21); -if (x_22 == 0) +uint8 x_23; +x_23 = !lean::is_exclusive(x_22); +if (x_23 == 0) { -obj* x_23; obj* x_24; -x_23 = lean::cnstr_get(x_21, 0); -lean::dec(x_23); -x_24 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_24, 0, x_20); -lean::cnstr_set(x_24, 1, x_12); -lean::cnstr_set(x_21, 0, x_24); -return x_21; +obj* x_24; obj* x_25; +x_24 = lean::cnstr_get(x_22, 0); +lean::dec(x_24); +x_25 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_25, 0, x_21); +lean::cnstr_set(x_25, 1, x_13); +lean::cnstr_set(x_22, 0, x_25); +return x_22; } else { -obj* x_25; obj* x_26; obj* x_27; -x_25 = lean::cnstr_get(x_21, 1); -lean::inc(x_25); -lean::dec(x_21); -x_26 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_26, 0, x_20); -lean::cnstr_set(x_26, 1, x_12); +obj* x_26; obj* x_27; obj* x_28; +x_26 = lean::cnstr_get(x_22, 1); +lean::inc(x_26); +lean::dec(x_22); x_27 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_27, 0, x_26); -lean::cnstr_set(x_27, 1, x_25); -return x_27; +lean::cnstr_set(x_27, 0, x_21); +lean::cnstr_set(x_27, 1, x_13); +x_28 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_28, 0, x_27); +lean::cnstr_set(x_28, 1, x_26); +return x_28; } } else { -uint8 x_28; -lean::dec(x_20); -lean::dec(x_12); -x_28 = !lean::is_exclusive(x_21); -if (x_28 == 0) -{ -return x_21; -} -else -{ -obj* x_29; obj* x_30; obj* x_31; -x_29 = lean::cnstr_get(x_21, 0); -x_30 = lean::cnstr_get(x_21, 1); -lean::inc(x_30); -lean::inc(x_29); +uint8 x_29; lean::dec(x_21); -x_31 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_31, 0, x_29); -lean::cnstr_set(x_31, 1, x_30); -return x_31; +lean::dec(x_13); +x_29 = !lean::is_exclusive(x_22); +if (x_29 == 0) +{ +return x_22; +} +else +{ +obj* x_30; obj* x_31; obj* x_32; +x_30 = lean::cnstr_get(x_22, 0); +x_31 = lean::cnstr_get(x_22, 1); +lean::inc(x_31); +lean::inc(x_30); +lean::dec(x_22); +x_32 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_32, 0, x_30); +lean::cnstr_set(x_32, 1, x_31); +return x_32; } } } else { -obj* x_32; obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; uint8 x_41; obj* x_42; obj* x_43; -x_32 = lean::cnstr_get(x_10, 0); -x_33 = lean::cnstr_get(x_10, 1); +obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; obj* x_41; uint8 x_42; obj* x_43; obj* x_44; +x_33 = lean::cnstr_get(x_11, 0); +x_34 = lean::cnstr_get(x_11, 1); +lean::inc(x_34); +lean::inc(x_33); +lean::dec(x_11); +x_35 = lean::box(0); +x_36 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_36, 0, x_35); +lean::cnstr_set(x_36, 1, x_34); lean::inc(x_33); -lean::inc(x_32); -lean::dec(x_10); -x_34 = lean::box(0); -x_35 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_35, 0, x_34); -lean::cnstr_set(x_35, 1, x_33); -lean::inc(x_32); lean::inc(x_1); -x_36 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 8, 3); -lean::closure_set(x_36, 0, x_1); -lean::closure_set(x_36, 1, x_3); -lean::closure_set(x_36, 2, x_32); -lean::inc(x_1); -x_37 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); +x_37 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 9, 4); lean::closure_set(x_37, 0, x_1); +lean::closure_set(x_37, 1, x_3); +lean::closure_set(x_37, 2, x_33); +lean::closure_set(x_37, 3, x_4); lean::inc(x_1); -x_38 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +x_38 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); lean::closure_set(x_38, 0, x_1); -x_39 = l_Lean_registerTagAttribute___closed__5; -x_40 = l_Lean_registerTagAttribute___closed__6; -x_41 = 0; -x_42 = lean::alloc_cnstr(0, 8, 1); -lean::cnstr_set(x_42, 0, x_1); -lean::cnstr_set(x_42, 1, x_2); -lean::cnstr_set(x_42, 2, x_36); -lean::cnstr_set(x_42, 3, x_37); -lean::cnstr_set(x_42, 4, x_38); -lean::cnstr_set(x_42, 5, x_39); -lean::cnstr_set(x_42, 6, x_40); -lean::cnstr_set(x_42, 7, x_40); -lean::cnstr_set_scalar(x_42, sizeof(void*)*8, x_41); -lean::inc(x_42); -x_43 = l_Lean_registerAttribute(x_42, x_35); -if (lean::obj_tag(x_43) == 0) +lean::inc(x_1); +x_39 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +lean::closure_set(x_39, 0, x_1); +x_40 = l_Lean_registerTagAttribute___closed__5; +x_41 = l_Lean_registerTagAttribute___closed__6; +x_42 = 0; +x_43 = lean::alloc_cnstr(0, 8, 1); +lean::cnstr_set(x_43, 0, x_1); +lean::cnstr_set(x_43, 1, x_2); +lean::cnstr_set(x_43, 2, x_37); +lean::cnstr_set(x_43, 3, x_38); +lean::cnstr_set(x_43, 4, x_39); +lean::cnstr_set(x_43, 5, x_40); +lean::cnstr_set(x_43, 6, x_41); +lean::cnstr_set(x_43, 7, x_41); +lean::cnstr_set_scalar(x_43, sizeof(void*)*8, x_42); +lean::inc(x_43); +x_44 = l_Lean_registerAttribute(x_43, x_36); +if (lean::obj_tag(x_44) == 0) { -obj* x_44; obj* x_45; obj* x_46; obj* x_47; -x_44 = lean::cnstr_get(x_43, 1); -lean::inc(x_44); -if (lean::is_exclusive(x_43)) { - lean::cnstr_release(x_43, 0); - lean::cnstr_release(x_43, 1); - x_45 = x_43; +obj* x_45; obj* x_46; obj* x_47; obj* x_48; +x_45 = lean::cnstr_get(x_44, 1); +lean::inc(x_45); +if (lean::is_exclusive(x_44)) { + lean::cnstr_release(x_44, 0); + lean::cnstr_release(x_44, 1); + x_46 = x_44; } else { - lean::dec_ref(x_43); - x_45 = lean::box(0); + lean::dec_ref(x_44); + x_46 = lean::box(0); } -x_46 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_46, 0, x_42); -lean::cnstr_set(x_46, 1, x_32); -if (lean::is_scalar(x_45)) { - x_47 = lean::alloc_cnstr(0, 2, 0); +x_47 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_47, 0, x_43); +lean::cnstr_set(x_47, 1, x_33); +if (lean::is_scalar(x_46)) { + x_48 = lean::alloc_cnstr(0, 2, 0); } else { - x_47 = x_45; + x_48 = x_46; } -lean::cnstr_set(x_47, 0, x_46); -lean::cnstr_set(x_47, 1, x_44); -return x_47; +lean::cnstr_set(x_48, 0, x_47); +lean::cnstr_set(x_48, 1, x_45); +return x_48; } else { -obj* x_48; obj* x_49; obj* x_50; obj* x_51; -lean::dec(x_42); -lean::dec(x_32); -x_48 = lean::cnstr_get(x_43, 0); -lean::inc(x_48); -x_49 = lean::cnstr_get(x_43, 1); +obj* x_49; obj* x_50; obj* x_51; obj* x_52; +lean::dec(x_43); +lean::dec(x_33); +x_49 = lean::cnstr_get(x_44, 0); lean::inc(x_49); -if (lean::is_exclusive(x_43)) { - lean::cnstr_release(x_43, 0); - lean::cnstr_release(x_43, 1); - x_50 = x_43; +x_50 = lean::cnstr_get(x_44, 1); +lean::inc(x_50); +if (lean::is_exclusive(x_44)) { + lean::cnstr_release(x_44, 0); + lean::cnstr_release(x_44, 1); + x_51 = x_44; } else { - lean::dec_ref(x_43); - x_50 = lean::box(0); + lean::dec_ref(x_44); + x_51 = lean::box(0); } -if (lean::is_scalar(x_50)) { - x_51 = lean::alloc_cnstr(1, 2, 0); +if (lean::is_scalar(x_51)) { + x_52 = lean::alloc_cnstr(1, 2, 0); } else { - x_51 = x_50; + x_52 = x_51; } -lean::cnstr_set(x_51, 0, x_48); -lean::cnstr_set(x_51, 1, x_49); -return x_51; +lean::cnstr_set(x_52, 0, x_49); +lean::cnstr_set(x_52, 1, x_50); +return x_52; } } } else { -uint8 x_52; +uint8 x_53; +lean::dec(x_4); lean::dec(x_3); lean::dec(x_2); lean::dec(x_1); -x_52 = !lean::is_exclusive(x_10); -if (x_52 == 0) +x_53 = !lean::is_exclusive(x_11); +if (x_53 == 0) { -return x_10; +return x_11; } else { -obj* x_53; obj* x_54; obj* x_55; -x_53 = lean::cnstr_get(x_10, 0); -x_54 = lean::cnstr_get(x_10, 1); +obj* x_54; obj* x_55; obj* x_56; +x_54 = lean::cnstr_get(x_11, 0); +x_55 = lean::cnstr_get(x_11, 1); +lean::inc(x_55); lean::inc(x_54); -lean::inc(x_53); -lean::dec(x_10); -x_55 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_55, 0, x_53); -lean::cnstr_set(x_55, 1, x_54); -return x_55; +lean::dec(x_11); +x_56 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_56, 0, x_54); +lean::cnstr_set(x_56, 1, x_55); +return x_56; } } } @@ -1376,288 +1380,41 @@ _start: { obj* x_4; x_4 = l___private_init_lean_compiler_externattr_2__syntaxToExternAttrData(x_3); -if (lean::obj_tag(x_4) == 0) +return x_4; +} +} +obj* l_Lean_mkExternAttr___lambda__2(obj* x_1, obj* x_2, obj* x_3) { +_start: +{ +uint8 x_4; +lean::inc(x_2); +x_4 = l_Lean_Environment_isProjectionFn(x_1, x_2); +if (x_4 == 0) { uint8 x_5; -lean::dec(x_2); -lean::dec(x_1); -x_5 = !lean::is_exclusive(x_4); +lean::inc(x_2); +lean::inc(x_1); +x_5 = l_Lean_Environment_isConstructor(x_1, x_2); if (x_5 == 0) { -return x_4; +obj* x_6; +lean::dec(x_2); +x_6 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_6, 0, x_1); +return x_6; } else { -obj* x_6; obj* x_7; -x_6 = lean::cnstr_get(x_4, 0); -lean::inc(x_6); -lean::dec(x_4); -x_7 = lean::alloc_cnstr(0, 1, 0); -lean::cnstr_set(x_7, 0, x_6); +obj* x_7; +x_7 = lean_add_extern(x_1, x_2); return x_7; } } else { -uint8 x_8; -x_8 = !lean::is_exclusive(x_4); -if (x_8 == 0) -{ -obj* x_9; uint8 x_10; -x_9 = lean::cnstr_get(x_4, 0); -lean::inc(x_2); -x_10 = l_Lean_Environment_isProjectionFn(x_1, x_2); -if (x_10 == 0) -{ -uint8 x_11; -lean::inc(x_2); -lean::inc(x_1); -x_11 = l_Lean_Environment_isConstructor(x_1, x_2); -if (x_11 == 0) -{ -obj* x_12; -lean::dec(x_2); -x_12 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_12, 0, x_9); -lean::cnstr_set(x_12, 1, x_1); -lean::cnstr_set(x_4, 0, x_12); -return x_4; -} -else -{ -obj* x_13; -lean::free_heap_obj(x_4); -x_13 = lean_add_extern(x_1, x_2); -if (lean::obj_tag(x_13) == 0) -{ -uint8 x_14; -lean::dec(x_9); -x_14 = !lean::is_exclusive(x_13); -if (x_14 == 0) -{ -return x_13; -} -else -{ -obj* x_15; obj* x_16; -x_15 = lean::cnstr_get(x_13, 0); -lean::inc(x_15); -lean::dec(x_13); -x_16 = lean::alloc_cnstr(0, 1, 0); -lean::cnstr_set(x_16, 0, x_15); -return x_16; -} -} -else -{ -uint8 x_17; -x_17 = !lean::is_exclusive(x_13); -if (x_17 == 0) -{ -obj* x_18; obj* x_19; -x_18 = lean::cnstr_get(x_13, 0); -x_19 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_19, 0, x_9); -lean::cnstr_set(x_19, 1, x_18); -lean::cnstr_set(x_13, 0, x_19); -return x_13; -} -else -{ -obj* x_20; obj* x_21; obj* x_22; -x_20 = lean::cnstr_get(x_13, 0); -lean::inc(x_20); -lean::dec(x_13); -x_21 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_21, 0, x_9); -lean::cnstr_set(x_21, 1, x_20); -x_22 = lean::alloc_cnstr(1, 1, 0); -lean::cnstr_set(x_22, 0, x_21); -return x_22; -} -} -} -} -else -{ -obj* x_23; -lean::free_heap_obj(x_4); -x_23 = lean_add_extern(x_1, x_2); -if (lean::obj_tag(x_23) == 0) -{ -uint8 x_24; -lean::dec(x_9); -x_24 = !lean::is_exclusive(x_23); -if (x_24 == 0) -{ -return x_23; -} -else -{ -obj* x_25; obj* x_26; -x_25 = lean::cnstr_get(x_23, 0); -lean::inc(x_25); -lean::dec(x_23); -x_26 = lean::alloc_cnstr(0, 1, 0); -lean::cnstr_set(x_26, 0, x_25); -return x_26; -} -} -else -{ -uint8 x_27; -x_27 = !lean::is_exclusive(x_23); -if (x_27 == 0) -{ -obj* x_28; obj* x_29; -x_28 = lean::cnstr_get(x_23, 0); -x_29 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_29, 0, x_9); -lean::cnstr_set(x_29, 1, x_28); -lean::cnstr_set(x_23, 0, x_29); -return x_23; -} -else -{ -obj* x_30; obj* x_31; obj* x_32; -x_30 = lean::cnstr_get(x_23, 0); -lean::inc(x_30); -lean::dec(x_23); -x_31 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_31, 0, x_9); -lean::cnstr_set(x_31, 1, x_30); -x_32 = lean::alloc_cnstr(1, 1, 0); -lean::cnstr_set(x_32, 0, x_31); -return x_32; -} -} -} -} -else -{ -obj* x_33; uint8 x_34; -x_33 = lean::cnstr_get(x_4, 0); -lean::inc(x_33); -lean::dec(x_4); -lean::inc(x_2); -x_34 = l_Lean_Environment_isProjectionFn(x_1, x_2); -if (x_34 == 0) -{ -uint8 x_35; -lean::inc(x_2); -lean::inc(x_1); -x_35 = l_Lean_Environment_isConstructor(x_1, x_2); -if (x_35 == 0) -{ -obj* x_36; obj* x_37; -lean::dec(x_2); -x_36 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_36, 0, x_33); -lean::cnstr_set(x_36, 1, x_1); -x_37 = lean::alloc_cnstr(1, 1, 0); -lean::cnstr_set(x_37, 0, x_36); -return x_37; -} -else -{ -obj* x_38; -x_38 = lean_add_extern(x_1, x_2); -if (lean::obj_tag(x_38) == 0) -{ -obj* x_39; obj* x_40; obj* x_41; -lean::dec(x_33); -x_39 = lean::cnstr_get(x_38, 0); -lean::inc(x_39); -if (lean::is_exclusive(x_38)) { - lean::cnstr_release(x_38, 0); - x_40 = x_38; -} else { - lean::dec_ref(x_38); - x_40 = lean::box(0); -} -if (lean::is_scalar(x_40)) { - x_41 = lean::alloc_cnstr(0, 1, 0); -} else { - x_41 = x_40; -} -lean::cnstr_set(x_41, 0, x_39); -return x_41; -} -else -{ -obj* x_42; obj* x_43; obj* x_44; obj* x_45; -x_42 = lean::cnstr_get(x_38, 0); -lean::inc(x_42); -if (lean::is_exclusive(x_38)) { - lean::cnstr_release(x_38, 0); - x_43 = x_38; -} else { - lean::dec_ref(x_38); - x_43 = lean::box(0); -} -x_44 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_44, 0, x_33); -lean::cnstr_set(x_44, 1, x_42); -if (lean::is_scalar(x_43)) { - x_45 = lean::alloc_cnstr(1, 1, 0); -} else { - x_45 = x_43; -} -lean::cnstr_set(x_45, 0, x_44); -return x_45; -} -} -} -else -{ -obj* x_46; -x_46 = lean_add_extern(x_1, x_2); -if (lean::obj_tag(x_46) == 0) -{ -obj* x_47; obj* x_48; obj* x_49; -lean::dec(x_33); -x_47 = lean::cnstr_get(x_46, 0); -lean::inc(x_47); -if (lean::is_exclusive(x_46)) { - lean::cnstr_release(x_46, 0); - x_48 = x_46; -} else { - lean::dec_ref(x_46); - x_48 = lean::box(0); -} -if (lean::is_scalar(x_48)) { - x_49 = lean::alloc_cnstr(0, 1, 0); -} else { - x_49 = x_48; -} -lean::cnstr_set(x_49, 0, x_47); -return x_49; -} -else -{ -obj* x_50; obj* x_51; obj* x_52; obj* x_53; -x_50 = lean::cnstr_get(x_46, 0); -lean::inc(x_50); -if (lean::is_exclusive(x_46)) { - lean::cnstr_release(x_46, 0); - x_51 = x_46; -} else { - lean::dec_ref(x_46); - x_51 = lean::box(0); -} -x_52 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_52, 0, x_33); -lean::cnstr_set(x_52, 1, x_50); -if (lean::is_scalar(x_51)) { - x_53 = lean::alloc_cnstr(1, 1, 0); -} else { - x_53 = x_51; -} -lean::cnstr_set(x_53, 0, x_52); -return x_53; -} -} -} +obj* x_8; +x_8 = lean_add_extern(x_1, x_2); +return x_8; } } } @@ -1687,15 +1444,24 @@ x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_mkExternAttr___lambda__ return x_1; } } +obj* _init_l_Lean_mkExternAttr___closed__4() { +_start: +{ +obj* x_1; +x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_mkExternAttr___lambda__2___boxed), 3, 0); +return x_1; +} +} obj* l_Lean_mkExternAttr(obj* x_1) { _start: { -obj* x_2; obj* x_3; obj* x_4; obj* x_5; +obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_6; x_2 = l_Lean_mkExternAttr___closed__1; x_3 = l_Lean_mkExternAttr___closed__2; x_4 = l_Lean_mkExternAttr___closed__3; -x_5 = l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1(x_2, x_3, x_4, x_1); -return x_5; +x_5 = l_Lean_mkExternAttr___closed__4; +x_6 = l_Lean_registerParametricAttribute___at_Lean_mkExternAttr___spec__1(x_2, x_3, x_4, x_5, x_1); +return x_6; } } obj* l_RBNode_fold___main___at_Lean_mkExternAttr___spec__2___boxed(obj* x_1, obj* x_2) { @@ -1741,6 +1507,17 @@ _start: obj* x_4; x_4 = l_Lean_mkExternAttr___lambda__1(x_1, x_2, x_3); lean::dec(x_3); +lean::dec(x_2); +lean::dec(x_1); +return x_4; +} +} +obj* l_Lean_mkExternAttr___lambda__2___boxed(obj* x_1, obj* x_2, obj* x_3) { +_start: +{ +obj* x_4; +x_4 = l_Lean_mkExternAttr___lambda__2(x_1, x_2, x_3); +lean::dec(x_3); return x_4; } } @@ -2458,31 +2235,24 @@ return x_7; } } } -obj* l_Lean_getExternAttrDataOld___boxed(obj* x_1, obj* x_2) { -_start: -{ -obj* x_3; -x_3 = lean_get_extern_attr_data(x_1, x_2); -return x_3; -} -} uint8 l_Lean_isExtern(obj* x_1, obj* x_2) { _start: { -obj* x_3; -x_3 = lean_get_extern_attr_data(x_1, x_2); -if (lean::obj_tag(x_3) == 0) +obj* x_3; obj* x_4; +x_3 = l_Lean_externAttr; +x_4 = l_Lean_ParametricAttribute_getParam___at_Lean_getExternAttrData___spec__1(x_3, x_1, x_2); +if (lean::obj_tag(x_4) == 0) { -uint8 x_4; -x_4 = 0; -return x_4; +uint8 x_5; +x_5 = 0; +return x_5; } else { -uint8 x_5; -lean::dec(x_3); -x_5 = 1; -return x_5; +uint8 x_6; +lean::dec(x_4); +x_6 = 1; +return x_6; } } } @@ -2491,7 +2261,6 @@ _start: { uint8 x_3; obj* x_4; x_3 = l_Lean_isExtern(x_1, x_2); -lean::dec(x_2); lean::dec(x_1); x_4 = lean::box(x_3); return x_4; @@ -2500,77 +2269,78 @@ return x_4; uint8 l_Lean_isExternC(obj* x_1, obj* x_2) { _start: { -obj* x_3; -x_3 = lean_get_extern_attr_data(x_1, x_2); -if (lean::obj_tag(x_3) == 0) +obj* x_3; obj* x_4; +x_3 = l_Lean_externAttr; +x_4 = l_Lean_ParametricAttribute_getParam___at_Lean_getExternAttrData___spec__1(x_3, x_1, x_2); +if (lean::obj_tag(x_4) == 0) { -uint8 x_4; -x_4 = 0; -return x_4; +uint8 x_5; +x_5 = 0; +return x_5; } else { -obj* x_5; obj* x_6; -x_5 = lean::cnstr_get(x_3, 0); -lean::inc(x_5); -lean::dec(x_3); -x_6 = lean::cnstr_get(x_5, 1); +obj* x_6; obj* x_7; +x_6 = lean::cnstr_get(x_4, 0); lean::inc(x_6); -lean::dec(x_5); -if (lean::obj_tag(x_6) == 0) -{ -uint8 x_7; -x_7 = 0; -return x_7; -} -else -{ -obj* x_8; -x_8 = lean::cnstr_get(x_6, 0); -lean::inc(x_8); -if (lean::obj_tag(x_8) == 2) -{ -obj* x_9; obj* x_10; obj* x_11; uint8 x_12; -x_9 = lean::cnstr_get(x_6, 1); -lean::inc(x_9); +lean::dec(x_4); +x_7 = lean::cnstr_get(x_6, 1); +lean::inc(x_7); lean::dec(x_6); -x_10 = lean::cnstr_get(x_8, 0); -lean::inc(x_10); -lean::dec(x_8); -x_11 = l___private_init_lean_compiler_externattr_2__syntaxToExternAttrData___closed__3; -x_12 = lean_name_dec_eq(x_10, x_11); -lean::dec(x_10); -if (x_12 == 0) +if (lean::obj_tag(x_7) == 0) { -uint8 x_13; -lean::dec(x_9); -x_13 = 0; -return x_13; +uint8 x_8; +x_8 = 0; +return x_8; } else { -if (lean::obj_tag(x_9) == 0) +obj* x_9; +x_9 = lean::cnstr_get(x_7, 0); +lean::inc(x_9); +if (lean::obj_tag(x_9) == 2) +{ +obj* x_10; obj* x_11; obj* x_12; uint8 x_13; +x_10 = lean::cnstr_get(x_7, 1); +lean::inc(x_10); +lean::dec(x_7); +x_11 = lean::cnstr_get(x_9, 0); +lean::inc(x_11); +lean::dec(x_9); +x_12 = l___private_init_lean_compiler_externattr_2__syntaxToExternAttrData___closed__3; +x_13 = lean_name_dec_eq(x_11, x_12); +lean::dec(x_11); +if (x_13 == 0) { uint8 x_14; -x_14 = 1; +lean::dec(x_10); +x_14 = 0; return x_14; } else { +if (lean::obj_tag(x_10) == 0) +{ uint8 x_15; -lean::dec(x_9); -x_15 = 0; +x_15 = 1; return x_15; } +else +{ +uint8 x_16; +lean::dec(x_10); +x_16 = 0; +return x_16; +} } } else { -uint8 x_16; -lean::dec(x_8); -lean::dec(x_6); -x_16 = 0; -return x_16; +uint8 x_17; +lean::dec(x_9); +lean::dec(x_7); +x_17 = 0; +return x_17; } } } @@ -2581,7 +2351,6 @@ _start: { uint8 x_3; obj* x_4; x_3 = l_Lean_isExternC(x_1, x_2); -lean::dec(x_2); lean::dec(x_1); x_4 = lean::box(x_3); return x_4; @@ -2590,94 +2359,95 @@ return x_4; obj* l_Lean_getExternNameFor(obj* x_1, obj* x_2, obj* x_3) { _start: { -obj* x_4; -x_4 = lean_get_extern_attr_data(x_1, x_3); -if (lean::obj_tag(x_4) == 0) +obj* x_4; obj* x_5; +x_4 = l_Lean_externAttr; +x_5 = l_Lean_ParametricAttribute_getParam___at_Lean_getExternAttrData___spec__1(x_4, x_1, x_3); +if (lean::obj_tag(x_5) == 0) { -obj* x_5; +obj* x_6; lean::dec(x_2); -x_5 = lean::box(0); -return x_5; +x_6 = lean::box(0); +return x_6; } else { -obj* x_6; obj* x_7; -x_6 = lean::cnstr_get(x_4, 0); -lean::inc(x_6); -lean::dec(x_4); -x_7 = lean::get_extern_entry_for_core(x_6, x_2); -if (lean::obj_tag(x_7) == 0) +obj* x_7; obj* x_8; +x_7 = lean::cnstr_get(x_5, 0); +lean::inc(x_7); +lean::dec(x_5); +x_8 = lean::get_extern_entry_for_core(x_7, x_2); +if (lean::obj_tag(x_8) == 0) { -obj* x_8; -x_8 = lean::box(0); -return x_8; +obj* x_9; +x_9 = lean::box(0); +return x_9; } else { -uint8 x_9; -x_9 = !lean::is_exclusive(x_7); -if (x_9 == 0) -{ -obj* x_10; -x_10 = lean::cnstr_get(x_7, 0); -switch (lean::obj_tag(x_10)) { -case 0: +uint8 x_10; +x_10 = !lean::is_exclusive(x_8); +if (x_10 == 0) { obj* x_11; -lean::free_heap_obj(x_7); -lean::dec(x_10); -x_11 = lean::box(0); -return x_11; -} -case 1: +x_11 = lean::cnstr_get(x_8, 0); +switch (lean::obj_tag(x_11)) { +case 0: { obj* x_12; -lean::free_heap_obj(x_7); -lean::dec(x_10); +lean::free_heap_obj(x_8); +lean::dec(x_11); x_12 = lean::box(0); return x_12; } -default: +case 1: { obj* x_13; -x_13 = lean::cnstr_get(x_10, 1); -lean::inc(x_13); -lean::dec(x_10); -lean::cnstr_set(x_7, 0, x_13); -return x_7; +lean::free_heap_obj(x_8); +lean::dec(x_11); +x_13 = lean::box(0); +return x_13; +} +default: +{ +obj* x_14; +x_14 = lean::cnstr_get(x_11, 1); +lean::inc(x_14); +lean::dec(x_11); +lean::cnstr_set(x_8, 0, x_14); +return x_8; } } } else { -obj* x_14; -x_14 = lean::cnstr_get(x_7, 0); -lean::inc(x_14); -lean::dec(x_7); -switch (lean::obj_tag(x_14)) { +obj* x_15; +x_15 = lean::cnstr_get(x_8, 0); +lean::inc(x_15); +lean::dec(x_8); +switch (lean::obj_tag(x_15)) { case 0: { -obj* x_15; -lean::dec(x_14); -x_15 = lean::box(0); -return x_15; -} -case 1: -{ obj* x_16; -lean::dec(x_14); +lean::dec(x_15); x_16 = lean::box(0); return x_16; } +case 1: +{ +obj* x_17; +lean::dec(x_15); +x_17 = lean::box(0); +return x_17; +} default: { -obj* x_17; obj* x_18; -x_17 = lean::cnstr_get(x_14, 1); -lean::inc(x_17); -lean::dec(x_14); -x_18 = lean::alloc_cnstr(1, 1, 0); -lean::cnstr_set(x_18, 0, x_17); -return x_18; +obj* x_18; obj* x_19; +x_18 = lean::cnstr_get(x_15, 1); +lean::inc(x_18); +lean::dec(x_15); +x_19 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_19, 0, x_18); +return x_19; } } } @@ -2690,7 +2460,6 @@ _start: { obj* x_4; x_4 = l_Lean_getExternNameFor(x_1, x_2, x_3); -lean::dec(x_3); lean::dec(x_1); return x_4; } @@ -2756,6 +2525,8 @@ l_Lean_mkExternAttr___closed__2 = _init_l_Lean_mkExternAttr___closed__2(); lean::mark_persistent(l_Lean_mkExternAttr___closed__2); l_Lean_mkExternAttr___closed__3 = _init_l_Lean_mkExternAttr___closed__3(); lean::mark_persistent(l_Lean_mkExternAttr___closed__3); +l_Lean_mkExternAttr___closed__4 = _init_l_Lean_mkExternAttr___closed__4(); +lean::mark_persistent(l_Lean_mkExternAttr___closed__4); REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "mkExternAttr"), 1, l_Lean_mkExternAttr); w = l_Lean_mkExternAttr(w); if (io_result_is_error(w)) return w; @@ -2773,7 +2544,6 @@ REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name(lean::mk_const_na REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "getExternEntryForAux"), 2, l_Lean_getExternEntryForAux___boxed); REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "getExternEntryFor"), 2, lean::get_extern_entry_for_core); REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "mkExternCall"), 3, lean::mk_extern_call_core); -REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "getExternAttrDataOld"), 2, l_Lean_getExternAttrDataOld___boxed); REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "isExtern"), 2, l_Lean_isExtern___boxed); REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "isExternC"), 2, l_Lean_isExternC___boxed); REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "getExternNameFor"), 3, l_Lean_getExternNameFor___boxed); diff --git a/src/stage0/init/lean/compiler/initattr.cpp b/src/stage0/init/lean/compiler/initattr.cpp index cfe484ab78..3c8b5f43ef 100644 --- a/src/stage0/init/lean/compiler/initattr.cpp +++ b/src/stage0/init/lean/compiler/initattr.cpp @@ -15,6 +15,7 @@ typedef lean::uint32 uint32; typedef lean::uint64 uint64; #pragma GCC diagnostic ignored "-Wunused-but-set-variable" #endif obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAttr___spec__4(obj*, obj*, obj*, obj*, obj*); +obj* l_Lean_attrParamSyntaxToIdentifier(obj*); extern "C" uint8 lean_name_dec_eq(obj*, obj*); obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg___main___boxed(obj*); obj* l_Array_binSearchAux___main___at_Lean_isIOUnitInitFn___spec__3___boxed(obj*, obj*, obj*, obj*); @@ -45,6 +46,7 @@ obj* l_Lean_Name_toStringWithSep___main(obj*, obj*); obj* l_Lean_mkInitAttr___lambda__1___closed__1; extern obj* l_Lean_Inhabited; obj* l_Array_qsortAux___main___at_Lean_mkInitAttr___spec__3(obj*, obj*, obj*); +obj* l_Lean_mkInitAttr___lambda__1___closed__8; extern obj* l_Lean_registerParametricAttribute___rarg___closed__1; obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg___main___closed__1; obj* l_Array_mkEmpty(obj*, obj*); @@ -77,6 +79,7 @@ namespace lean { obj* nat_add(obj*, obj*); } obj* l_Lean_PersistentEnvExtension_getModuleEntries___rarg(obj*, obj*, obj*); +obj* l_Lean_mkInitAttr___lambda__1___boxed(obj*, obj*, obj*); namespace lean { uint8 nat_dec_eq(obj*, obj*); } @@ -89,10 +92,11 @@ obj* l___private_init_data_array_qsort_1__partitionAux___main___at_Lean_mkInitAt obj* l_Lean_mkInitAttr___lambda__1___closed__3; obj* l_Array_binSearchAux___main___at_Lean_isIOUnitInitFn___spec__3(obj*, obj*, obj*, obj*); obj* l_Lean_ParametricAttribute_getParam___at_Lean_isIOUnitInitFn___spec__1(obj*, obj*, obj*); -obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*); -obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1(obj*, obj*, obj*, obj*); +obj* l_Lean_registerParametricAttribute___rarg___lambda__4___boxed(obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*, obj*); +obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1(obj*, obj*, obj*, obj*, obj*); obj* l___private_init_lean_compiler_initattr_2__isUnitType___main___boxed(obj*); obj* l_Lean_mkInitAttr___lambda__1___closed__6; +obj* l_Lean_mkInitAttr___closed__4; obj* l_Lean_registerTagAttribute___lambda__7___boxed(obj*, obj*, obj*, obj*, obj*); obj* l___private_init_lean_compiler_initattr_2__isUnitType___main___closed__1; obj* l___private_init_lean_compiler_initattr_1__getIOTypeArg___boxed(obj*); @@ -100,6 +104,7 @@ uint8 l_Lean_Name_quickLt(obj*, obj*); obj* l_Lean_isIOUnitInitFn___boxed(obj*, obj*); obj* l_Lean_ParametricAttribute_setParam___rarg(obj*, obj*, obj*, obj*); obj* l_Lean_ConstantInfo_type(obj*); +obj* l_Lean_mkInitAttr___lambda__2___boxed(obj*, obj*, obj*); namespace lean { obj* environment_find_core(obj*, obj*); } @@ -117,6 +122,7 @@ obj* l_Lean_mkInitAttr___lambda__1___closed__4; namespace lean { obj* nat_div(obj*, obj*); } +obj* l_Lean_mkInitAttr___lambda__2(obj*, obj*, obj*); obj* l_Lean_AttributeImpl_inhabited___lambda__2___boxed(obj*, obj*, obj*, obj*); obj* l_Lean_registerPersistentEnvExtensionUnsafe___rarg(obj*, obj*); uint8 l___private_init_lean_compiler_initattr_3__isIOUnit(obj*); @@ -592,229 +598,232 @@ x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttri return x_1; } } -obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1(obj* x_1, obj* x_2, obj* x_3, obj* x_4) { +obj* l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1(obj* x_1, obj* x_2, obj* x_3, obj* x_4, obj* x_5) { _start: { -obj* x_5; obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; -x_5 = l_Lean_registerTagAttribute___closed__1; -x_6 = l_Lean_registerParametricAttribute___rarg___closed__1; -x_7 = l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___closed__1; -x_8 = l_Lean_registerParametricAttribute___rarg___closed__2; +obj* x_6; obj* x_7; obj* x_8; obj* x_9; obj* x_10; obj* x_11; +x_6 = l_Lean_registerTagAttribute___closed__1; +x_7 = l_Lean_registerParametricAttribute___rarg___closed__1; +x_8 = l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1___closed__1; +x_9 = l_Lean_registerParametricAttribute___rarg___closed__2; lean::inc(x_1); -x_9 = lean::alloc_cnstr(0, 5, 0); -lean::cnstr_set(x_9, 0, x_1); -lean::cnstr_set(x_9, 1, x_5); -lean::cnstr_set(x_9, 2, x_6); -lean::cnstr_set(x_9, 3, x_7); -lean::cnstr_set(x_9, 4, x_8); -x_10 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg(x_9, x_4); -if (lean::obj_tag(x_10) == 0) +x_10 = lean::alloc_cnstr(0, 5, 0); +lean::cnstr_set(x_10, 0, x_1); +lean::cnstr_set(x_10, 1, x_6); +lean::cnstr_set(x_10, 2, x_7); +lean::cnstr_set(x_10, 3, x_8); +lean::cnstr_set(x_10, 4, x_9); +x_11 = l_Lean_registerPersistentEnvExtensionUnsafe___rarg(x_10, x_5); +if (lean::obj_tag(x_11) == 0) { -uint8 x_11; -x_11 = !lean::is_exclusive(x_10); -if (x_11 == 0) +uint8 x_12; +x_12 = !lean::is_exclusive(x_11); +if (x_12 == 0) { -obj* x_12; obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; uint8 x_19; obj* x_20; obj* x_21; -x_12 = lean::cnstr_get(x_10, 0); -x_13 = lean::box(0); -lean::cnstr_set(x_10, 0, x_13); -lean::inc(x_12); +obj* x_13; obj* x_14; obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; uint8 x_20; obj* x_21; obj* x_22; +x_13 = lean::cnstr_get(x_11, 0); +x_14 = lean::box(0); +lean::cnstr_set(x_11, 0, x_14); +lean::inc(x_13); lean::inc(x_1); -x_14 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 8, 3); -lean::closure_set(x_14, 0, x_1); -lean::closure_set(x_14, 1, x_3); -lean::closure_set(x_14, 2, x_12); -lean::inc(x_1); -x_15 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); +x_15 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 9, 4); lean::closure_set(x_15, 0, x_1); +lean::closure_set(x_15, 1, x_3); +lean::closure_set(x_15, 2, x_13); +lean::closure_set(x_15, 3, x_4); lean::inc(x_1); -x_16 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +x_16 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); lean::closure_set(x_16, 0, x_1); -x_17 = l_Lean_registerTagAttribute___closed__5; -x_18 = l_Lean_registerTagAttribute___closed__6; -x_19 = 0; -x_20 = lean::alloc_cnstr(0, 8, 1); -lean::cnstr_set(x_20, 0, x_1); -lean::cnstr_set(x_20, 1, x_2); -lean::cnstr_set(x_20, 2, x_14); -lean::cnstr_set(x_20, 3, x_15); -lean::cnstr_set(x_20, 4, x_16); -lean::cnstr_set(x_20, 5, x_17); -lean::cnstr_set(x_20, 6, x_18); -lean::cnstr_set(x_20, 7, x_18); -lean::cnstr_set_scalar(x_20, sizeof(void*)*8, x_19); -lean::inc(x_20); -x_21 = l_Lean_registerAttribute(x_20, x_10); -if (lean::obj_tag(x_21) == 0) +lean::inc(x_1); +x_17 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +lean::closure_set(x_17, 0, x_1); +x_18 = l_Lean_registerTagAttribute___closed__5; +x_19 = l_Lean_registerTagAttribute___closed__6; +x_20 = 0; +x_21 = lean::alloc_cnstr(0, 8, 1); +lean::cnstr_set(x_21, 0, x_1); +lean::cnstr_set(x_21, 1, x_2); +lean::cnstr_set(x_21, 2, x_15); +lean::cnstr_set(x_21, 3, x_16); +lean::cnstr_set(x_21, 4, x_17); +lean::cnstr_set(x_21, 5, x_18); +lean::cnstr_set(x_21, 6, x_19); +lean::cnstr_set(x_21, 7, x_19); +lean::cnstr_set_scalar(x_21, sizeof(void*)*8, x_20); +lean::inc(x_21); +x_22 = l_Lean_registerAttribute(x_21, x_11); +if (lean::obj_tag(x_22) == 0) { -uint8 x_22; -x_22 = !lean::is_exclusive(x_21); -if (x_22 == 0) +uint8 x_23; +x_23 = !lean::is_exclusive(x_22); +if (x_23 == 0) { -obj* x_23; obj* x_24; -x_23 = lean::cnstr_get(x_21, 0); -lean::dec(x_23); -x_24 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_24, 0, x_20); -lean::cnstr_set(x_24, 1, x_12); -lean::cnstr_set(x_21, 0, x_24); -return x_21; +obj* x_24; obj* x_25; +x_24 = lean::cnstr_get(x_22, 0); +lean::dec(x_24); +x_25 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_25, 0, x_21); +lean::cnstr_set(x_25, 1, x_13); +lean::cnstr_set(x_22, 0, x_25); +return x_22; } else { -obj* x_25; obj* x_26; obj* x_27; -x_25 = lean::cnstr_get(x_21, 1); -lean::inc(x_25); -lean::dec(x_21); -x_26 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_26, 0, x_20); -lean::cnstr_set(x_26, 1, x_12); +obj* x_26; obj* x_27; obj* x_28; +x_26 = lean::cnstr_get(x_22, 1); +lean::inc(x_26); +lean::dec(x_22); x_27 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_27, 0, x_26); -lean::cnstr_set(x_27, 1, x_25); -return x_27; +lean::cnstr_set(x_27, 0, x_21); +lean::cnstr_set(x_27, 1, x_13); +x_28 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_28, 0, x_27); +lean::cnstr_set(x_28, 1, x_26); +return x_28; } } else { -uint8 x_28; -lean::dec(x_20); -lean::dec(x_12); -x_28 = !lean::is_exclusive(x_21); -if (x_28 == 0) -{ -return x_21; -} -else -{ -obj* x_29; obj* x_30; obj* x_31; -x_29 = lean::cnstr_get(x_21, 0); -x_30 = lean::cnstr_get(x_21, 1); -lean::inc(x_30); -lean::inc(x_29); +uint8 x_29; lean::dec(x_21); -x_31 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_31, 0, x_29); -lean::cnstr_set(x_31, 1, x_30); -return x_31; +lean::dec(x_13); +x_29 = !lean::is_exclusive(x_22); +if (x_29 == 0) +{ +return x_22; +} +else +{ +obj* x_30; obj* x_31; obj* x_32; +x_30 = lean::cnstr_get(x_22, 0); +x_31 = lean::cnstr_get(x_22, 1); +lean::inc(x_31); +lean::inc(x_30); +lean::dec(x_22); +x_32 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_32, 0, x_30); +lean::cnstr_set(x_32, 1, x_31); +return x_32; } } } else { -obj* x_32; obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; uint8 x_41; obj* x_42; obj* x_43; -x_32 = lean::cnstr_get(x_10, 0); -x_33 = lean::cnstr_get(x_10, 1); +obj* x_33; obj* x_34; obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; obj* x_41; uint8 x_42; obj* x_43; obj* x_44; +x_33 = lean::cnstr_get(x_11, 0); +x_34 = lean::cnstr_get(x_11, 1); +lean::inc(x_34); +lean::inc(x_33); +lean::dec(x_11); +x_35 = lean::box(0); +x_36 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_36, 0, x_35); +lean::cnstr_set(x_36, 1, x_34); lean::inc(x_33); -lean::inc(x_32); -lean::dec(x_10); -x_34 = lean::box(0); -x_35 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_35, 0, x_34); -lean::cnstr_set(x_35, 1, x_33); -lean::inc(x_32); lean::inc(x_1); -x_36 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 8, 3); -lean::closure_set(x_36, 0, x_1); -lean::closure_set(x_36, 1, x_3); -lean::closure_set(x_36, 2, x_32); -lean::inc(x_1); -x_37 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); +x_37 = lean::alloc_closure(reinterpret_cast(l_Lean_registerParametricAttribute___rarg___lambda__4___boxed), 9, 4); lean::closure_set(x_37, 0, x_1); +lean::closure_set(x_37, 1, x_3); +lean::closure_set(x_37, 2, x_33); +lean::closure_set(x_37, 3, x_4); lean::inc(x_1); -x_38 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +x_38 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__6___boxed), 5, 1); lean::closure_set(x_38, 0, x_1); -x_39 = l_Lean_registerTagAttribute___closed__5; -x_40 = l_Lean_registerTagAttribute___closed__6; -x_41 = 0; -x_42 = lean::alloc_cnstr(0, 8, 1); -lean::cnstr_set(x_42, 0, x_1); -lean::cnstr_set(x_42, 1, x_2); -lean::cnstr_set(x_42, 2, x_36); -lean::cnstr_set(x_42, 3, x_37); -lean::cnstr_set(x_42, 4, x_38); -lean::cnstr_set(x_42, 5, x_39); -lean::cnstr_set(x_42, 6, x_40); -lean::cnstr_set(x_42, 7, x_40); -lean::cnstr_set_scalar(x_42, sizeof(void*)*8, x_41); -lean::inc(x_42); -x_43 = l_Lean_registerAttribute(x_42, x_35); -if (lean::obj_tag(x_43) == 0) +lean::inc(x_1); +x_39 = lean::alloc_closure(reinterpret_cast(l_Lean_registerTagAttribute___lambda__7___boxed), 5, 1); +lean::closure_set(x_39, 0, x_1); +x_40 = l_Lean_registerTagAttribute___closed__5; +x_41 = l_Lean_registerTagAttribute___closed__6; +x_42 = 0; +x_43 = lean::alloc_cnstr(0, 8, 1); +lean::cnstr_set(x_43, 0, x_1); +lean::cnstr_set(x_43, 1, x_2); +lean::cnstr_set(x_43, 2, x_37); +lean::cnstr_set(x_43, 3, x_38); +lean::cnstr_set(x_43, 4, x_39); +lean::cnstr_set(x_43, 5, x_40); +lean::cnstr_set(x_43, 6, x_41); +lean::cnstr_set(x_43, 7, x_41); +lean::cnstr_set_scalar(x_43, sizeof(void*)*8, x_42); +lean::inc(x_43); +x_44 = l_Lean_registerAttribute(x_43, x_36); +if (lean::obj_tag(x_44) == 0) { -obj* x_44; obj* x_45; obj* x_46; obj* x_47; -x_44 = lean::cnstr_get(x_43, 1); -lean::inc(x_44); -if (lean::is_exclusive(x_43)) { - lean::cnstr_release(x_43, 0); - lean::cnstr_release(x_43, 1); - x_45 = x_43; +obj* x_45; obj* x_46; obj* x_47; obj* x_48; +x_45 = lean::cnstr_get(x_44, 1); +lean::inc(x_45); +if (lean::is_exclusive(x_44)) { + lean::cnstr_release(x_44, 0); + lean::cnstr_release(x_44, 1); + x_46 = x_44; } else { - lean::dec_ref(x_43); - x_45 = lean::box(0); + lean::dec_ref(x_44); + x_46 = lean::box(0); } -x_46 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_46, 0, x_42); -lean::cnstr_set(x_46, 1, x_32); -if (lean::is_scalar(x_45)) { - x_47 = lean::alloc_cnstr(0, 2, 0); +x_47 = lean::alloc_cnstr(0, 2, 0); +lean::cnstr_set(x_47, 0, x_43); +lean::cnstr_set(x_47, 1, x_33); +if (lean::is_scalar(x_46)) { + x_48 = lean::alloc_cnstr(0, 2, 0); } else { - x_47 = x_45; + x_48 = x_46; } -lean::cnstr_set(x_47, 0, x_46); -lean::cnstr_set(x_47, 1, x_44); -return x_47; +lean::cnstr_set(x_48, 0, x_47); +lean::cnstr_set(x_48, 1, x_45); +return x_48; } else { -obj* x_48; obj* x_49; obj* x_50; obj* x_51; -lean::dec(x_42); -lean::dec(x_32); -x_48 = lean::cnstr_get(x_43, 0); -lean::inc(x_48); -x_49 = lean::cnstr_get(x_43, 1); +obj* x_49; obj* x_50; obj* x_51; obj* x_52; +lean::dec(x_43); +lean::dec(x_33); +x_49 = lean::cnstr_get(x_44, 0); lean::inc(x_49); -if (lean::is_exclusive(x_43)) { - lean::cnstr_release(x_43, 0); - lean::cnstr_release(x_43, 1); - x_50 = x_43; +x_50 = lean::cnstr_get(x_44, 1); +lean::inc(x_50); +if (lean::is_exclusive(x_44)) { + lean::cnstr_release(x_44, 0); + lean::cnstr_release(x_44, 1); + x_51 = x_44; } else { - lean::dec_ref(x_43); - x_50 = lean::box(0); + lean::dec_ref(x_44); + x_51 = lean::box(0); } -if (lean::is_scalar(x_50)) { - x_51 = lean::alloc_cnstr(1, 2, 0); +if (lean::is_scalar(x_51)) { + x_52 = lean::alloc_cnstr(1, 2, 0); } else { - x_51 = x_50; + x_52 = x_51; } -lean::cnstr_set(x_51, 0, x_48); -lean::cnstr_set(x_51, 1, x_49); -return x_51; +lean::cnstr_set(x_52, 0, x_49); +lean::cnstr_set(x_52, 1, x_50); +return x_52; } } } else { -uint8 x_52; +uint8 x_53; +lean::dec(x_4); lean::dec(x_3); lean::dec(x_2); lean::dec(x_1); -x_52 = !lean::is_exclusive(x_10); -if (x_52 == 0) +x_53 = !lean::is_exclusive(x_11); +if (x_53 == 0) { -return x_10; +return x_11; } else { -obj* x_53; obj* x_54; obj* x_55; -x_53 = lean::cnstr_get(x_10, 0); -x_54 = lean::cnstr_get(x_10, 1); +obj* x_54; obj* x_55; obj* x_56; +x_54 = lean::cnstr_get(x_11, 0); +x_55 = lean::cnstr_get(x_11, 1); +lean::inc(x_55); lean::inc(x_54); -lean::inc(x_53); -lean::dec(x_10); -x_55 = lean::alloc_cnstr(1, 2, 0); -lean::cnstr_set(x_55, 0, x_53); -lean::cnstr_set(x_55, 1, x_54); -return x_55; +lean::dec(x_11); +x_56 = lean::alloc_cnstr(1, 2, 0); +lean::cnstr_set(x_56, 0, x_54); +lean::cnstr_set(x_56, 1, x_55); +return x_56; } } } @@ -843,8 +852,8 @@ obj* _init_l_Lean_mkInitAttr___lambda__1___closed__3() { _start: { obj* x_1; obj* x_2; -x_1 = lean::mk_string("unexpected kind of argument"); -x_2 = lean::alloc_cnstr(0, 1, 0); +x_1 = lean::box(0); +x_2 = lean::alloc_cnstr(1, 1, 0); lean::cnstr_set(x_2, 0, x_1); return x_2; } @@ -852,16 +861,18 @@ return x_2; obj* _init_l_Lean_mkInitAttr___lambda__1___closed__4() { _start: { -obj* x_1; -x_1 = lean::mk_string("unknown initialization function '"); -return x_1; +obj* x_1; obj* x_2; +x_1 = lean::mk_string("unexpected kind of argument"); +x_2 = lean::alloc_cnstr(0, 1, 0); +lean::cnstr_set(x_2, 0, x_1); +return x_2; } } obj* _init_l_Lean_mkInitAttr___lambda__1___closed__5() { _start: { obj* x_1; -x_1 = lean::mk_string("initialization function '"); +x_1 = lean::mk_string("unknown initialization function '"); return x_1; } } @@ -869,7 +880,7 @@ obj* _init_l_Lean_mkInitAttr___lambda__1___closed__6() { _start: { obj* x_1; -x_1 = lean::mk_string("' must have type of the form `IO `"); +x_1 = lean::mk_string("initialization function '"); return x_1; } } @@ -877,6 +888,14 @@ obj* _init_l_Lean_mkInitAttr___lambda__1___closed__7() { _start: { obj* x_1; +x_1 = lean::mk_string("' must have type of the form `IO `"); +return x_1; +} +} +obj* _init_l_Lean_mkInitAttr___lambda__1___closed__8() { +_start: +{ +obj* x_1; x_1 = lean::mk_string("' type mismatch"); return x_1; } @@ -890,147 +909,141 @@ x_4 = lean::environment_find_core(x_1, x_2); if (lean::obj_tag(x_4) == 0) { obj* x_5; -lean::dec(x_3); lean::dec(x_1); x_5 = l_Lean_mkInitAttr___lambda__1___closed__1; return x_5; } else { -switch (lean::obj_tag(x_3)) { -case 0: -{ -obj* x_6; obj* x_7; uint8 x_8; +obj* x_6; obj* x_7; x_6 = lean::cnstr_get(x_4, 0); lean::inc(x_6); lean::dec(x_4); -x_7 = l_Lean_ConstantInfo_type(x_6); -lean::dec(x_6); -x_8 = l___private_init_lean_compiler_initattr_3__isIOUnit(x_7); -lean::dec(x_7); -if (x_8 == 0) +x_7 = l_Lean_attrParamSyntaxToIdentifier(x_3); +if (lean::obj_tag(x_7) == 0) { -obj* x_9; lean::dec(x_1); -x_9 = l_Lean_mkInitAttr___lambda__1___closed__2; -return x_9; +if (lean::obj_tag(x_3) == 0) +{ +obj* x_8; uint8 x_9; +x_8 = l_Lean_ConstantInfo_type(x_6); +lean::dec(x_6); +x_9 = l___private_init_lean_compiler_initattr_3__isIOUnit(x_8); +lean::dec(x_8); +if (x_9 == 0) +{ +obj* x_10; +x_10 = l_Lean_mkInitAttr___lambda__1___closed__2; +return x_10; } else { -obj* x_10; obj* x_11; obj* x_12; -x_10 = lean::box(0); -x_11 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_11, 0, x_10); -lean::cnstr_set(x_11, 1, x_1); -x_12 = lean::alloc_cnstr(1, 1, 0); -lean::cnstr_set(x_12, 0, x_11); +obj* x_11; +x_11 = l_Lean_mkInitAttr___lambda__1___closed__3; +return x_11; +} +} +else +{ +obj* x_12; +lean::dec(x_6); +x_12 = l_Lean_mkInitAttr___lambda__1___closed__4; return x_12; } } -case 3: +else { -obj* x_13; obj* x_14; obj* x_15; -x_13 = lean::cnstr_get(x_4, 0); +obj* x_13; obj* x_14; +x_13 = lean::cnstr_get(x_7, 0); lean::inc(x_13); -lean::dec(x_4); -x_14 = lean::cnstr_get(x_3, 2); -lean::inc(x_14); -lean::dec(x_3); -lean::inc(x_14); -lean::inc(x_1); -x_15 = lean::environment_find_core(x_1, x_14); -if (lean::obj_tag(x_15) == 0) +lean::dec(x_7); +lean::inc(x_13); +x_14 = lean::environment_find_core(x_1, x_13); +if (lean::obj_tag(x_14) == 0) { -obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; obj* x_22; -lean::dec(x_13); -lean::dec(x_1); -x_16 = l_Lean_Name_toString___closed__1; -x_17 = l_Lean_Name_toStringWithSep___main(x_16, x_14); -x_18 = l_Lean_mkInitAttr___lambda__1___closed__4; -x_19 = lean::string_append(x_18, x_17); -lean::dec(x_17); -x_20 = l_Char_HasRepr___closed__1; -x_21 = lean::string_append(x_19, x_20); -x_22 = lean::alloc_cnstr(0, 1, 0); -lean::cnstr_set(x_22, 0, x_21); -return x_22; +obj* x_15; obj* x_16; obj* x_17; obj* x_18; obj* x_19; obj* x_20; obj* x_21; +lean::dec(x_6); +x_15 = l_Lean_Name_toString___closed__1; +x_16 = l_Lean_Name_toStringWithSep___main(x_15, x_13); +x_17 = l_Lean_mkInitAttr___lambda__1___closed__5; +x_18 = lean::string_append(x_17, x_16); +lean::dec(x_16); +x_19 = l_Char_HasRepr___closed__1; +x_20 = lean::string_append(x_18, x_19); +x_21 = lean::alloc_cnstr(0, 1, 0); +lean::cnstr_set(x_21, 0, x_20); +return x_21; } else { -obj* x_23; obj* x_24; obj* x_25; -x_23 = lean::cnstr_get(x_15, 0); -lean::inc(x_23); -lean::dec(x_15); -x_24 = l_Lean_ConstantInfo_type(x_23); +obj* x_22; obj* x_23; obj* x_24; +x_22 = lean::cnstr_get(x_14, 0); +lean::inc(x_22); +lean::dec(x_14); +x_23 = l_Lean_ConstantInfo_type(x_22); +lean::dec(x_22); +x_24 = l___private_init_lean_compiler_initattr_1__getIOTypeArg___main(x_23); lean::dec(x_23); -x_25 = l___private_init_lean_compiler_initattr_1__getIOTypeArg___main(x_24); -lean::dec(x_24); -if (lean::obj_tag(x_25) == 0) +if (lean::obj_tag(x_24) == 0) { -obj* x_26; obj* x_27; obj* x_28; obj* x_29; obj* x_30; obj* x_31; obj* x_32; -lean::dec(x_13); -lean::dec(x_1); -x_26 = l_Lean_Name_toString___closed__1; -x_27 = l_Lean_Name_toStringWithSep___main(x_26, x_14); -x_28 = l_Lean_mkInitAttr___lambda__1___closed__5; -x_29 = lean::string_append(x_28, x_27); -lean::dec(x_27); -x_30 = l_Lean_mkInitAttr___lambda__1___closed__6; -x_31 = lean::string_append(x_29, x_30); -x_32 = lean::alloc_cnstr(0, 1, 0); -lean::cnstr_set(x_32, 0, x_31); -return x_32; +obj* x_25; obj* x_26; obj* x_27; obj* x_28; obj* x_29; obj* x_30; obj* x_31; +lean::dec(x_6); +x_25 = l_Lean_Name_toString___closed__1; +x_26 = l_Lean_Name_toStringWithSep___main(x_25, x_13); +x_27 = l_Lean_mkInitAttr___lambda__1___closed__6; +x_28 = lean::string_append(x_27, x_26); +lean::dec(x_26); +x_29 = l_Lean_mkInitAttr___lambda__1___closed__7; +x_30 = lean::string_append(x_28, x_29); +x_31 = lean::alloc_cnstr(0, 1, 0); +lean::cnstr_set(x_31, 0, x_30); +return x_31; } else { -obj* x_33; obj* x_34; uint8 x_35; -x_33 = lean::cnstr_get(x_25, 0); -lean::inc(x_33); -lean::dec(x_25); -x_34 = l_Lean_ConstantInfo_type(x_13); -lean::dec(x_13); -x_35 = lean_expr_eqv(x_34, x_33); +obj* x_32; obj* x_33; uint8 x_34; +x_32 = lean::cnstr_get(x_24, 0); +lean::inc(x_32); +lean::dec(x_24); +x_33 = l_Lean_ConstantInfo_type(x_6); +lean::dec(x_6); +x_34 = lean_expr_eqv(x_33, x_32); +lean::dec(x_32); lean::dec(x_33); -lean::dec(x_34); -if (x_35 == 0) +if (x_34 == 0) { -obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; obj* x_41; obj* x_42; -lean::dec(x_1); -x_36 = l_Lean_Name_toString___closed__1; -x_37 = l_Lean_Name_toStringWithSep___main(x_36, x_14); -x_38 = l_Lean_mkInitAttr___lambda__1___closed__5; -x_39 = lean::string_append(x_38, x_37); -lean::dec(x_37); -x_40 = l_Lean_mkInitAttr___lambda__1___closed__7; -x_41 = lean::string_append(x_39, x_40); -x_42 = lean::alloc_cnstr(0, 1, 0); -lean::cnstr_set(x_42, 0, x_41); +obj* x_35; obj* x_36; obj* x_37; obj* x_38; obj* x_39; obj* x_40; obj* x_41; +x_35 = l_Lean_Name_toString___closed__1; +x_36 = l_Lean_Name_toStringWithSep___main(x_35, x_13); +x_37 = l_Lean_mkInitAttr___lambda__1___closed__6; +x_38 = lean::string_append(x_37, x_36); +lean::dec(x_36); +x_39 = l_Lean_mkInitAttr___lambda__1___closed__8; +x_40 = lean::string_append(x_38, x_39); +x_41 = lean::alloc_cnstr(0, 1, 0); +lean::cnstr_set(x_41, 0, x_40); +return x_41; +} +else +{ +obj* x_42; +x_42 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_42, 0, x_13); return x_42; } -else +} +} +} +} +} +} +obj* l_Lean_mkInitAttr___lambda__2(obj* x_1, obj* x_2, obj* x_3) { +_start: { -obj* x_43; obj* x_44; -x_43 = lean::alloc_cnstr(0, 2, 0); -lean::cnstr_set(x_43, 0, x_14); -lean::cnstr_set(x_43, 1, x_1); -x_44 = lean::alloc_cnstr(1, 1, 0); -lean::cnstr_set(x_44, 0, x_43); -return x_44; -} -} -} -} -default: -{ -obj* x_45; -lean::dec(x_4); -lean::dec(x_3); -lean::dec(x_1); -x_45 = l_Lean_mkInitAttr___lambda__1___closed__3; -return x_45; -} -} -} +obj* x_4; +x_4 = lean::alloc_cnstr(1, 1, 0); +lean::cnstr_set(x_4, 0, x_1); +return x_4; } } obj* _init_l_Lean_mkInitAttr___closed__1() { @@ -1055,19 +1068,28 @@ obj* _init_l_Lean_mkInitAttr___closed__3() { _start: { obj* x_1; -x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_mkInitAttr___lambda__1), 3, 0); +x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_mkInitAttr___lambda__1___boxed), 3, 0); +return x_1; +} +} +obj* _init_l_Lean_mkInitAttr___closed__4() { +_start: +{ +obj* x_1; +x_1 = lean::alloc_closure(reinterpret_cast(l_Lean_mkInitAttr___lambda__2___boxed), 3, 0); return x_1; } } obj* l_Lean_mkInitAttr(obj* x_1) { _start: { -obj* x_2; obj* x_3; obj* x_4; obj* x_5; +obj* x_2; obj* x_3; obj* x_4; obj* x_5; obj* x_6; x_2 = l_Lean_mkInitAttr___closed__1; x_3 = l_Lean_mkInitAttr___closed__2; x_4 = l_Lean_mkInitAttr___closed__3; -x_5 = l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1(x_2, x_3, x_4, x_1); -return x_5; +x_5 = l_Lean_mkInitAttr___closed__4; +x_6 = l_Lean_registerParametricAttribute___at_Lean_mkInitAttr___spec__1(x_2, x_3, x_4, x_5, x_1); +return x_6; } } obj* l_RBNode_fold___main___at_Lean_mkInitAttr___spec__2___boxed(obj* x_1, obj* x_2) { @@ -1107,6 +1129,25 @@ lean::dec(x_1); return x_2; } } +obj* l_Lean_mkInitAttr___lambda__1___boxed(obj* x_1, obj* x_2, obj* x_3) { +_start: +{ +obj* x_4; +x_4 = l_Lean_mkInitAttr___lambda__1(x_1, x_2, x_3); +lean::dec(x_3); +return x_4; +} +} +obj* l_Lean_mkInitAttr___lambda__2___boxed(obj* x_1, obj* x_2, obj* x_3) { +_start: +{ +obj* x_4; +x_4 = l_Lean_mkInitAttr___lambda__2(x_1, x_2, x_3); +lean::dec(x_3); +lean::dec(x_2); +return x_4; +} +} obj* l_RBNode_find___main___at_Lean_isIOUnitInitFn___spec__2(obj* x_1, obj* x_2) { _start: { @@ -1489,12 +1530,16 @@ l_Lean_mkInitAttr___lambda__1___closed__6 = _init_l_Lean_mkInitAttr___lambda__1_ lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__6); l_Lean_mkInitAttr___lambda__1___closed__7 = _init_l_Lean_mkInitAttr___lambda__1___closed__7(); lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__7); +l_Lean_mkInitAttr___lambda__1___closed__8 = _init_l_Lean_mkInitAttr___lambda__1___closed__8(); +lean::mark_persistent(l_Lean_mkInitAttr___lambda__1___closed__8); l_Lean_mkInitAttr___closed__1 = _init_l_Lean_mkInitAttr___closed__1(); lean::mark_persistent(l_Lean_mkInitAttr___closed__1); l_Lean_mkInitAttr___closed__2 = _init_l_Lean_mkInitAttr___closed__2(); lean::mark_persistent(l_Lean_mkInitAttr___closed__2); l_Lean_mkInitAttr___closed__3 = _init_l_Lean_mkInitAttr___closed__3(); lean::mark_persistent(l_Lean_mkInitAttr___closed__3); +l_Lean_mkInitAttr___closed__4 = _init_l_Lean_mkInitAttr___closed__4(); +lean::mark_persistent(l_Lean_mkInitAttr___closed__4); REGISTER_LEAN_FUNCTION(lean::mk_const_name(lean::mk_const_name("Lean"), "mkInitAttr"), 1, l_Lean_mkInitAttr); w = l_Lean_mkInitAttr(w); if (io_result_is_error(w)) return w; diff --git a/src/stage0/init/lean/compiler/ir/boxing.cpp b/src/stage0/init/lean/compiler/ir/boxing.cpp index cc13b90680..af796dd031 100644 --- a/src/stage0/init/lean/compiler/ir/boxing.cpp +++ b/src/stage0/init/lean/compiler/ir/boxing.cpp @@ -273,7 +273,6 @@ if (x_10 == 0) obj* x_11; uint8 x_12; x_11 = l_Lean_IR_Decl_name___main(x_2); x_12 = l_Lean_isExtern(x_1, x_11); -lean::dec(x_11); return x_12; } else diff --git a/src/stage0/init/lean/compiler/ir/emitcpp.cpp b/src/stage0/init/lean/compiler/ir/emitcpp.cpp index 6ac09ceb00..c2f30f89a0 100644 --- a/src/stage0/init/lean/compiler/ir/emitcpp.cpp +++ b/src/stage0/init/lean/compiler/ir/emitcpp.cpp @@ -3289,7 +3289,6 @@ x_12 = lean::cnstr_get(x_10, 0); x_13 = lean::cnstr_get(x_10, 1); x_14 = l_Lean_IR_Decl_name___main(x_1); x_15 = l_Lean_isExternC(x_12, x_14); -lean::dec(x_14); lean::dec(x_12); if (x_15 == 0) { @@ -3474,7 +3473,6 @@ lean::inc(x_48); lean::dec(x_10); x_50 = l_Lean_IR_Decl_name___main(x_1); x_51 = l_Lean_isExternC(x_48, x_50); -lean::dec(x_50); lean::dec(x_48); if (x_51 == 0) { @@ -3703,7 +3701,6 @@ if (lean::is_exclusive(x_93)) { } x_97 = l_Lean_IR_Decl_name___main(x_1); x_98 = l_Lean_isExternC(x_94, x_97); -lean::dec(x_97); lean::dec(x_94); if (x_98 == 0) { @@ -4112,7 +4109,6 @@ lean::cnstr_set(x_14, 0, x_17); x_18 = l_Lean_IR_Decl_name___main(x_16); x_19 = l_List_mfor___main___at_Lean_IR_EmitCpp_emitFnDecls___spec__5___closed__1; x_20 = l_Lean_getExternNameFor(x_1, x_19, x_18); -lean::dec(x_18); if (lean::obj_tag(x_20) == 0) { uint8 x_21; @@ -4312,7 +4308,6 @@ lean::cnstr_set(x_61, 1, x_59); x_62 = l_Lean_IR_Decl_name___main(x_58); x_63 = l_List_mfor___main___at_Lean_IR_EmitCpp_emitFnDecls___spec__5___closed__1; x_64 = l_Lean_getExternNameFor(x_1, x_63, x_62); -lean::dec(x_62); if (lean::obj_tag(x_64) == 0) { uint8 x_65; diff --git a/src/stage0/init/lean/syntax.cpp b/src/stage0/init/lean/syntax.cpp index e409f6c530..b8734288e8 100644 --- a/src/stage0/init/lean/syntax.cpp +++ b/src/stage0/init/lean/syntax.cpp @@ -4370,7 +4370,7 @@ if (lean::obj_tag(x_1) == 1) obj* x_2; obj* x_3; obj* x_4; uint8 x_5; x_2 = lean::cnstr_get(x_1, 0); x_3 = lean::cnstr_get(x_1, 1); -x_4 = l_Lean_strLitKind; +x_4 = l_Lean_numLitKind; x_5 = lean_name_dec_eq(x_2, x_4); if (x_5 == 0) {