Skip to content
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

adds --legacy:noAsmSemSymbol #24571

Open
wants to merge 3 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ rounding guarantees (via the
- Unknown warnings and hints now gives warnings `warnUnknownNotes` instead of
errors.

- With `-d:nimPreviewAsmSemSymbol`, backticked symbols are type checked in the `asm/emit` statements.
- backticked symbols are type checked in the `asm/emit` statements. Use `--legacy:noAsmSemSymbol` for a transitional period.

## Standard library additions and changes

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")

defineSymbol("nimHasAsmSemSymbol")
1 change: 0 additions & 1 deletion compiler/nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ define:nimPreviewProcConversion
define:nimPreviewRangeDefault
define:nimPreviewNonVarDestructor
define:nimPreviewCheckedClose
define:nimPreviewAsmSemSymbol
threads:off

#import:"$projectpath/testability"
Expand Down
2 changes: 2 additions & 0 deletions compiler/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ type
## Old transformation for closures in JS backend
noStrictDefs
## disable "strictdefs"
noAsmSemSymbol
## disable type checking for backticked symbols in the `asm/emit` statements

SymbolFilesOption* = enum
disabledSf, writeOnlySf, readOnlySf, v2Sf, stressTest
Expand Down
7 changes: 4 additions & 3 deletions compiler/pragmas.nim
Original file line number Diff line number Diff line change
Expand Up @@ -637,10 +637,11 @@ proc semAsmOrEmit*(con: PContext, n: PNode, marker: char): PNode =
# XXX what to do here if 'amb' is true?
if e != nil:
incl(e.flags, sfUsed)
if isDefined(con.config, "nimPreviewAsmSemSymbol"):
result.add con.semExprWithType(con, newSymNode(e), {efTypeAllowed})
else:

if noAsmSemSymbol in con.config.legacyFeatures:
result.add newSymNode(e)
else:
result.add con.semExprWithType(con, newSymNode(e), {efTypeAllowed})
else:
result.add newStrNode(nkStrLit, sub)
else:
Expand Down
1 change: 0 additions & 1 deletion tests/config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ switch("define", "nimPreviewHashRef")
switch("define", "nimPreviewRangeDefault")
switch("define", "nimPreviewNonVarDestructor")
switch("define", "nimPreviewCheckedClose")
switch("define", "nimPreviewAsmSemSymbol")

switch("warningAserror", "UnnamedBreak")
when not defined(testsConciseTypeMismatch):
Expand Down
Loading