semAsm get's the asm stategment like this:
nkAsmStmt
nkEmpty
nnkTripleStrLit("some asm")
after semAsmOrEmit it becomes and then wrong version used by C backend
nkAsmStmt
nnkTripleStrLit("some asm")
node after this just have other structure (dropped pragmas). In my opinion, this should not be the case
I don't get what you mean, I think you need to provide more context?
I think an empty statement was removed? I think its very common for nodes to shift around and morph into other nodes when Nim goes through various passes from untyped to typed for example.
Is that the first node of nkStmtAsm node, reserved for pragmas, is deleted after semAsmOrEmit and essentially loses its structure, yes nodes can change, but the structure of nodes always remains, for example the structure of nkInfix will always be like this:
nkInfix
name
a
b
Ast transformations shouldn't change that.