Skip to content

Commit

Permalink
fix forward type issue, now "compiles" hello world but output c is br…
Browse files Browse the repository at this point in the history
…oken
  • Loading branch information
metagn committed Nov 29, 2024
1 parent 1bd1a5c commit 9c95831
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions compiler/ccgtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ proc getTypeDescAux(m: BModule; origTyp: PType, check: var IntSet; kind: TypeDes
let name = getTypeForward(m, et, hashType(et, m.config))
result = wrapStar(name)
m.typeCache[sig] = result
pushType(m, et)
of tySequence:
if optSeqDestructors in m.config.globalOptions:
result = wrapStar(getTypeDescWeak(m, et, check, kind))
Expand Down
3 changes: 1 addition & 2 deletions compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1655,10 +1655,9 @@ proc getSomeInitName(m: BModule, suffix: string): Rope =
proc getInitName(m: BModule): Rope =
if sfMainModule in m.module.flags:
# generate constant name for main module, for "easy" debugging.
result = rope(m.config.nimMainPrefix) & rope"NimMainModule"
result = cSymbol(rope(m.config.nimMainPrefix) & rope"NimMainModule")
else:
result = getSomeInitName(m, "Init000")
result = cSymbol(result)

proc getDatInitName(m: BModule): Rope = getSomeInitName(m, "DatInit000")
proc getHcrInitName(m: BModule): Rope = getSomeInitName(m, "HcrInit000")
Expand Down
2 changes: 2 additions & 0 deletions compiler/condsyms.nim
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,5 @@ proc initDefines*(symbols: StringTableRef) =
defineSymbol("nimHasXorSet")

defineSymbol("nimHasLegacyNoStrictDefs")
when defined(nimCompileToNifc):
defineSymbol("nifc")
7 changes: 6 additions & 1 deletion lib/system.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1720,11 +1720,16 @@ when not defined(nimscript):
when not declared(sysFatal):
include "system/fatal"

when defined(nifc):
{.pragma: tframe, compilerproc.}
else:
{.pragma: tframe, importc, nodecl.}

type
PFrame* = ptr TFrame ## Represents a runtime frame of the call stack;
## part of the debugger API.
# keep in sync with nimbase.h `struct TFrame_`
TFrame* {.importc, nodecl, final.} = object ## The frame itself.
TFrame* {.tframe, final.} = object ## The frame itself.
prev*: PFrame ## Previous frame; used for chaining the call stack.
procname*: cstring ## Name of the proc that is currently executing.
line*: int ## Line number of the proc that is currently executing.
Expand Down

0 comments on commit 9c95831

Please sign in to comment.