fix merge conflict
This commit is contained in:
commit
4389409e26
65 changed files with 2187 additions and 917 deletions
|
|
@ -80,11 +80,6 @@ proc isSimpleConst(typ: PType): bool =
|
|||
{tyTuple, tyObject, tyArray, tySet, tySequence} and not
|
||||
(t.kind == tyProc and t.callConv == ccClosure)
|
||||
|
||||
proc useStringh(m: BModule) =
|
||||
if includesStringh notin m.flags:
|
||||
incl m.flags, includesStringh
|
||||
m.includeHeader("<string.h>")
|
||||
|
||||
proc useHeader(m: BModule, sym: PSym) =
|
||||
if lfHeader in sym.loc.flags:
|
||||
assert(sym.annex != nil)
|
||||
|
|
@ -329,10 +324,9 @@ proc resetLoc(p: BProc, loc: var TLoc) =
|
|||
# field, so disabling this should be safe:
|
||||
genObjectInit(p, cpsStmts, loc.t, loc, true)
|
||||
else:
|
||||
useStringh(p.module)
|
||||
# array passed as argument decayed into pointer, bug #7332
|
||||
# so we use getTypeDesc here rather than rdLoc(loc)
|
||||
linefmt(p, cpsStmts, "memset((void*)$1, 0, sizeof($2));$n",
|
||||
linefmt(p, cpsStmts, "#nimZeroMem((void*)$1, sizeof($2));$n",
|
||||
addrLoc(p.config, loc), getTypeDesc(p.module, loc.t))
|
||||
# XXX: We can be extra clever here and call memset only
|
||||
# on the bytes following the m_type field?
|
||||
|
|
@ -345,11 +339,10 @@ proc constructLoc(p: BProc, loc: TLoc, isTemp = false) =
|
|||
getTypeDesc(p.module, typ))
|
||||
else:
|
||||
if not isTemp or containsGarbageCollectedRef(loc.t):
|
||||
# don't use memset for temporary values for performance if we can
|
||||
# don't use nimZeroMem for temporary values for performance if we can
|
||||
# avoid it:
|
||||
if not isImportedCppType(typ):
|
||||
useStringh(p.module)
|
||||
linefmt(p, cpsStmts, "memset((void*)$1, 0, sizeof($2));$n",
|
||||
linefmt(p, cpsStmts, "#nimZeroMem((void*)$1, sizeof($2));$n",
|
||||
addrLoc(p.config, loc), getTypeDesc(p.module, typ))
|
||||
genObjectInit(p, cpsStmts, loc.t, loc, true)
|
||||
|
||||
|
|
@ -680,6 +673,7 @@ proc generateHeaders(m: BModule) =
|
|||
add(m.s[cfsHeaders], "#undef linux\L")
|
||||
add(m.s[cfsHeaders], "#undef mips\L")
|
||||
add(m.s[cfsHeaders], "#undef near\L")
|
||||
add(m.s[cfsHeaders], "#undef far\L")
|
||||
add(m.s[cfsHeaders], "#undef powerpc\L")
|
||||
add(m.s[cfsHeaders], "#undef unix\L")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue