Skip to content

Commit

Permalink
docs: update mentions of astgen
Browse files Browse the repository at this point in the history
The module is named `cgirgen` now. `debug.rst` also contained outdated
mentions of `PNode` being the IR the code generators -- this is fixed
too.
  • Loading branch information
zerbina committed Aug 4, 2023
1 parent 1092b3f commit 6775403
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions compiler/backend/ccgexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ proc genAssignment(p: BProc, dest, src: TLoc) =
linefmt(p, cpsStmts, "#nimCopyMem((void*)$1, (NIM_CONST void*)$2, $3);$n",
[rdLoc(dest), rdLoc(src), getSize(p.config, dest.t)])
of ctNimOpenArray:
# HACK: ``astgen`` elides to-openArray-conversion operations, so we
# HACK: ``cgirgen`` elides to-openArray-conversion operations, so we
# need to reconstruct that information here. Remove this case
# once ``astgen`` no longer elides the operations
# once ``cgirgen`` no longer elides the operations
if reifiedOpenArray(dest.lode):
genOpenArrayConv(p, dest, src)
else:
Expand Down
2 changes: 1 addition & 1 deletion compiler/mir/mirtrees.nim
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ type
mnkConv ## ``conv(x)``; a conversion. Depending on the source and
## target type, lvalue-ness is preserved
# XXX: distinguishing between ``stdConv`` and ``conv`` is only done to
# make ``astgen`` a bit more efficient. Further progress should focus
# make ``cgirgen`` a bit more efficient. Further progress should focus
# on removing the need for it
mnkCast ## ``cast(x)``; produces a new *instance* of the input value
## with a different type
Expand Down
2 changes: 1 addition & 1 deletion compiler/sem/injectdestructors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ func undoConversions(buf: var MirNodeSeq, tree: MirTree, src: OpValue) =
## When performing a destructive move for ``ref`` values, it's possible for
## the source to be an lvalue conversion -- in that case, we want pass the
## uncoverted root location to the ``wasMoved`` operation. To do so, we apply
## the conversions in *reverse*. ``astgen`` detects this pattern and removes
## the conversions in *reverse*. ``cgirgen`` detects this pattern and removes
## the conversions that cancel each other out.
var p = NodePosition(src)
while tree[p].kind in {mnkStdConv, mnkConv}:
Expand Down
2 changes: 1 addition & 1 deletion compiler/vm/vmgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2759,7 +2759,7 @@ proc genLvalue(c: var TCtx, n: CgNode, dest: var TDest) =
of cnkCall:
# we only reach this case for ``HiddenAddr (DerefView (Call ...))``.
# Generate the call returning a view as is
# XXX: ``astgen`` should not emit these instead
# XXX: ``cgirgen`` should not emit these instead
assert isLocView(n.typ)
gen(c, n, dest)
of cnkStmtListExpr:
Expand Down
4 changes: 2 additions & 2 deletions doc/debug.rst
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,8 @@ printed twice.
To print the generated MIR code for a procedure, `--define:nimShowMir=name`
can be used. The same limitation as for `nimShowMirInput` apply.

`--define:nimShowMirOutput=name` prints the `PNode`-AST that is output by
`astgen`. This is AST that the code-generators will operate on.
`--define:nimShowMirOutput=name` prints the `CgNode`-IR that is output by
`cgirgen`. This is IR that the code generators operate on.

While all of the defines listed above can be used simultaneously, only a single
occurrence of each is considered. Each further occurrence will override the
Expand Down
2 changes: 1 addition & 1 deletion tests/lang_callable/generics/tobjecttyperel.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ cool
test'''
"""

# knownIssue: fails for the VM target because ``astgen`` emits the
# knownIssue: fails for the VM target because ``cgirgen`` emits the
# incorrect conversion operator for ``ref`` types involving
# generics

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type
x is MyType

# semantic analysis changes the type of the ``nkObjConstr`` node to a resolved
# ``tyUserTypeClass``, which is something not considered by ``astgen`` and the
# ``tyUserTypeClass``, which is something not considered by ``cgirgen`` and the
# code generators
var x: Concept = MyType(val: 1)
doAssert x.val == 1
2 changes: 1 addition & 1 deletion tests/lang_experimental/views/tviews_in_object.nim
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ testCase(seq[int], @[1]):
doAssert o.field[0] == 1 # subscript access works
doAssert o.field == [1]

# XXX: internal compiler error in ``astgen``
# XXX: internal compiler error in ``cgirgen``
when false:
# test: single tuple location
testCase(tuple[x: int], (1,)):
Expand Down

0 comments on commit 6775403

Please sign in to comment.