Merge branch 'devel' into sighashes

This commit is contained in:
Araq 2016-12-19 11:35:45 +01:00
commit 237252f90c
14 changed files with 115 additions and 25 deletions

View file

@ -184,24 +184,27 @@ proc freshLineInfo(p: BProc; info: TLineInfo): bool =
result = true
proc genLineDir(p: BProc, t: PNode) =
let info = t.info
#if t.kind in nkCallKinds+{nkStmtListExpr} and t.len > 1: t[1].info
#else: t.info
var line = info.safeLineNm
var tt = t
#while tt.kind in {nkStmtListExpr}+nkCallKinds:
# tt = tt.lastSon
if tt.kind in nkCallKinds and tt.len > 1:
tt = tt.sons[1]
let line = tt.info.safeLineNm
if optEmbedOrigSrc in gGlobalOptions:
add(p.s(cpsStmts), ~"//" & info.sourceLine & rnl)
genCLineDir(p.s(cpsStmts), info.toFullPath, line)
add(p.s(cpsStmts), ~"//" & tt.info.sourceLine & rnl)
genCLineDir(p.s(cpsStmts), tt.info.toFullPath, line)
if ({optStackTrace, optEndb} * p.options == {optStackTrace, optEndb}) and
(p.prc == nil or sfPure notin p.prc.flags):
if freshLineInfo(p, info):
if freshLineInfo(p, tt.info):
linefmt(p, cpsStmts, "#endb($1, $2);$n",
line.rope, makeCString(toFilename(info)))
line.rope, makeCString(toFilename(tt.info)))
elif ({optLineTrace, optStackTrace} * p.options ==
{optLineTrace, optStackTrace}) and
(p.prc == nil or sfPure notin p.prc.flags) and info.fileIndex >= 0:
if freshLineInfo(p, info):
(p.prc == nil or sfPure notin p.prc.flags) and tt.info.fileIndex >= 0:
if freshLineInfo(p, tt.info):
linefmt(p, cpsStmts, "nimln($1, $2);$n",
line.rope, info.quotedFilename)
line.rope, tt.info.quotedFilename)
proc postStmtActions(p: BProc) {.inline.} =
add(p.s(cpsStmts), p.module.injectStmt)