Skip to content

Commit 1a1f0e9

Browse files
WalterBrightthewilsonator
authored andcommitted
more cgstate for x86/cod3.d
1 parent 9dce123 commit 1a1f0e9

5 files changed

Lines changed: 128 additions & 128 deletions

File tree

compiler/src/dmd/backend/arm/cod3.d

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ void prolog_genvarargs(ref CGstate cg, ref CodeBuilder cdb, Symbol* sv)
703703
disassemble(c.Iop);
704704
}
705705

706-
assignaddrc(cx);
706+
assignaddrc(cgstate,cx);
707707
cdb.append(cx);
708708
}
709709
}
@@ -751,7 +751,7 @@ void prolog_genvarargs_osx(ref CGstate cg, ref CodeBuilder cdb, Symbol* sv)
751751
code* cx = cdbx.finish();
752752
if (cx)
753753
{
754-
assignaddrc(cx);
754+
assignaddrc(cgstate,cx);
755755

756756
static if (0)
757757
for (code* c = cx; c; c = code_next(c))
@@ -1228,7 +1228,7 @@ void cod3_thunk(Symbol* sthunk,Symbol* sfunc,uint p,tym_t thisty,
12281228
code* c1 = cdbgot.finish();
12291229
if (c1)
12301230
{
1231-
assignaddrc(c1);
1231+
assignaddrc(cgstate,c1);
12321232
cdb.append(c1);
12331233
}
12341234
}
@@ -1721,7 +1721,7 @@ bool orr_solution(ulong value, out uint N, out uint immr, out uint imms)
17211721
* Replace symbolic references with values
17221722
*/
17231723
@trusted
1724-
void assignaddrc(code* c)
1724+
void assignaddrc(ref CGstate cg, code* c)
17251725
{
17261726
//printf("assignaddrc()\n");
17271727
int sn;
@@ -1730,7 +1730,6 @@ void assignaddrc(code* c)
17301730
uint sectionOff;
17311731
ulong offset;
17321732
code* csave = c;
1733-
auto cg = &cgstate;
17341733

17351734
for (; c; c = code_next(c))
17361735
{

compiler/src/dmd/backend/dout.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,7 @@ private void writefunc2(Symbol* sfunc, ref GlobalOptimizer go, ref BlockOpt bo)
11261126
* are relative to the frame pointer.
11271127
* Necessary for nested function access to lexically enclosing frames.
11281128
*/
1129-
cod3_adjSymOffsets();
1129+
cod3_adjSymOffsets(cgstate);
11301130

11311131
if (symbol_iscomdat2(sfunc)) // if generated a COMDAT
11321132
{

compiler/src/dmd/backend/x86/cgcod.d

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -319,15 +319,15 @@ void codgen(Symbol* sfunc)
319319
goto case BC.retexp;
320320

321321
case BC.retexp:
322-
epilog(b);
322+
epilog(cgstate,b);
323323
break;
324324

325325
default:
326326
if (b.Bflags & BFL.epilog)
327-
epilog(b);
327+
epilog(cgstate,b);
328328
break;
329329
}
330-
assignaddr(b); // assign addresses
330+
assignaddr(cgstate,b); // assign addresses
331331
pinholeopt(b.Bcode,b); // do pinhole optimization
332332
if (b.Bflags & BFL.prolog) // do function prolog
333333
{
@@ -955,15 +955,15 @@ else
955955
{
956956
prolog_frameadj(cg, cdbx, tyf, xlocalsize, enter, &pushalloc);
957957
if (cg.Alloca.size)
958-
prolog_setupalloca(cdbx);
958+
prolog_setupalloca(cgstate, cdbx);
959959
}
960960
else if (cg.needframe) /* if variables or parameters */
961961
{
962962
if (xlocalsize) /* if any stack offset */
963963
{
964964
prolog_frameadj(cg, cdbx, tyf, xlocalsize, enter, &pushalloc);
965965
if (cg.Alloca.size)
966-
prolog_setupalloca(cdbx);
966+
prolog_setupalloca(cgstate, cdbx);
967967
}
968968
else
969969
assert(cg.Alloca.size == 0);
@@ -1013,7 +1013,7 @@ Lcont:
10131013
{
10141014
if (variadic(funcsym_p.Stype))
10151015
prolog_gen_win64_varargs(cdb);
1016-
prolog_loadparams(cdb, tyf, pushalloc);
1016+
prolog_loadparams(cgstate, cdb, tyf, pushalloc);
10171017
return;
10181018
}
10191019

@@ -1028,7 +1028,7 @@ Lcont:
10281028
// Load register parameters off of the stack. Do not use
10291029
// assignaddr(), as it will replace the stack reference with
10301030
// the register!
1031-
prolog_loadparams(cdb, tyf, pushalloc);
1031+
prolog_loadparams(cgstate, cdb, tyf, pushalloc);
10321032

10331033
if (sv64)
10341034
prolog_genvarargs(cg, cdb, sv64);

compiler/src/dmd/backend/x86/cod1.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void genEEcode(ref CGstate cg)
321321
cdb.genadjesp(cast(int)cg.EEStack.offset);
322322
gencodelem(cdb, eecontext.EEelem, retregs, false);
323323
code* c = cdb.finish();
324-
assignaddrc(c);
324+
assignaddrc(cg,c);
325325
pinholeopt(c,null);
326326
jmpaddr(c);
327327
eecontext.EEcode = gen1(c, 0xCC); // INT 3

0 commit comments

Comments
 (0)