Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Apr 11, 2020
1 parent ec0fc8f commit 691e2b1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion compiler/ccgmerge.nim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const
cfsTypes: "NIM_merge_TYPES",
cfsSeqTypes: "NIM_merge_SEQ_TYPES",
cfsFieldInfo: "NIM_merge_FIELD_INFO",
cfsEmits: "NIM_merge_EMITS",
cfsTypeInfo: "NIM_merge_TYPE_INFO",
cfsProcHeaders: "NIM_merge_PROC_HEADERS",
cfsData: "NIM_merge_DATA",
Expand Down
4 changes: 2 additions & 2 deletions compiler/ccgstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1455,12 +1455,12 @@ proc genAsmStmt(p: BProc, t: PNode) =
# work:
if p.prc == nil:
# top level asm statement?
p.module.s[cfsEmits].add runtimeFormat(CC[p.config.cCompiler].asmStmtFrmt, [s])
p.module.s[cfsProcHeaders].add runtimeFormat(CC[p.config.cCompiler].asmStmtFrmt, [s])
else:
p.s(cpsStmts).add indentLine(p, runtimeFormat(CC[p.config.cCompiler].asmStmtFrmt, [s]))

proc determineSection(n: PNode): TCFileSection =
result = cfsEmits # WAS: cfsProcHeaders
result = cfsProcHeaders
if n.len >= 1 and n[0].kind in {nkStrLit..nkTripleStrLit}:
let sec = n[0].strVal
if sec.startsWith("/*TYPESECTION*/"): result = cfsTypes
Expand Down
1 change: 0 additions & 1 deletion compiler/cgendata.nim
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type
# this is needed for strange type generation
# reasons
cfsFieldInfo, # section for field information
cfsEmits, # section for {.emit.} (default location)
cfsTypeInfo, # section for type information (ag ABI checks)
cfsProcHeaders, # section for C procs prototypes
cfsData, # section for C constant data
Expand Down
2 changes: 1 addition & 1 deletion tests/misc/msizeof5.nim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## tests for -d:checkAbi used by addAbiCheck via NIM_STATIC_ASSERT

{.emit:"""
{.emit:"""/*TYPESECTION*/
struct Foo1{
int a;
};
Expand Down
4 changes: 2 additions & 2 deletions tests/trunner.nim
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ else: # don't run twice the same test
block: # ABI checks
let file = "misc/msizeof5.nim"
block:
let (_, exitCode) = runCmd(file, "-d:checkAbi")
doAssert exitCode == 0
let (output, exitCode) = runCmd(file, "-d:checkAbi")
doAssert exitCode == 0, output
block:
let (output, exitCode) = runCmd(file, "-d:checkAbi -d:caseBad")
# on platforms that support _StaticAssert natively, errors will show full context, eg:
Expand Down

0 comments on commit 691e2b1

Please sign in to comment.