-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proc default arg error, internal error: expr
#18074
Labels
Comments
al6x
changed the title
Function param initialization error,
Proc arg initialization error, May 24, 2021
internal error: expr
internal error: expr
al6x
changed the title
Proc arg initialization error,
Proc default arg error, May 24, 2021
internal error: expr
internal error: expr
|
Works since 2.2? |
!nim c let code = """
import strformat
proc somefn[T](query: string, _: type[T], message = query) = discard
somefn(fmt"", string)
"""
# foo()
writeFile("test.nim", code)
import std/osproc
let (_, exitCode) = execCmdEx("nim c -r test.nim")
doAssert exitCode != 0 |
🐧 Linux bisect by @ringabout (member)devel 👎 FAILOutput
IRCompiled filesize197.50 Kb (202,240 bytes)
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimln_(n) \
FR_.line = n;
#define nimlf_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
typedef struct tyObject_StringTableObj__0P3m7501aN2ol2UKnK1guw tyObject_StringTableObj__0P3m7501aN2ol2UKnK1guw;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
NimStringV2 Field0;
NI Field1;
};
typedef NU8 tySet_tyEnum_ProcessOption__9aCfVUyDFjLLn9an3vvc7WLw;
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, writeFile__stdZsyncio_u530)(NimStringV2 filename_p0, NimStringV2 content_p1);
N_LIB_PRIVATE N_NIMCALL(tyTuple__XOVT24GHXwqiEj5GCsEGCA, execCmdEx__pureZosproc_u1989)(NimStringV2 command_p0, tySet_tyEnum_ProcessOption__9aCfVUyDFjLLn9an3vvc7WLw options_p1, tyObject_StringTableObj__0P3m7501aN2ol2UKnK1guw* env_p2, NimStringV2 workingDir_p3, NimStringV2 input_p4);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u235)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u2033)(tyTuple__XOVT24GHXwqiEj5GCsEGCA* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4661)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap;
NIM_CHAR data[109];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = {(108 | NIM_STRLIT_FLAG), "import strformat\012proc somefn[T](query: string, _: type[T], message = query) = discard\012somefn(fmt\"\", string)\012"};
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {108, ((NimStrPayload*) &TM__SRd76hP9cMfCzdUO857UhQQ_2)};
static const struct {
NI cap;
NIM_CHAR data[9];
} TM__SRd76hP9cMfCzdUO857UhQQ_4 = {(8 | NIM_STRLIT_FLAG), "test.nim"};
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {8, ((NimStrPayload*) &TM__SRd76hP9cMfCzdUO857UhQQ_4)};
static const struct {
NI cap;
NIM_CHAR data[18];
} TM__SRd76hP9cMfCzdUO857UhQQ_6 = {(17 | NIM_STRLIT_FLAG), "nim c -r test.nim"};
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_7 = {17, ((NimStrPayload*) &TM__SRd76hP9cMfCzdUO857UhQQ_6)};
static const struct {
NI cap;
NIM_CHAR data[1];
} TM__SRd76hP9cMfCzdUO857UhQQ_8 = {(0 | NIM_STRLIT_FLAG), ""};
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_9 = {0, ((NimStrPayload*) &TM__SRd76hP9cMfCzdUO857UhQQ_8)};
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_10 = {0, ((NimStrPayload*) &TM__SRd76hP9cMfCzdUO857UhQQ_8)};
static const struct {
NI cap;
NIM_CHAR data[59];
} TM__SRd76hP9cMfCzdUO857UhQQ_11 = {(58 | NIM_STRLIT_FLAG), "/home/runner/work/Nim/Nim/temp.nim(10, 1) `exitCode != 0` "};
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_12 = {58, ((NimStrPayload*) &TM__SRd76hP9cMfCzdUO857UhQQ_11)};
N_LIB_PRIVATE NimStringV2 code__temp_u1;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4443;
N_LIB_PRIVATE NI exitCode__temp_u4;
extern NIM_THREADVAR TFrame* framePtr__system_u2675;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u4443);
return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__systemZmemory_u7(p_p0, ((int) 0), size_p1);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u2675 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u2675).calldepth + ((NI16) 1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u2675;
framePtr__system_u2675 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16) 2000))) goto LA8_;
callDepthLimitReached__system_u4661();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u2675 = (*framePtr__system_u2675).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminusathdevelatslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
tyTuple__XOVT24GHXwqiEj5GCsEGCA tmpTuple;
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&tmpTuple), sizeof(tyTuple__XOVT24GHXwqiEj5GCsEGCA));
code__temp_u1 = TM__SRd76hP9cMfCzdUO857UhQQ_3;
writeFile__stdZsyncio_u530(TM__SRd76hP9cMfCzdUO857UhQQ_5, code__temp_u1);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
tmpTuple = execCmdEx__pureZosproc_u1989(TM__SRd76hP9cMfCzdUO857UhQQ_7, 10, ((tyObject_StringTableObj__0P3m7501aN2ol2UKnK1guw*) NIM_NIL), TM__SRd76hP9cMfCzdUO857UhQQ_9, TM__SRd76hP9cMfCzdUO857UhQQ_10);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
exitCode__temp_u4 = tmpTuple.Field1;
{
if (!(!((!((exitCode__temp_u4 == ((NI) 0))))))) goto LA4_;
failedAssertImpl__stdZassertions_u235(TM__SRd76hP9cMfCzdUO857UhQQ_12);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
}
LA4_: ;
{
LA1_:;
}
{
eqdestroy___pureZosproc_u2033((&tmpTuple));
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (code__temp_u1.p && !(code__temp_u1.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(code__temp_u1.p);
}
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
} Stats
ASTnnkStmtList.newTree(
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("code"),
newEmptyNode(),
newLit(" import strformat\n proc somefn[T](query: string, _: type[T], message = query) = discard\n somefn(fmt\"\", string)\n ")
)
),
nnkCall.newTree(
newIdentNode("writeFile"),
newLit("test.nim"),
newIdentNode("code")
),
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("osproc")
)
),
nnkLetSection.newTree(
nnkVarTuple.newTree(
newIdentNode("_"),
newIdentNode("exitCode"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("execCmdEx"),
newLit("nim c -r test.nim")
)
)
),
nnkCommand.newTree(
newIdentNode("doAssert"),
nnkInfix.newTree(
newIdentNode("!="),
newIdentNode("exitCode"),
newLit(0)
)
)
) stable 👎 FAILOutput
IRCompiled filesize197.47 Kb (202,208 bytes)
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimln_(n) \
FR_.line = n;
#define nimlf_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
typedef struct tyObject_StringTableObj__KVv9bLPjapMDlTjtzx4W0mg tyObject_StringTableObj__KVv9bLPjapMDlTjtzx4W0mg;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
NimStringV2 Field0;
NI Field1;
};
typedef NU8 tySet_tyEnum_ProcessOption__9buK9a9c4r9cYSYElxqQFL3smg;
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, writeFile__stdZsyncio_u530)(NimStringV2 filename_p0, NimStringV2 content_p1);
N_LIB_PRIVATE N_NIMCALL(tyTuple__XOVT24GHXwqiEj5GCsEGCA, execCmdEx__pureZosproc_u1989)(NimStringV2 command_p0, tySet_tyEnum_ProcessOption__9buK9a9c4r9cYSYElxqQFL3smg options_p1, tyObject_StringTableObj__KVv9bLPjapMDlTjtzx4W0mg* env_p2, NimStringV2 workingDir_p3, NimStringV2 input_p4);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u235)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u2033)(tyTuple__XOVT24GHXwqiEj5GCsEGCA* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4655)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot2dot0atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[108+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 108 | NIM_STRLIT_FLAG, "import strformat\012proc somefn[T](query: string, _: type[T], message = query) = discard\012somefn(fmt\"\", string)\012" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {108, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
static const struct {
NI cap; NIM_CHAR data[8+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 8 | NIM_STRLIT_FLAG, "test.nim" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {8, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4};
static const struct {
NI cap; NIM_CHAR data[17+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_6 = { 17 | NIM_STRLIT_FLAG, "nim c -r test.nim" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_7 = {17, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_6};
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_8 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_9 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_8};
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_10 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_8};
static const struct {
NI cap; NIM_CHAR data[58+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_11 = { 58 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(10, 1) `exitCode != 0` " };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_12 = {58, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_11};
N_LIB_PRIVATE NimStringV2 code__temp_u1;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4437;
N_LIB_PRIVATE NI exitCode__temp_u4;
extern NIM_THREADVAR TFrame* framePtr__system_u2669;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u4437);
return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u2669 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u2669).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u2669;
framePtr__system_u2669 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4655();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u2669 = (*framePtr__system_u2669).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot2dot0atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot2dot0atslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
tyTuple__XOVT24GHXwqiEj5GCsEGCA tmpTuple;
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&tmpTuple), sizeof(tyTuple__XOVT24GHXwqiEj5GCsEGCA));
code__temp_u1 = TM__SRd76hP9cMfCzdUO857UhQQ_3;
writeFile__stdZsyncio_u530(TM__SRd76hP9cMfCzdUO857UhQQ_5, code__temp_u1);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
tmpTuple = execCmdEx__pureZosproc_u1989(TM__SRd76hP9cMfCzdUO857UhQQ_7, 10, ((tyObject_StringTableObj__KVv9bLPjapMDlTjtzx4W0mg*) NIM_NIL), TM__SRd76hP9cMfCzdUO857UhQQ_9, TM__SRd76hP9cMfCzdUO857UhQQ_10);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
exitCode__temp_u4 = tmpTuple.Field1;
{
if (!!(!((exitCode__temp_u4 == ((NI)0))))) goto LA4_;
failedAssertImpl__stdZassertions_u235(TM__SRd76hP9cMfCzdUO857UhQQ_12);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
}
LA4_: ;
{
LA1_:;
}
{
eqdestroy___pureZosproc_u2033((&tmpTuple));
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (code__temp_u1.p && !(code__temp_u1.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(code__temp_u1.p);
}
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
} Stats
ASTnnkStmtList.newTree(
nnkLetSection.newTree(
nnkIdentDefs.newTree(
newIdentNode("code"),
newEmptyNode(),
newLit(" import strformat\n proc somefn[T](query: string, _: type[T], message = query) = discard\n somefn(fmt\"\", string)\n ")
)
),
nnkCall.newTree(
newIdentNode("writeFile"),
newLit("test.nim"),
newIdentNode("code")
),
nnkImportStmt.newTree(
nnkInfix.newTree(
newIdentNode("/"),
newIdentNode("std"),
newIdentNode("osproc")
)
),
nnkLetSection.newTree(
nnkVarTuple.newTree(
newIdentNode("_"),
newIdentNode("exitCode"),
newEmptyNode(),
nnkCall.newTree(
newIdentNode("execCmdEx"),
newLit("nim c -r test.nim")
)
)
),
nnkCommand.newTree(
newIdentNode("doAssert"),
nnkInfix.newTree(
newIdentNode("!="),
newIdentNode("exitCode"),
newLit(0)
)
)
) 2.0.10 👍 OKOutput
IRCompiled filesize197.37 Kb (202,104 bytes)
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
FR_.line = n;
#define nimlf_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
typedef struct tyObject_StringTableObj__p7uyWe9c2XCestpqANNVJmA tyObject_StringTableObj__p7uyWe9c2XCestpqANNVJmA;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
NimStringV2 Field0;
NI Field1;
};
typedef NU8 tySet_tyEnum_ProcessOption__1BaStJTV9bKPUjyCV79btwzQ;
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, writeFile__stdZsyncio_u530)(NimStringV2 filename_p0, NimStringV2 content_p1);
N_LIB_PRIVATE N_NIMCALL(tyTuple__XOVT24GHXwqiEj5GCsEGCA, execCmdEx__pureZosproc_u1972)(NimStringV2 command_p0, tySet_tyEnum_ProcessOption__1BaStJTV9bKPUjyCV79btwzQ options_p1, tyObject_StringTableObj__p7uyWe9c2XCestpqANNVJmA* env_p2, NimStringV2 workingDir_p3, NimStringV2 input_p4);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u270)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u2016)(tyTuple__XOVT24GHXwqiEj5GCsEGCA* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4620)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot10atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[108+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 108 | NIM_STRLIT_FLAG, "import strformat\012proc somefn[T](query: string, _: type[T], message = query) = discard\012somefn(fmt\"\", string)\012" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {108, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
static const struct {
NI cap; NIM_CHAR data[8+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 8 | NIM_STRLIT_FLAG, "test.nim" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {8, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4};
static const struct {
NI cap; NIM_CHAR data[17+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_6 = { 17 | NIM_STRLIT_FLAG, "nim c -r test.nim" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_7 = {17, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_6};
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_8 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_9 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_8};
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_10 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_8};
static const struct {
NI cap; NIM_CHAR data[58+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_11 = { 58 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(10, 1) `exitCode != 0` " };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_12 = {58, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_11};
N_LIB_PRIVATE NimStringV2 code__temp_u1;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4402;
N_LIB_PRIVATE NI exitCode__temp_u4;
extern NIM_THREADVAR TFrame* framePtr__system_u4059;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (&nimInErrorMode__system_u4402);
return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u4059 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4059).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4059;
framePtr__system_u4059 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4620();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4059 = (*framePtr__system_u4059).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot10atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot10atslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
tyTuple__XOVT24GHXwqiEj5GCsEGCA tmpTuple;
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&tmpTuple), sizeof(tyTuple__XOVT24GHXwqiEj5GCsEGCA));
code__temp_u1 = TM__SRd76hP9cMfCzdUO857UhQQ_3;
writeFile__stdZsyncio_u530(TM__SRd76hP9cMfCzdUO857UhQQ_5, code__temp_u1);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
tmpTuple = execCmdEx__pureZosproc_u1972(TM__SRd76hP9cMfCzdUO857UhQQ_7, 10, ((tyObject_StringTableObj__p7uyWe9c2XCestpqANNVJmA*) NIM_NIL), TM__SRd76hP9cMfCzdUO857UhQQ_9, TM__SRd76hP9cMfCzdUO857UhQQ_10);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
exitCode__temp_u4 = tmpTuple.Field1;
{
if (!!(!((exitCode__temp_u4 == ((NI)0))))) goto LA4_;
failedAssertImpl__stdZassertions_u270(TM__SRd76hP9cMfCzdUO857UhQQ_12);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
}
LA4_: ;
{
LA1_:;
}
{
eqdestroy___pureZosproc_u2016((&tmpTuple));
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (code__temp_u1.p && !(code__temp_u1.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(code__temp_u1.p);
}
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
} Stats
2.0.0 👍 OKOutput
IRCompiled filesize193.19 Kb (197,824 bytes)
#include "nimbase.h"
#include <string.h>
#define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
#define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename;NI len;VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
#define nimln_(n) \
FR_.line = n;
#define nimlf_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStrPayload NimStrPayload;
typedef struct NimStringV2 NimStringV2;
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
typedef struct tyObject_StringTableObj__9aQVWDBodHNhkGlutyRtcOw tyObject_StringTableObj__9aQVWDBodHNhkGlutyRtcOw;
struct NimStrPayload {
NI cap;
NIM_CHAR data[SEQ_DECL_SIZE];
};
struct NimStringV2 {
NI len;
NimStrPayload* p;
};
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
NimStringV2 Field0;
NI Field1;
};
typedef NU8 tySet_tyEnum_ProcessOption__OskndNPuFVug9cMKa9ct4N5w;
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2);
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void);
N_LIB_PRIVATE N_NIMCALL(void, writeFile__stdZsyncio_u532)(NimStringV2 filename_p0, NimStringV2 content_p1);
N_LIB_PRIVATE N_NIMCALL(tyTuple__XOVT24GHXwqiEj5GCsEGCA, execCmdEx__pureZosproc_u2027)(NimStringV2 command_p0, tySet_tyEnum_ProcessOption__OskndNPuFVug9cMKa9ct4N5w options_p1, tyObject_StringTableObj__9aQVWDBodHNhkGlutyRtcOw* env_p2, NimStringV2 workingDir_p3, NimStringV2 input_p4);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__stdZassertions_u310)(NimStringV2 msg_p0);
N_LIB_PRIVATE N_NIMCALL(void, eqdestroy___pureZosproc_u2071)(tyTuple__XOVT24GHXwqiEj5GCsEGCA* dest_p0);
N_LIB_PRIVATE N_NIMCALL(void, nimTestErrorFlag)(void);
N_LIB_PRIVATE N_NOCONV(void, deallocShared)(void* p_p0);
static N_INLINE(void, nimFrame)(TFrame* s_p0);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u4607)(void);
static N_INLINE(void, popFrame)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
static const struct {
NI cap; NIM_CHAR data[108+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_2 = { 108 | NIM_STRLIT_FLAG, "import strformat\012proc somefn[T](query: string, _: type[T], message = query) = discard\012somefn(fmt\"\", string)\012" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_3 = {108, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_2};
static const struct {
NI cap; NIM_CHAR data[8+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_4 = { 8 | NIM_STRLIT_FLAG, "test.nim" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_5 = {8, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_4};
static const struct {
NI cap; NIM_CHAR data[17+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_6 = { 17 | NIM_STRLIT_FLAG, "nim c -r test.nim" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_7 = {17, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_6};
static const struct {
NI cap; NIM_CHAR data[0+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_8 = { 0 | NIM_STRLIT_FLAG, "" };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_9 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_8};
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_10 = {0, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_8};
static const struct {
NI cap; NIM_CHAR data[58+1];
} TM__SRd76hP9cMfCzdUO857UhQQ_11 = { 58 | NIM_STRLIT_FLAG, "/home/runner/work/Nim/Nim/temp.nim(10, 1) `exitCode != 0` " };
static const NimStringV2 TM__SRd76hP9cMfCzdUO857UhQQ_12 = {58, (NimStrPayload*)&TM__SRd76hP9cMfCzdUO857UhQQ_11};
N_LIB_PRIVATE NimStringV2 code__temp_u1;
extern NIM_THREADVAR NIM_BOOL nimInErrorMode__system_u4389;
N_LIB_PRIVATE NI exitCode__temp_u4;
extern NIM_THREADVAR TFrame* framePtr__system_u4006;
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a_p0, int v_p1, NI size_p2) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a_p0, v_p1, ((size_t) (size_p2)));
}
static N_INLINE(NIM_BOOL*, nimErrorFlag)(void) {
NIM_BOOL* result;
result = (NIM_BOOL*)0;
result = (&nimInErrorMode__system_u4389);
return result;
}
static N_INLINE(void, nimZeroMem)(void* p_p0, NI size_p1) {
NIM_BOOL* nimErr_;
{nimErr_ = nimErrorFlag();
nimSetMem__systemZmemory_u7(p_p0, ((int)0), size_p1);
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
}BeforeRet_: ;
}
static N_INLINE(void, nimFrame)(TFrame* s_p0) {
{
if (!(framePtr__system_u4006 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s_p0).calldepth = ((NI16)0);
}
goto LA1_;
LA3_: ;
{
(*s_p0).calldepth = (NI16)((*framePtr__system_u4006).calldepth + ((NI16)1));
}
LA1_: ;
(*s_p0).prev = framePtr__system_u4006;
framePtr__system_u4006 = s_p0;
{
if (!((*s_p0).calldepth == ((NI16)2000))) goto LA8_;
callDepthLimitReached__system_u4607();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u4006 = (*framePtr__system_u4006).prev;
}
N_LIB_PRIVATE void PreMainInner(void) {
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
#if 0
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
(*inner)();
#else
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus2dot0dot0atslibatssystemdotnim_Init000();
PreMainInner();
#endif
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
#if 0
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
(*inner)();
#else
PreMain();
NimMainInner();
#endif
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
tyTuple__XOVT24GHXwqiEj5GCsEGCA tmpTuple;
NIM_BOOL oldNimErrFin1_;
NIM_BOOL* nimErr_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimErr_ = nimErrorFlag();
nimZeroMem((void*)(&tmpTuple), sizeof(tyTuple__XOVT24GHXwqiEj5GCsEGCA));
code__temp_u1 = TM__SRd76hP9cMfCzdUO857UhQQ_3;
writeFile__stdZsyncio_u532(TM__SRd76hP9cMfCzdUO857UhQQ_5, code__temp_u1);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
tmpTuple = execCmdEx__pureZosproc_u2027(TM__SRd76hP9cMfCzdUO857UhQQ_7, 10, ((tyObject_StringTableObj__9aQVWDBodHNhkGlutyRtcOw*) NIM_NIL), TM__SRd76hP9cMfCzdUO857UhQQ_9, TM__SRd76hP9cMfCzdUO857UhQQ_10);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
exitCode__temp_u4 = tmpTuple.Field1;
{
if (!!(!((exitCode__temp_u4 == ((NI)0))))) goto LA4_;
failedAssertImpl__stdZassertions_u310(TM__SRd76hP9cMfCzdUO857UhQQ_12);
if (NIM_UNLIKELY(*nimErr_)) goto LA1_;
}
LA4_: ;
{
LA1_:;
}
{
oldNimErrFin1_ = *nimErr_; *nimErr_ = NIM_FALSE;
eqdestroy___pureZosproc_u2071((&tmpTuple));
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
*nimErr_ = oldNimErrFin1_;
}
if (NIM_UNLIKELY(*nimErr_)) goto BeforeRet_;
if (code__temp_u1.p && !(code__temp_u1.p->cap & NIM_STRLIT_FLAG)) {
deallocShared(code__temp_u1.p);
}
BeforeRet_: ;
nimTestErrorFlag();
popFrame();
}
} Stats
1.6.20 👍 OKOutput
IRCompiled filesize210.05 Kb (215,088 bytes)
#include "nimbase.h"
#include <string.h>
# define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
# define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
# define nimln_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_Cell__USbPc9alteBFOfRejw0IPYQ tyObject_Cell__USbPc9alteBFOfRejw0IPYQ;
typedef struct tyObject_CellSeq__jRKHLJ9a9c5ErVSJdxK4Cpgg tyObject_CellSeq__jRKHLJ9a9c5ErVSJdxK4Cpgg;
typedef struct tyObject_GcHeap__t69aQjzxW7FmvOL7XpHLmyw tyObject_GcHeap__t69aQjzxW7FmvOL7XpHLmyw;
typedef struct tyObject_GcStack__rDlr9cRaEdNqxGR9croMEJNw tyObject_GcStack__rDlr9cRaEdNqxGR9croMEJNw;
typedef struct tyObject_MemRegion__D0dQEAx0h5Bhgc8Q6BW2Iw tyObject_MemRegion__D0dQEAx0h5Bhgc8Q6BW2Iw;
typedef struct tyObject_SmallChunk__O53kXtyFD7TDiEYwk5Td1Q tyObject_SmallChunk__O53kXtyFD7TDiEYwk5Td1Q;
typedef struct tyObject_BigChunk__yXMahKLrwWYxDO82eN9ba1w tyObject_BigChunk__yXMahKLrwWYxDO82eN9ba1w;
typedef struct tyObject_LLChunk__UJR9cDjZvibCSXo9aRj7SX9cQ tyObject_LLChunk__UJR9cDjZvibCSXo9aRj7SX9cQ;
typedef struct tyObject_IntSet__i7ywOkONvFvdahwK0NEBVQ tyObject_IntSet__i7ywOkONvFvdahwK0NEBVQ;
typedef struct tyObject_Trunk__KdFprq6T12mWzGalsCR7gg tyObject_Trunk__KdFprq6T12mWzGalsCR7gg;
typedef struct tyObject_AvlNode__HGw0Fii3rdknN9aH9aqThc3g tyObject_AvlNode__HGw0Fii3rdknN9aH9aqThc3g;
typedef struct tyObject_HeapLinks__Bw0IMvdOVqyBxxH1ZmEDeg tyObject_HeapLinks__Bw0IMvdOVqyBxxH1ZmEDeg;
typedef struct tyTuple__59a7yNnUUaLYoYgMyTxCvyA tyTuple__59a7yNnUUaLYoYgMyTxCvyA;
typedef struct tyObject_GcStat__fGBxrB5bu5S0xC9brjmfkoQ tyObject_GcStat__fGBxrB5bu5S0xC9brjmfkoQ;
typedef struct tyObject_CellSet__UY9caB79b0qIHRObBn8A4WSA tyObject_CellSet__UY9caB79b0qIHRObBn8A4WSA;
typedef struct tyObject_PageDesc__j9aIB2yRpeIkPT6e1CrFY5g tyObject_PageDesc__j9aIB2yRpeIkPT6e1CrFY5g;
typedef struct tyObject_StringTableObj__g5rx0hEIWFWSMYZo0pFkqg tyObject_StringTableObj__g5rx0hEIWFWSMYZo0pFkqg;
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tyEnum_TNimKind__b9brdfAMvuT12kv1MtmF3IQ;
typedef NU8 tySet_tyEnum_TNimTypeFlag__h29aLKtZInAIaLqhWRujWcA;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
NI align;
tyEnum_TNimKind__b9brdfAMvuT12kv1MtmF3IQ kind;
tySet_tyEnum_TNimTypeFlag__h29aLKtZInAIaLqhWRujWcA flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__K6UETQxRj3HYBl69c6NhKig;
struct TNimNode {
tyEnum_TNimNodeKind__K6UETQxRj3HYBl69c6NhKig kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_Cell__USbPc9alteBFOfRejw0IPYQ {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack__rDlr9cRaEdNqxGR9croMEJNw {
void* bottom;
};
struct tyObject_CellSeq__jRKHLJ9a9c5ErVSJdxK4Cpgg {
NI len;
NI cap;
tyObject_Cell__USbPc9alteBFOfRejw0IPYQ** d;
};
typedef tyObject_SmallChunk__O53kXtyFD7TDiEYwk5Td1Q* tyArray__am9ckwqC56M7ACKNToDQf8g[256];
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk__yXMahKLrwWYxDO82eN9ba1w* tyArray__dKp1AZMrWGPz9btzS7Vnpow[32];
typedef tyArray__dKp1AZMrWGPz9btzS7Vnpow tyArray__qtz48s7lyP6EI0JVCgNDLw[24];
typedef tyObject_Trunk__KdFprq6T12mWzGalsCR7gg* tyArray__n7OYK9anGXLKqT2bAWs4WmA[256];
struct tyObject_IntSet__i7ywOkONvFvdahwK0NEBVQ {
tyArray__n7OYK9anGXLKqT2bAWs4WmA data;
};
typedef tyObject_AvlNode__HGw0Fii3rdknN9aH9aqThc3g* tyArray__FZjlW9aArl8yDtsaKBHERDQ[2];
struct tyObject_AvlNode__HGw0Fii3rdknN9aH9aqThc3g {
tyArray__FZjlW9aArl8yDtsaKBHERDQ link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple__59a7yNnUUaLYoYgMyTxCvyA {
tyObject_BigChunk__yXMahKLrwWYxDO82eN9ba1w* Field0;
NI Field1;
};
typedef tyTuple__59a7yNnUUaLYoYgMyTxCvyA tyArray__BxsOe7WmMYPypzw9cg9aWRFQ[30];
struct tyObject_HeapLinks__Bw0IMvdOVqyBxxH1ZmEDeg {
NI len;
tyArray__BxsOe7WmMYPypzw9cg9aWRFQ chunks;
tyObject_HeapLinks__Bw0IMvdOVqyBxxH1ZmEDeg* next;
};
struct tyObject_MemRegion__D0dQEAx0h5Bhgc8Q6BW2Iw {
NI minLargeObj;
NI maxLargeObj;
tyArray__am9ckwqC56M7ACKNToDQf8g freeSmallChunks;
NU32 flBitmap;
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray__qtz48s7lyP6EI0JVCgNDLw matrix;
tyObject_LLChunk__UJR9cDjZvibCSXo9aRj7SX9cQ* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet__i7ywOkONvFvdahwK0NEBVQ chunkStarts;
tyObject_AvlNode__HGw0Fii3rdknN9aH9aqThc3g* root;
tyObject_AvlNode__HGw0Fii3rdknN9aH9aqThc3g* deleted;
tyObject_AvlNode__HGw0Fii3rdknN9aH9aqThc3g* last;
tyObject_AvlNode__HGw0Fii3rdknN9aH9aqThc3g* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode__HGw0Fii3rdknN9aH9aqThc3g bottomData;
tyObject_HeapLinks__Bw0IMvdOVqyBxxH1ZmEDeg heapLinks;
};
struct tyObject_GcStat__fGBxrB5bu5S0xC9brjmfkoQ {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet__UY9caB79b0qIHRObBn8A4WSA {
NI counter;
NI max;
tyObject_PageDesc__j9aIB2yRpeIkPT6e1CrFY5g* head;
tyObject_PageDesc__j9aIB2yRpeIkPT6e1CrFY5g** data;
};
struct tyObject_GcHeap__t69aQjzxW7FmvOL7XpHLmyw {
tyObject_GcStack__rDlr9cRaEdNqxGR9croMEJNw stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq__jRKHLJ9a9c5ErVSJdxK4Cpgg zct;
tyObject_CellSeq__jRKHLJ9a9c5ErVSJdxK4Cpgg decStack;
tyObject_CellSeq__jRKHLJ9a9c5ErVSJdxK4Cpgg tempStack;
NI recGcLock;
tyObject_MemRegion__D0dQEAx0h5Bhgc8Q6BW2Iw region;
tyObject_GcStat__fGBxrB5bu5S0xC9brjmfkoQ stat;
tyObject_CellSet__UY9caB79b0qIHRObBn8A4WSA marked;
tyObject_CellSeq__jRKHLJ9a9c5ErVSJdxK4Cpgg additionalRoots;
NI gcThreadId;
};
typedef NU8 tySet_tyEnum_ProcessOption__aKwERgzGtdioj2ZEdjVk1A;
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
NimStringDesc* Field0;
NI Field1;
};
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_2)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimRegisterGlobalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(void, decRef__system_u5350)(tyObject_Cell__USbPc9alteBFOfRejw0IPYQ* c);
static N_INLINE(NI, minuspercent___system_u716)(NI x, NI y);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__system_u2997)(void);
static N_INLINE(void, popFrame)(void);
static N_INLINE(NIM_BOOL, ltpercent___system_u1005)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__system_u5348)(tyObject_Cell__USbPc9alteBFOfRejw0IPYQ* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__system_u5299)(tyObject_CellSeq__jRKHLJ9a9c5ErVSJdxK4Cpgg* s, tyObject_Cell__USbPc9alteBFOfRejw0IPYQ* c);
static N_INLINE(tyObject_Cell__USbPc9alteBFOfRejw0IPYQ*, usrToCell__system_u5305)(void* usr);
N_LIB_PRIVATE N_NIMCALL(void, writeFile__systemZio_u477)(NimStringDesc* filename, NimStringDesc* content);
N_LIB_PRIVATE N_NIMCALL(void, execCmdEx__pureZosproc_u1218)(NimStringDesc* command, tySet_tyEnum_ProcessOption__aKwERgzGtdioj2ZEdjVk1A options, tyObject_StringTableObj__g5rx0hEIWFWSMYZo0pFkqg* env, NimStringDesc* workingDir, NimStringDesc* input, tyTuple__XOVT24GHXwqiEj5GCsEGCA* Result);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a, int v, NI size);
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_6)(void);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__systemZassertions_u56)(NimStringDesc* msg);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystematsiodotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatsposixatsposixdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatspureatstimesdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatspureatstimesdotnim_Init000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatspureatsstreamsdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatspureatsosprocdotnim_DatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
extern TNimType NTIstring__77mFvmsOLKik79ci2hXkHEg_;
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "import strformat\012proc somefn[T](query: string, _: type[T], message = query) = discard\012somefn(fmt\"\", string)\012", 108);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_4, "test.nim", 8);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_5, "nim c -r test.nim", 17);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_7, "/home/runner/work/Nim/Nim/temp.nim(10, 10) `exitCode != 0` ", 59);
N_LIB_PRIVATE NimStringDesc* code__temp_u1;
extern TFrame* framePtr__system_u2564;
extern tyObject_GcHeap__t69aQjzxW7FmvOL7XpHLmyw gch__system_u5252;
N_LIB_PRIVATE NimStringDesc* ___temp_u3;
N_LIB_PRIVATE NI exitCode__temp_u4;
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_2)(void) {
nimGCvisit((void*)code__temp_u1, 0);
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__system_u2564 == ((TFrame*) NIM_NIL))) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__system_u2564).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__system_u2564;
framePtr__system_u2564 = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
callDepthLimitReached__system_u2997();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__system_u2564 = (*framePtr__system_u2564).prev;
}
static N_INLINE(NI, minuspercent___system_u716)(NI x, NI y) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/arithmetics.nim");
result = (NI)0;
result = ((NI) ((NU)((NU64)(((NU) (x))) - (NU64)(((NU) (y))))));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, ltpercent___system_u1005)(NI x, NI y) {
NIM_BOOL result;
nimfr_("<%", "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/comparisons.nim");
result = (NIM_BOOL)0;
result = ((NU64)(((NU) (x))) < (NU64)(((NU) (y))));
popFrame();
return result;
}
static N_INLINE(void, rtlAddZCT__system_u5348)(tyObject_Cell__USbPc9alteBFOfRejw0IPYQ* c) {
nimfr_("rtlAddZCT", "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/gc.nim");
addZCT__system_u5299((&gch__system_u5252.zct), c);
popFrame();
}
static N_INLINE(void, decRef__system_u5350)(tyObject_Cell__USbPc9alteBFOfRejw0IPYQ* c) {
nimfr_("decRef", "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/gc.nim");
(*c).refcount = minuspercent___system_u716((*c).refcount, ((NI) 8));
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = ltpercent___system_u1005((*c).refcount, ((NI) 8));
if (!T3_) goto LA4_;
rtlAddZCT__system_u5348(c);
}
LA4_: ;
popFrame();
}
static N_INLINE(tyObject_Cell__USbPc9alteBFOfRejw0IPYQ*, usrToCell__system_u5305)(void* usr) {
tyObject_Cell__USbPc9alteBFOfRejw0IPYQ* result;
NI T1_;
nimfr_("usrToCell", "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/gc.nim");
result = (tyObject_Cell__USbPc9alteBFOfRejw0IPYQ*)0;
T1_ = (NI)0;
T1_ = minuspercent___system_u716(((NI) (ptrdiff_t) (usr)), ((NI) 16));
result = ((tyObject_Cell__USbPc9alteBFOfRejw0IPYQ*) (T1_));
popFrame();
return result;
}
static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
tyObject_Cell__USbPc9alteBFOfRejw0IPYQ* T1_;
nimfr_("nimGCunrefNoCycle", "/home/runner/.choosenim/toolchains/nim-1.6.20/lib/system/gc.nim");
T1_ = (tyObject_Cell__USbPc9alteBFOfRejw0IPYQ*)0;
T1_ = usrToCell__system_u5305(p);
decRef__system_u5350(T1_);
popFrame();
}
static N_INLINE(void, nimSetMem__systemZmemory_u7)(void* a, int v, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem__systemZmemory_u7(p, ((int) 0), size);
}
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_6)(void) {
nimGCvisit((void*)___temp_u3, 0);
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
N_LIB_PRIVATE void PreMainInner(void) {
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatspureatstimesdotnim_Init000();
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystematsiodotnim_DatInit000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_DatInit000();
initStackBottomWith((void *)&inner);
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatssystemdotnim_Init000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatsposixatsposixdotnim_DatInit000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatspureatstimesdotnim_DatInit000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatspureatsstreamsdotnim_DatInit000();
atmdotdotatsdotdotatsdotdotatsdotchoosenimatstoolchainsatsnimminus1dot6dot20atslibatspureatsosprocdotnim_DatInit000();
(*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
TFrame FR_; FR_.len = 0;
nimRegisterGlobalMarker(TM__SRd76hP9cMfCzdUO857UhQQ_2);
nimRegisterGlobalMarker(TM__SRd76hP9cMfCzdUO857UhQQ_6);
}
{
NimStringDesc* T1_;
tyTuple__XOVT24GHXwqiEj5GCsEGCA T2_;
NimStringDesc* T3_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
T1_ = NIM_NIL;
T1_ = code__temp_u1; code__temp_u1 = copyStringRC1(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3));
if (T1_) nimGCunrefNoCycle(T1_);
writeFile__systemZio_u477(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_4), code__temp_u1);
nimZeroMem((void*)(&T2_), sizeof(tyTuple__XOVT24GHXwqiEj5GCsEGCA));
execCmdEx__pureZosproc_u1218(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_5), 10, ((tyObject_StringTableObj__g5rx0hEIWFWSMYZo0pFkqg*) NIM_NIL), ((NimStringDesc*) NIM_NIL), ((NimStringDesc*) NIM_NIL), (&T2_));
T3_ = NIM_NIL;
T3_ = ___temp_u3; ___temp_u3 = copyStringRC1(T2_.Field0);
if (T3_) nimGCunrefNoCycle(T3_);
exitCode__temp_u4 = T2_.Field1;
{
if (!!(!((exitCode__temp_u4 == ((NI) 0))))) goto LA6_;
failedAssertImpl__systemZassertions_u56(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_7));
}
LA6_: ;
popFrame();
}
} Stats
1.4.8 👍 OKOutput
IRCompiled filesize215.22 Kb (220,384 bytes)
#include "nimbase.h"
#include <string.h>
# define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
# define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
# define nimln_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
typedef struct tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg;
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
NI align;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
void* bottom;
};
struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
NI len;
NI cap;
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SPr7N6UKfuF549bNPiUvSRw[256];
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
tyArray__0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray__SPr7N6UKfuF549bNPiUvSRw freeSmallChunks;
NU32 flBitmap;
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
typedef NU8 tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA;
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
NimStringDesc* Field0;
NI Field1;
};
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_2)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimRegisterGlobalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NI, minuspercent___dgYAo7RfdUVVpvkfKDym8wsystem)(NI x, NI y);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
static N_INLINE(NIM_BOOL, ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__Y66tOYFjgwJ0k4aLz4bc0Q)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr);
N_LIB_PRIVATE N_NIMCALL(void, writeFile__D6Pj9c29aCLEJP9beOWa08HYA)(NimStringDesc* filename, NimStringDesc* content);
N_LIB_PRIVATE N_NIMCALL(void, execCmdEx__130zQ9a9cS3YNDwoh0G9at3bw)(NimStringDesc* command, tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA options, tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg* env, NimStringDesc* workingDir, NimStringDesc* input, tyTuple__XOVT24GHXwqiEj5GCsEGCA* Result);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_6)(void);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_ioDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_posixDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_streamsDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osprocDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
extern TNimType NTI__77mFvmsOLKik79ci2hXkHEg_;
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "import strformat\012proc somefn[T](query: string, _: type[T], mess"
"age = query) = discard\012somefn(fmt\"\", string)\012", 108);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_4, "test.nim", 8);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_5, "nim c -r test.nim", 17);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_7, "/home/runner/work/Nim/Nim/temp.nim(10, 10) `exitCode != 0` ", 59);
N_LIB_PRIVATE NimStringDesc* code__oT69bA2m29a7pvQn7f2NJhvQ;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__IcYaEuuWivYAS86vFMTS3Q;
N_LIB_PRIVATE NimStringDesc* ___FtN4iS9bLWFzC8ZqGcmDc4Q;
N_LIB_PRIVATE NI exitCode__Q2nKo9cWSVYKDoR62gUc1hw;
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_2)(void) {
nimGCvisit((void*)code__oT69bA2m29a7pvQn7f2NJhvQ, 0);
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == ((TFrame*) NIM_NIL))) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) 2000))) goto LA8_;
callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
static N_INLINE(NI, minuspercent___dgYAo7RfdUVVpvkfKDym8wsystem)(NI x, NI y) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/arithme"
"tics.nim");
result = (NI)0;
result = ((NI) ((NU)((NU64)(((NU) (x))) - (NU64)(((NU) (y))))));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem)(NI x, NI y) {
NIM_BOOL result;
nimfr_("<%", "/home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/compari"
"sons.nim");
result = (NIM_BOOL)0;
result = ((NU64)(((NU) (x))) < (NU64)(((NU) (y))));
popFrame();
return result;
}
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
nimfr_("rtlAddZCT", "/home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/gc.nim");
addZCT__Y66tOYFjgwJ0k4aLz4bc0Q((&gch__IcYaEuuWivYAS86vFMTS3Q.zct), c);
popFrame();
}
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
nimfr_("decRef", "/home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/gc.nim");
(*c).refcount = minuspercent___dgYAo7RfdUVVpvkfKDym8wsystem((*c).refcount, ((NI) 8));
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem((*c).refcount, ((NI) 8));
if (!T3_) goto LA4_;
rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_3system(c);
}
LA4_: ;
popFrame();
}
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr) {
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
NI T1_;
nimfr_("usrToCell", "/home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/gc.nim");
result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
T1_ = (NI)0;
T1_ = minuspercent___dgYAo7RfdUVVpvkfKDym8wsystem(((NI) (ptrdiff_t) (usr)), ((NI) 16));
result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
popFrame();
return result;
}
static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
nimfr_("nimGCunrefNoCycle", "/home/runner/.choosenim/toolchains/nim-1.4.8/lib/system/gc.nim");
T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
T1_ = usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem(p);
decRef__AT1eRuflKWyTTBdLjEDZbg_2system(T1_);
popFrame();
}
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
}
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_6)(void) {
nimGCvisit((void*)___FtN4iS9bLWFzC8ZqGcmDc4Q, 0);
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
N_LIB_PRIVATE void PreMainInner(void) {
stdlib_timesInit000();
stdlib_osInit000();
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
stdlib_ioDatInit000();
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_posixDatInit000();
stdlib_timesDatInit000();
stdlib_osDatInit000();
stdlib_streamsDatInit000();
stdlib_osprocDatInit000();
(*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
TFrame FR_; FR_.len = 0;
nimRegisterGlobalMarker(TM__SRd76hP9cMfCzdUO857UhQQ_2);
nimRegisterGlobalMarker(TM__SRd76hP9cMfCzdUO857UhQQ_6);
}
{
NimStringDesc* T1_;
tyTuple__XOVT24GHXwqiEj5GCsEGCA T2_;
NimStringDesc* T3_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
T1_ = (NimStringDesc*)0;
T1_ = code__oT69bA2m29a7pvQn7f2NJhvQ; code__oT69bA2m29a7pvQn7f2NJhvQ = copyStringRC1(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3));
if (T1_) nimGCunrefNoCycle(T1_);
writeFile__D6Pj9c29aCLEJP9beOWa08HYA(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_4), code__oT69bA2m29a7pvQn7f2NJhvQ);
nimZeroMem((void*)(&T2_), sizeof(tyTuple__XOVT24GHXwqiEj5GCsEGCA));
execCmdEx__130zQ9a9cS3YNDwoh0G9at3bw(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_5), 10, ((tyObject_StringTableObj__V5PVrt9bIxZEeV7lfvqqtNg*) NIM_NIL), ((NimStringDesc*) NIM_NIL), ((NimStringDesc*) NIM_NIL), (&T2_));
T3_ = (NimStringDesc*)0;
T3_ = ___FtN4iS9bLWFzC8ZqGcmDc4Q; ___FtN4iS9bLWFzC8ZqGcmDc4Q = copyStringRC1(T2_.Field0);
if (T3_) nimGCunrefNoCycle(T3_);
exitCode__Q2nKo9cWSVYKDoR62gUc1hw = T2_.Field1;
{
if (!!(!((exitCode__Q2nKo9cWSVYKDoR62gUc1hw == ((NI) 0))))) goto LA6_;
failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_7));
}
LA6_: ;
popFrame();
}
} Stats
1.2.18 👍 OKOutput
IRCompiled filesize210.74 Kb (215,800 bytes)
#include "nimbase.h"
#include <string.h>
# define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
# define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
# define nimln_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
void* bottom;
};
struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
NI len;
NI cap;
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SiRwrEKZdLgxqz9a9aoVBglg[512];
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
tyArray__0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray__SiRwrEKZdLgxqz9a9aoVBglg freeSmallChunks;
NU32 flBitmap;
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
typedef NU8 tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA;
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
NimStringDesc* Field0;
NI Field1;
};
N_LIB_PRIVATE N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_2)(void);
N_LIB_PRIVATE N_NIMCALL(void, nimRegisterGlobalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
N_LIB_PRIVATE N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(NI, minuspercent___dgYAo7RfdUVVpvkfKDym8wsystem)(NI x, NI y);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
static N_INLINE(NIM_BOOL, ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem)(NI x, NI y);
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__Y66tOYFjgwJ0k4aLz4bc0Q)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr);
N_LIB_PRIVATE N_NIMCALL(void, writeFile__D6Pj9c29aCLEJP9beOWa08HYA)(NimStringDesc* filename, NimStringDesc* content);
N_LIB_PRIVATE N_NIMCALL(void, execCmdEx__9cTpvDl4v9c9c9aFgpXBZMyDDA)(NimStringDesc* command, tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA options, tyTuple__XOVT24GHXwqiEj5GCsEGCA* Result);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_6)(void);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_LIB_PRIVATE N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_ioDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_posixDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_streamsDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osprocDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
extern TNimType NTI__77mFvmsOLKik79ci2hXkHEg_;
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "import strformat\012proc somefn[T](query: string, _: type[T], mess"
"age = query) = discard\012somefn(fmt\"\", string)\012", 108);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_4, "test.nim", 8);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_5, "nim c -r test.nim", 17);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_7, "/home/runner/work/Nim/Nim/temp.nim(10, 10) `exitCode != 0` ", 59);
N_LIB_PRIVATE NimStringDesc* code__oT69bA2m29a7pvQn7f2NJhvQ;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__IcYaEuuWivYAS86vFMTS3Q;
N_LIB_PRIVATE NimStringDesc* ___FtN4iS9bLWFzC8ZqGcmDc4Q;
N_LIB_PRIVATE NI exitCode__Q2nKo9cWSVYKDoR62gUc1hw;
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_2)(void) {
nimGCvisit((void*)code__oT69bA2m29a7pvQn7f2NJhvQ, 0);
}
static N_INLINE(void, nimFrame)(TFrame* s) {
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA3_;
(*s).calldepth = ((NI16) 0);
}
goto LA1_;
LA3_: ;
{
(*s).calldepth = (NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1));
}
LA1_: ;
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA8_;
callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
}
LA8_: ;
}
static N_INLINE(void, popFrame)(void) {
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
static N_INLINE(NI, minuspercent___dgYAo7RfdUVVpvkfKDym8wsystem)(NI x, NI y) {
NI result;
nimfr_("-%", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/arithm"
"etics.nim");
result = (NI)0;
result = ((NI) ((NU)((NU64)(((NU) (x))) - (NU64)(((NU) (y))))));
popFrame();
return result;
}
static N_INLINE(NIM_BOOL, ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem)(NI x, NI y) {
NIM_BOOL result;
nimfr_("<%", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/compar"
"isons.nim");
result = (NIM_BOOL)0;
result = ((NU64)(((NU) (x))) < (NU64)(((NU) (y))));
popFrame();
return result;
}
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
nimfr_("rtlAddZCT", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/gc.nim");
addZCT__Y66tOYFjgwJ0k4aLz4bc0Q((&gch__IcYaEuuWivYAS86vFMTS3Q.zct), c);
popFrame();
}
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) {
nimfr_("decRef", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/gc.nim");
(*c).refcount = minuspercent___dgYAo7RfdUVVpvkfKDym8wsystem((*c).refcount, ((NI) 8));
{
NIM_BOOL T3_;
T3_ = (NIM_BOOL)0;
T3_ = ltpercent___hPljn3JCDQ00ua1R07X9bxQsystem((*c).refcount, ((NI) 8));
if (!T3_) goto LA4_;
rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_3system(c);
}
LA4_: ;
popFrame();
}
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr) {
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
NI T1_;
nimfr_("usrToCell", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/gc.nim");
result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
T1_ = (NI)0;
T1_ = minuspercent___dgYAo7RfdUVVpvkfKDym8wsystem(((NI) (ptrdiff_t) (usr)), ((NI) 16));
result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) (T1_));
popFrame();
return result;
}
static N_INLINE(void, nimGCunrefNoCycle)(void* p) {
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
nimfr_("nimGCunrefNoCycle", "/home/runner/.choosenim/toolchains/nim-1.2.18/lib/system/gc.nim");
T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
T1_ = usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem(p);
decRef__AT1eRuflKWyTTBdLjEDZbg_2system(T1_);
popFrame();
}
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) {
void* T1_;
T1_ = (void*)0;
T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) {
nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
}
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_6)(void) {
nimGCvisit((void*)___FtN4iS9bLWFzC8ZqGcmDc4Q, 0);
}
static N_INLINE(void, initStackBottomWith)(void* locals) {
nimGC_setStackBottom(locals);
}
N_LIB_PRIVATE void PreMainInner(void) {
stdlib_timesInit000();
stdlib_osInit000();
}
N_LIB_PRIVATE int cmdCount;
N_LIB_PRIVATE char** cmdLine;
N_LIB_PRIVATE char** gEnv;
N_LIB_PRIVATE void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
stdlib_ioDatInit000();
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_posixDatInit000();
stdlib_timesDatInit000();
stdlib_osDatInit000();
stdlib_streamsDatInit000();
stdlib_osprocDatInit000();
(*inner)();
}
N_LIB_PRIVATE N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
TFrame FR_; FR_.len = 0;
nimRegisterGlobalMarker(TM__SRd76hP9cMfCzdUO857UhQQ_2);
nimRegisterGlobalMarker(TM__SRd76hP9cMfCzdUO857UhQQ_6);
}
{
NimStringDesc* T1_;
tyTuple__XOVT24GHXwqiEj5GCsEGCA T2_;
NimStringDesc* T3_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
T1_ = NIM_NIL;
T1_ = code__oT69bA2m29a7pvQn7f2NJhvQ; code__oT69bA2m29a7pvQn7f2NJhvQ = copyStringRC1(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3));
if (T1_) nimGCunrefNoCycle(T1_);
writeFile__D6Pj9c29aCLEJP9beOWa08HYA(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_4), code__oT69bA2m29a7pvQn7f2NJhvQ);
nimZeroMem((void*)(&T2_), sizeof(tyTuple__XOVT24GHXwqiEj5GCsEGCA));
execCmdEx__9cTpvDl4v9c9c9aFgpXBZMyDDA(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_5), 10, (&T2_));
T3_ = NIM_NIL;
T3_ = ___FtN4iS9bLWFzC8ZqGcmDc4Q; ___FtN4iS9bLWFzC8ZqGcmDc4Q = copyStringRC1(T2_.Field0);
if (T3_) nimGCunrefNoCycle(T3_);
exitCode__Q2nKo9cWSVYKDoR62gUc1hw = T2_.Field1;
{
if (!!(!((exitCode__Q2nKo9cWSVYKDoR62gUc1hw == ((NI) 0))))) goto LA6_;
failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_7));
}
LA6_: ;
popFrame();
}
} Stats
1.0.10 👍 OKOutput
IRCompiled filesize197.78 Kb (202,528 bytes)
#include "nimbase.h"
#include <string.h>
# define nimfr_(proc, file) \
TFrame FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = 0; nimFrame(&FR_);
# define nimfrs_(proc, file, slots, length) \
struct {TFrame* prev;NCSTRING procname;NI line;NCSTRING filename; NI len; VarSlot s[slots];} FR_; \
FR_.procname = proc; FR_.filename = file; FR_.line = 0; FR_.len = length; nimFrame((TFrame*)&FR_);
# define nimln_(n, file) \
FR_.line = n; FR_.filename = file;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct TNimType TNimType;
typedef struct TNimNode TNimNode;
typedef struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g;
typedef struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w;
typedef struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ;
typedef struct tyObject_GcStack__7fytPA5bBsob6See21YMRA tyObject_GcStack__7fytPA5bBsob6See21YMRA;
typedef struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg;
typedef struct tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ;
typedef struct tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg;
typedef struct tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw;
typedef struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA;
typedef struct tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw;
typedef struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw;
typedef struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg;
typedef struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyTuple__ujsjpB2O9cjj3uDHsXbnSzg;
typedef struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg;
typedef struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ;
typedef struct tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg;
typedef struct tyTuple__XOVT24GHXwqiEj5GCsEGCA tyTuple__XOVT24GHXwqiEj5GCsEGCA;
struct TGenericSeq {
NI len;
NI reserved;
};
struct NimStringDesc {
TGenericSeq Sup;
NIM_CHAR data[SEQ_DECL_SIZE];
};
typedef NU8 tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A;
typedef NU8 tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ;
typedef N_NIMCALL_PTR(void, tyProc__ojoeKfW4VYIm36I9cpDTQIg) (void* p, NI op);
typedef N_NIMCALL_PTR(void*, tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ) (void* p);
struct TNimType {
NI size;
tyEnum_TNimKind__jIBKr1ejBgsfM33Kxw4j7A kind;
tySet_tyEnum_TNimTypeFlag__v8QUszD1sWlSIWZz7mC4bQ flags;
TNimType* base;
TNimNode* node;
void* finalizer;
tyProc__ojoeKfW4VYIm36I9cpDTQIg marker;
tyProc__WSm2xU5ARYv9aAR4l0z9c9auQ deepcopy;
};
typedef NU8 tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ;
struct TNimNode {
tyEnum_TNimNodeKind__unfNsxrcATrufDZmpBq4HQ kind;
NI offset;
TNimType* typ;
NCSTRING name;
NI len;
TNimNode** sons;
};
typedef N_NIMCALL_PTR(void, tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ) (void);
struct tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g {
NI refcount;
TNimType* typ;
};
struct tyObject_GcStack__7fytPA5bBsob6See21YMRA {
void* bottom;
};
struct tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w {
NI len;
NI cap;
tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g** d;
};
typedef tyObject_SmallChunk__tXn60W2f8h3jgAYdEmy5NQ* tyArray__SiRwrEKZdLgxqz9a9aoVBglg[512];
typedef NU32 tyArray__BHbOSqU1t9b3Gt7K2c6fQig[24];
typedef tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* tyArray__N1u1nqOgmuJN9cSZrnMHgOQ[32];
typedef tyArray__N1u1nqOgmuJN9cSZrnMHgOQ tyArray__B6durA4ZCi1xjJvRtyYxMg[24];
typedef tyObject_Trunk__W0r8S0Y3UGke6T9bIUWnnuw* tyArray__lh2A89ahMmYg9bCmpVaplLbA[256];
struct tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA {
tyArray__lh2A89ahMmYg9bCmpVaplLbA data;
};
typedef tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* tyArray__0aOLqZchNi8nWtMTi8ND8w[2];
struct tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw {
tyArray__0aOLqZchNi8nWtMTi8ND8w link;
NI key;
NI upperBound;
NI level;
};
struct tyTuple__ujsjpB2O9cjj3uDHsXbnSzg {
tyObject_BigChunk__Rv9c70Uhp2TytkX7eH78qEg* Field0;
NI Field1;
};
typedef tyTuple__ujsjpB2O9cjj3uDHsXbnSzg tyArray__LzOv2eCDGiceMKQstCLmhw[30];
struct tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg {
NI len;
tyArray__LzOv2eCDGiceMKQstCLmhw chunks;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg* next;
};
struct tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg {
NI minLargeObj;
NI maxLargeObj;
tyArray__SiRwrEKZdLgxqz9a9aoVBglg freeSmallChunks;
NU32 flBitmap;
tyArray__BHbOSqU1t9b3Gt7K2c6fQig slBitmap;
tyArray__B6durA4ZCi1xjJvRtyYxMg matrix;
tyObject_LLChunk__XsENErzHIZV9bhvyJx56wGw* llmem;
NI currMem;
NI maxMem;
NI freeMem;
NI occ;
NI lastSize;
tyObject_IntSet__EZObFrE3NC9bIb3YMkY9crZA chunkStarts;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* root;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* deleted;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* last;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw* freeAvlNodes;
NIM_BOOL locked;
NIM_BOOL blockChunkSizeIncrease;
NI nextChunkSize;
tyObject_AvlNode__IaqjtwKhxLEpvDS9bct9blEw bottomData;
tyObject_HeapLinks__PDV1HBZ8CQSQJC9aOBFNRSg heapLinks;
};
struct tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg {
NI stackScans;
NI cycleCollections;
NI maxThreshold;
NI maxStackSize;
NI maxStackCells;
NI cycleTableSize;
NI64 maxPause;
};
struct tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ {
NI counter;
NI max;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg* head;
tyObject_PageDesc__fublkgIY4LG3mT51LU2WHg** data;
};
struct tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ {
tyObject_GcStack__7fytPA5bBsob6See21YMRA stack;
NI cycleThreshold;
NI zctThreshold;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w zct;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w decStack;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w tempStack;
NI recGcLock;
tyObject_MemRegion__x81NhDv59b8ercDZ9bi85jyg region;
tyObject_GcStat__0RwLoVBHZPfUAcLczmfQAg stat;
tyObject_CellSet__jG87P0AI9aZtss9ccTYBIISQ marked;
tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w additionalRoots;
NI gcThreadId;
};
typedef NU8 tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA;
struct tyTuple__XOVT24GHXwqiEj5GCsEGCA {
NimStringDesc* Field0;
NI Field1;
};
N_NIMCALL(void, nimGCvisit)(void* d, NI op);
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_2)(void);
N_NIMCALL(void, nimRegisterGlobalMarker)(tyProc__T4eqaYlFJYZUv9aG9b1TV0bQ markerProc);
N_NIMCALL(NimStringDesc*, copyStringRC1)(NimStringDesc* src);
static N_INLINE(void, nimGCunrefNoCycle)(void* p);
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
N_LIB_PRIVATE N_NOINLINE(void, addZCT__Y66tOYFjgwJ0k4aLz4bc0Q)(tyObject_CellSeq__Axo1XVm9aaQueTOldv8le5w* s, tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c);
static N_INLINE(void, nimFrame)(TFrame* s);
N_LIB_PRIVATE N_NOINLINE(void, callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw)(void);
static N_INLINE(void, popFrame)(void);
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr);
N_LIB_PRIVATE N_NIMCALL(void, writeFile__D6Pj9c29aCLEJP9beOWa08HYA)(NimStringDesc* filename, NimStringDesc* content);
N_LIB_PRIVATE N_NIMCALL(void, execCmdEx__9cTpvDl4v9c9c9aFgpXBZMyDDA)(NimStringDesc* command, tySet_tyEnum_ProcessOption__bnU6W8LhTMnT4JaSWtGlSA options, tyTuple__XOVT24GHXwqiEj5GCsEGCA* Result);
static N_INLINE(void, nimZeroMem)(void* p, NI size);
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size);
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_6)(void);
N_LIB_PRIVATE N_NIMCALL(void, failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A)(NimStringDesc* msg);
static N_INLINE(void, initStackBottomWith)(void* locals);
N_NOINLINE(void, nimGC_setStackBottom)(void* theStackBottom);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_ioDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, systemInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_posixDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_timesInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_streamsDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, stdlib_osprocDatInit000)(void);
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void);
NimStringDesc* code__oT69bA2m29a7pvQn7f2NJhvQ;
extern TNimType NTI__77mFvmsOLKik79ci2hXkHEg_;
extern tyObject_GcHeap__1TRH1TZMaVZTnLNcIHuNFQ gch__IcYaEuuWivYAS86vFMTS3Q;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
extern TFrame* framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
NimStringDesc* ___FtN4iS9bLWFzC8ZqGcmDc4Q;
NI exitCode__Q2nKo9cWSVYKDoR62gUc1hw;
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_3, "import strformat\012proc somefn[T](query: string, _: type[T], mess"
"age = query) = discard\012somefn(fmt\"\", string)\012", 108);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_4, "test.nim", 8);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_5, "nim c -r test.nim", 17);
STRING_LITERAL(TM__SRd76hP9cMfCzdUO857UhQQ_7, "/home/runner/work/Nim/Nim/temp.nim(10, 10) `exitCode != 0` ", 59);
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_2)(void) {
nimGCvisit((void*)code__oT69bA2m29a7pvQn7f2NJhvQ, 0);
}
static N_INLINE(void, nimFrame)(TFrame* s) { NI T1_;
T1_ = (NI)0;
{
if (!(framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw == NIM_NIL)) goto LA4_;
T1_ = ((NI) 0);
}
goto LA2_;
LA4_: ;
{
T1_ = ((NI) ((NI16)((*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).calldepth + ((NI16) 1))));
}
LA2_: ;
(*s).calldepth = ((NI16) (T1_));
(*s).prev = framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw;
framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = s;
{
if (!((*s).calldepth == ((NI16) (((NI) 2000))))) goto LA9_;
callDepthLimitReached__mMRdr4sgmnykA9aWeM9aDZlw();
}
LA9_: ;
}
static N_INLINE(void, popFrame)(void) { framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw = (*framePtr__HRfVMH3jYeBJz6Q6X9b6Ptw).prev;
}
static N_INLINE(void, rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_3system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) { nimfr_("rtlAddZCT", "/home/runner/.choosenim/toolchains/nim-1.0.10/lib/system/gc.nim");
addZCT__Y66tOYFjgwJ0k4aLz4bc0Q((&gch__IcYaEuuWivYAS86vFMTS3Q.zct), c);
popFrame();
}
static N_INLINE(void, decRef__AT1eRuflKWyTTBdLjEDZbg_2system)(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* c) { nimfr_("decRef", "/home/runner/.choosenim/toolchains/nim-1.0.10/lib/system/gc.nim");
(*c).refcount = (NI)((NU64)((*c).refcount) - (NU64)(((NI) 8)));
{
if (!((NU64)((*c).refcount) < (NU64)(((NI) 8)))) goto LA3_;
rtlAddZCT__AT1eRuflKWyTTBdLjEDZbg_3system(c);
}
LA3_: ;
popFrame();
}
static N_INLINE(tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*, usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem)(void* usr) { tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* result;
nimfr_("usrToCell", "/home/runner/.choosenim/toolchains/nim-1.0.10/lib/system/gc.nim");
result = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
result = ((tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*) ((NI)((NU64)(((NI) (ptrdiff_t) (usr))) - (NU64)(((NI) 16)))));
popFrame();
return result;
}
static N_INLINE(void, nimGCunrefNoCycle)(void* p) { tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g* T1_;
nimfr_("nimGCunrefNoCycle", "/home/runner/.choosenim/toolchains/nim-1.0.10/lib/system/gc.nim");
T1_ = (tyObject_Cell__1zcF9cV8XIAtbN8h5HRUB8g*)0;
T1_ = usrToCell__QFQqcLB3lgOdwipkv9a60xwsystem(p);
decRef__AT1eRuflKWyTTBdLjEDZbg_2system(T1_);
popFrame();
}
static N_INLINE(void, nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory)(void* a, int v, NI size) { void* T1_;
T1_ = (void*)0;
T1_ = memset(a, v, ((size_t) (size)));
}
static N_INLINE(void, nimZeroMem)(void* p, NI size) { nimSetMem__zxfKBYntu9cBapkhrCOk1fgmemory(p, ((int) 0), size);
}
static N_NIMCALL(void, TM__SRd76hP9cMfCzdUO857UhQQ_6)(void) {
nimGCvisit((void*)___FtN4iS9bLWFzC8ZqGcmDc4Q, 0);
}
static N_INLINE(void, initStackBottomWith)(void* locals) { nimGC_setStackBottom(locals);
}
void PreMainInner(void) {
stdlib_timesInit000();
stdlib_osInit000();
}
int cmdCount;
char** cmdLine;
char** gEnv;
void PreMain(void) {
void (*volatile inner)(void);
inner = PreMainInner;
stdlib_ioDatInit000();
systemDatInit000();
initStackBottomWith((void *)&inner);
systemInit000();
stdlib_posixDatInit000();
stdlib_timesDatInit000();
stdlib_osDatInit000();
stdlib_streamsDatInit000();
stdlib_osprocDatInit000();
(*inner)();
}
N_CDECL(void, NimMainInner)(void) {
NimMainModule();
}
N_CDECL(void, NimMain)(void) {
void (*volatile inner)(void);
PreMain();
inner = NimMainInner;
initStackBottomWith((void *)&inner);
(*inner)();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_LIB_PRIVATE N_NIMCALL(void, NimMainModule)(void) {
{
NimStringDesc* T1_;
tyTuple__XOVT24GHXwqiEj5GCsEGCA T2_;
NimStringDesc* T3_;
nimfr_("temp", "/home/runner/work/Nim/Nim/temp.nim");
nimRegisterGlobalMarker(TM__SRd76hP9cMfCzdUO857UhQQ_2);
nimRegisterGlobalMarker(TM__SRd76hP9cMfCzdUO857UhQQ_6);
T1_ = (NimStringDesc*)0;
T1_ = code__oT69bA2m29a7pvQn7f2NJhvQ; code__oT69bA2m29a7pvQn7f2NJhvQ = copyStringRC1(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_3));
if (T1_) nimGCunrefNoCycle(T1_);
writeFile__D6Pj9c29aCLEJP9beOWa08HYA(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_4), code__oT69bA2m29a7pvQn7f2NJhvQ);
nimZeroMem((void*)(&T2_), sizeof(tyTuple__XOVT24GHXwqiEj5GCsEGCA));
execCmdEx__9cTpvDl4v9c9c9aFgpXBZMyDDA(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_5), 10, (&T2_));
T3_ = (NimStringDesc*)0;
T3_ = ___FtN4iS9bLWFzC8ZqGcmDc4Q; ___FtN4iS9bLWFzC8ZqGcmDc4Q = copyStringRC1(T2_.Field0);
if (T3_) nimGCunrefNoCycle(T3_);
exitCode__Q2nKo9cWSVYKDoR62gUc1hw = T2_.Field1;
{
if (!!(!((exitCode__Q2nKo9cWSVYKDoR62gUc1hw == ((NI) 0))))) goto LA6_;
failedAssertImpl__W9cjVocn1tjhW7p7xohJj6A(((NimStringDesc*) &TM__SRd76hP9cMfCzdUO857UhQQ_7));
}
LA6_: ;
popFrame();
}
} Stats
#a93c5d79b ➡️ 🐛Diagnosticsmetagn introduced a bug at
The bug is in the files:
The bug can be in the commits: (Diagnostics sometimes off-by-one). Stats
🤖 Bug found in |
metagn
added a commit
to metagn/Nim
that referenced
this issue
Dec 8, 2024
closes nim-lang#6013, closes nim-lang#7009, closes nim-lang#9190, closes nim-lang#12487, closes nim-lang#12831, closes nim-lang#13184, closes nim-lang#13252, closes nim-lang#14860, closes nim-lang#14877, closes nim-lang#14894, closes nim-lang#14917, closes nim-lang#16153, closes nim-lang#16439, closes nim-lang#17779, closes nim-lang#18074, closes nim-lang#18202, closes nim-lang#18314, closes nim-lang#18648, closes nim-lang#19063, closes nim-lang#19446, closes nim-lang#20065, closes nim-lang#20367, closes nim-lang#22126, closes nim-lang#22820, closes nim-lang#22888, closes nim-lang#23020, closes nim-lang#23287, closes nim-lang#23510
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Following example would fail with compiler error, playground
Example
Current Output
The text was updated successfully, but these errors were encountered: