Add line directives for C code variables

This commit is contained in:
Joey Yakimowich-Payne 2023-03-03 16:41:39 -07:00
commit 344e3cbc05
No known key found for this signature in database
GPG key ID: 6BFE655FA5ABD1E1

View file

@ -566,6 +566,9 @@ proc localVarDecl(p: BProc; n: PNode): Rope =
if s.kind == skLet: incl(s.loc.flags, lfNoDeepCopy)
if s.kind in {skLet, skVar, skField, skForVar} and s.alignment > 0:
result.addf("NIM_ALIGN($1) ", [rope(s.alignment)])
genCLineDir(result, toFullPath(p.config, n.info), n.info.safeLineNm, p.config)
result.add getTypeDesc(p.module, s.typ, skVar)
if s.constraint.isNil:
if sfRegister in s.flags: result.add(" register")