This repository has been archived by the owner on Jul 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
/
c2go.cfg
3289 lines (3051 loc) · 61.6 KB
/
c2go.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package src/cmd/ld/* cmd/internal/ld
package src/cmd/6l/* cmd/new6l
package src/cmd/8l/* cmd/new8l
package src/cmd/9l/* cmd/new9l
package src/cmd/5l/* cmd/new5l
package src/liblink/* include/* src/cmd/ld/textflag.h src/runtime/*h internal/libc.h cmd/internal/obj
package src/liblink/*5.c src/cmd/5l/*.out.h cmd/internal/obj/arm
package src/liblink/*6.c src/cmd/6l/*.out.h cmd/internal/obj/x86
package src/liblink/*8.c src/cmd/8l/*.out.h cmd/internal/obj/i386
package src/liblink/*9.c src/cmd/9l/*.out.h cmd/internal/obj/ppc64
package src/liblink/objfilego.c main
package src/cmd/5a/* cmd/new5a
package src/cmd/6a/* cmd/new6a
package src/cmd/8a/* cmd/new8a
package src/cmd/9a/* cmd/new9a
package src/cmd/cc/*body cmd/internal/asm
package src/cmd/gc/* cmd/internal/gc
package src/cmd/5g/* cmd/new5g
package src/cmd/6g/* cmd/new6g
package src/cmd/8g/* cmd/new8g
package src/cmd/9g/* cmd/new9g
delete dnames5 dnames6 dnames8 dnames9
delete emallocz estrdup erealloc
delete find1 nuxiinit fnuxi8 fnuxi4 inuxi1 inuxi2 inuxi4 inuxi8 atolwhex
delete writeobj
# we define our own Biobuf
delete Biobuf
slice LSym.p LSym.np LSym.maxp
slice LSym.r LSym.nr LSym.maxr
slice Link.library Link.libraryp Link.nlibrary
slice Link.libdir Link.nlibdir Link.maxlibdir
slice Arch.typedefs
slice InitPlan.e InitPlan.len InitPlan.cap
bool yy_isalpha.return
ptr bytereg.t
slice doasm.mo
slice Pcdata.p Pcdata.n Pcdata.m
export linkamd64 linkamd64p32 link386 linkarm linkppc64 linkppc64le linknew binitw writeobjdirect linklinehist linknewplist
rename regstr Register
rename anames8 Anames
rename anames6 Anames
rename anames5 Anames
rename anames9 Anames
func Expandpkg(t0 string, pkg string) string {
return strings.Replace(t0, `"".`, pkg+".", -1)
}
func Symgrow(ctxt *Link, s *LSym, lsiz int64) {
var siz int
siz = int(lsiz)
if int64(siz) != lsiz {
log.Fatal("Symgrow size %d too long", lsiz)
}
if len(s.P) >= siz {
return
}
for cap(s.P) < siz {
s.P = append(s.P[:cap(s.P)], 0)
}
s.P = s.P[:siz]
}
func savedata(ctxt *Link, s *LSym, p *Prog, pn string) {
off := int32(p.From.Offset)
siz := int32(p.From3.Offset)
if off < 0 || siz < 0 || off >= 1<<30 || siz >= 100 {
mangle(pn)
}
if ctxt.Enforce_data_order != 0 && off < int32(len(s.P)) {
ctxt.Diag("data out of order (already have %d)\n%P", len(s.P), p)
}
Symgrow(ctxt, s, int64(off+siz))
switch int(p.To.Type) {
default:
ctxt.Diag("bad data: %P", p)
case TYPE_FCONST:
switch siz {
default:
ctxt.Diag("unexpected %d-byte floating point constant", siz)
case 4:
flt := math.Float32bits(float32(p.To.U.Dval))
ctxt.Arch.ByteOrder.PutUint32(s.P[off:], flt)
case 8:
flt := math.Float64bits(p.To.U.Dval)
ctxt.Arch.ByteOrder.PutUint64(s.P[off:], flt)
}
case TYPE_SCONST:
copy(s.P[off:off+siz], p.To.U.Sval)
case TYPE_CONST, TYPE_ADDR:
if p.To.Sym != nil || int(p.To.Type) == TYPE_ADDR {
r := Addrel(s)
r.Off = off
r.Siz = uint8(siz)
r.Sym = p.To.Sym
r.Type = R_ADDR
r.Add = p.To.Offset
break
}
o := p.To.Offset
switch siz {
default:
ctxt.Diag("unexpected %d-byte integer constant", siz)
case 1:
s.P[off] = byte(o)
case 2:
ctxt.Arch.ByteOrder.PutUint16(s.P[off:], uint16(o))
case 4:
ctxt.Arch.ByteOrder.PutUint32(s.P[off:], uint32(o))
case 8:
ctxt.Arch.ByteOrder.PutUint64(s.P[off:], uint64(o))
}
}
}
func Addrel(s *LSym) *Reloc {
s.R = append(s.R, Reloc{})
return &s.R[len(s.R)-1]
}
export setuintxx
func Setuintxx(ctxt *Link, s *LSym, off int64, v uint64, wid int64) int64 {
if s.Type == 0 {
s.Type = SDATA
}
s.Reachable = 1
if s.Size < off+wid {
s.Size = off + wid
Symgrow(ctxt, s, s.Size)
}
switch wid {
case 1:
s.P[off] = uint8(v)
case 2:
ctxt.Arch.ByteOrder.PutUint16(s.P[off:], uint16(v))
case 4:
ctxt.Arch.ByteOrder.PutUint32(s.P[off:], uint32(v))
case 8:
ctxt.Arch.ByteOrder.PutUint64(s.P[off:], uint64(v))
}
return off+wid
}
diff {
type LinkArch struct {
+ ByteOrder binary.ByteOrder
}
diff {
type LinkArch struct {
+ Rconv func(int) string
}
diff {
type LinkArch struct {
+ Dconv func(*Prog, int, *Addr) string
}
func addlib(ctxt *Link, src, obj, pathname string) {
name := path.Clean(pathname)
// runtime.a -> runtime
short := strings.TrimSuffix(name, ".a")
// already loaded?
for i := range ctxt.Library {
if ctxt.Library[i].Pkg == short {
return
}
}
var pname string
// runtime -> runtime.a for search
if (!(ctxt.Windows != 0) && name[0] == '/') || (ctxt.Windows != 0 && name[1] == ':') {
pname = name
} else {
// try dot, -L "libdir", and then goroot.
for _, dir := range ctxt.Libdir {
pname = dir + "/" + name
if _, err := os.Stat(pname); !os.IsNotExist(err) {
break
}
}
}
pname = path.Clean(pname)
// runtime.a -> runtime
pname = strings.TrimSuffix(pname, ".a")
if ctxt.Debugvlog > 1 && ctxt.Bso != nil {
fmt.Fprintf(ctxt.Bso, "%5.2f addlib: %s %s pulls in %s\n", Cputime(), obj, src, pname)
}
Addlibpath(ctxt, src, obj, pname, name)
}
func Addlibpath(ctxt *Link, srcref, objref, file, pkg string) {
for _, lib := range ctxt.Library {
if lib.File == file {
return
}
}
if ctxt.Debugvlog > 1 && ctxt.Bso != nil {
fmt.Fprintf(ctxt.Bso, "%5.2f addlibpath: srcref: %s objref: %s file: %s pkg: %s\n", Cputime(), srcref, objref, file, pkg)
}
ctxt.Library = append(ctxt.Library, Library{
Objref: objref,
Srcref: srcref,
File: file,
Pkg: pkg,
})
}
diff {
func Copyp(ctxt *Link, q *Prog) *Prog {
}
export linklinefmt
diff {
-func linklinefmt(ctxt *Link, lno0 int, showAll, showFullPath bool) string {
+func Linklinefmt(ctxt *Link, lno0 int, showAll, showFullPath bool) string {
}
func linklinefmt(ctxt *Link, lno0 int, showAll, showFullPath bool) string {
var a [HISTSZ]struct {
incl *Hist
idel int32
line *Hist
ldel int32
}
lno := int32(lno0)
lno1 := lno
var d int32
var i int
var n int
var h *Hist
n = 0
var fp string
for h = ctxt.Hist; h != nil; h = h.Link {
if h.Offset < 0 {
continue
}
if lno < h.Line {
break
}
if h.Name != "<pop>" {
if h.Offset > 0 {
// #line directive
if n > 0 && n < int(HISTSZ) {
a[n-1].line = h
a[n-1].ldel = h.Line - h.Offset + 1
}
} else {
// beginning of file
if n < int(HISTSZ) {
a[n].incl = h
a[n].idel = h.Line
a[n].line = nil
}
n++
}
continue
}
n--
if n > 0 && n < int(HISTSZ) {
d = h.Line - a[n].incl.Line
a[n-1].ldel += d
a[n-1].idel += d
}
}
if n > int(HISTSZ) {
n = int(HISTSZ)
}
for i = n - 1; i >= 0; i-- {
if i != n-1 {
if !showAll {
break
}
fp += " "
}
if ctxt.Debugline != 0 || showFullPath {
fp += fmt.Sprintf("%s/", ctxt.Pathname)
}
if a[i].line != nil {
fp += fmt.Sprintf("%s:%d[%s:%d]", a[i].line.Name, lno-a[i].ldel+1, a[i].incl.Name, lno-a[i].idel+1)
} else {
fp += fmt.Sprintf("%s:%d", a[i].incl.Name, lno-a[i].idel+1)
}
lno = a[i].incl.Line - 1 // now print out start of this file
}
if n == 0 {
fp += fmt.Sprintf("<unknown line number %d %d %d %s>", lno1, ctxt.Hist.Offset, ctxt.Hist.Line, ctxt.Hist.Name)
}
return fp
}
func haspathprefix(s string, t string) bool {
var i int
var cs int
var ct int
if len(t) > len(s) {
return false
}
for i = 0; i < len(t); i++ {
cs = int(s[i])
ct = int(t[i])
if 'A' <= cs && cs <= 'Z' {
cs += 'a' - 'A'
}
if 'A' <= ct && ct <= 'Z' {
ct += 'a' - 'A'
}
if cs == '\\' {
cs = '/'
}
if ct == '\\' {
ct = '/'
}
if cs != ct {
return false
}
}
return i >= len(s) || s[i] == '/' || s[i] == '\\'
}
func linkgetline(ctxt *Link, line int32, f **LSym, l *int32) {
var a [HISTSZ]struct {
incl *Hist
idel int32
line *Hist
ldel int32
}
var lno int32
var d int32
var dlno int32
var n int
var h *Hist
var buf string
var buf1 string
var file string
lno = int32(line)
n = 0
for h = ctxt.Hist; h != nil; h = h.Link {
if h.Offset < 0 {
continue
}
if lno < h.Line {
break
}
if h.Name != "<pop>" {
if h.Offset > 0 {
// #line directive
if n > 0 && n < HISTSZ {
a[n-1].line = h
a[n-1].ldel = h.Line - h.Offset + 1
}
} else {
// beginning of file
if n < HISTSZ {
a[n].incl = h
a[n].idel = h.Line
a[n].line = nil
}
n++
}
continue
}
n--
if n > 0 && n < HISTSZ {
d = h.Line - a[n].incl.Line
a[n-1].ldel += d
a[n-1].idel += d
}
}
if n > HISTSZ {
n = HISTSZ
}
if n <= 0 {
*f = Linklookup(ctxt, "??", HistVersion)
*l = 0
return
}
n--
if a[n].line != nil {
file = a[n].line.Name
dlno = a[n].ldel - 1
} else {
file = a[n].incl.Name
dlno = a[n].idel - 1
}
if (ctxt.Windows == 0 && file[0] == '/') || (ctxt.Windows != 0 && file[1] == ':') || file[0] == '<' {
buf = fmt.Sprintf("%s", file)
} else {
buf = fmt.Sprintf("%s/%s", ctxt.Pathname, file)
}
// Remove leading ctxt->trimpath, or else rewrite $GOROOT to $GOROOT_FINAL.
if ctxt.Trimpath != "" && haspathprefix(buf, ctxt.Trimpath) {
if len(buf) == len(ctxt.Trimpath) {
buf = "??"
} else {
buf1 = fmt.Sprintf("%s", buf[len(ctxt.Trimpath)+1:])
if buf1[0] == '\x00' {
buf1 = "??"
}
buf = buf1
}
} else if ctxt.Goroot_final != "" && haspathprefix(buf, ctxt.Goroot) {
buf1 = fmt.Sprintf("%s%s", ctxt.Goroot_final, buf[len(ctxt.Goroot):])
buf = buf1
}
lno -= dlno
*f = Linklookup(ctxt, buf, HistVersion)
*l = lno
}
func linkprfile(ctxt *Link, line int) {
l := int32(line)
var i int
var n int
var a [HISTSZ]Hist
var h *Hist
var d int32
n = 0
for h = ctxt.Hist; h != nil; h = h.Link {
if l < h.Line {
break
}
if h.Name != "<pop>" {
if h.Offset == 0 {
if n >= 0 && n < HISTSZ {
a[n] = *h
}
n++
continue
}
if n > 0 && n < HISTSZ {
if a[n-1].Offset == 0 {
a[n] = *h
n++
} else {
a[n-1] = *h
}
}
continue
}
n--
if n >= 0 && n < HISTSZ {
d = h.Line - a[n].Line
for i = 0; i < n; i++ {
a[i].Line += d
}
}
}
if n > HISTSZ {
n = HISTSZ
}
for i = 0; i < n; i++ {
fmt.Printf("%s:%d ", a[i].Name, int(l-a[i].Line+a[i].Offset+1))
}
}
func wrdata(b *Biobuf, v []byte) {
wrint(b, int64(len(v)))
Bwrite(b, v)
}
func wrstring(b *Biobuf, s string) {
wrint(b, int64(len(s)))
b.w.WriteString(s)
}
func wrpath(ctxt *Link, b *Biobuf, p string) {
wrstring(b, filepath.ToSlash(p))
}
func wrint(b *Biobuf, sval int64) {
var uv uint64
var v uint64
var buf [10]uint8
var p []uint8
uv = (uint64(sval) << 1) ^ uint64(int64(sval>>63))
p = buf[:]
for v = uv; v >= 0x80; v >>= 7 {
p[0] = uint8(v | 0x80)
p = p[1:]
}
p[0] = uint8(v)
p = p[1:]
Bwrite(b, buf[:len(buf)-len(p)])
}
slice Pcln.funcdata Pcln.nfuncdata Pcln.mfuncdata
slice Pcln.pcdata Pcln.npcdata Pcln.mpcdata
slice Pcln.file Pcln.nfile Pcln.mfile
slice Pcln.funcdataoff Pcln.nfuncdata
func addvarint(ctxt *Link, d *Pcdata, val uint32) {
var v uint32
for v = val; v >= 0x80; v >>= 7 {
d.P = append(d.P, uint8(v|0x80))
}
d.P = append(d.P, uint8(v))
}
diff {
- for i = 0; i < int32(len(pcln.File)); i++ {
- if pcln.File[i] == f {
- pcln.Lastfile = f
- pcln.Lastindex = int(i)
- return i
- }
- }
-
- if len(pcln.File) >= cap(pcln.File) {
- cap(pcln.File) = (len(pcln.File) + 1) * 2
- pcln.File = erealloc(pcln.File, cap(pcln.File)*sizeof(pcln.File[0])).([]*LSym)
- }
-
- pcln.File[len(pcln.File)] = f
- len(pcln.File)++
+ for i = 0; i < int32(len(pcln.File)); i++ {
+ file := pcln.File[i]
+ if file == f {
+ pcln.Lastfile = f
+ pcln.Lastindex = int(i)
+ return int32(i)
+ }
+ }
+ pcln.File = append(pcln.File, f)
}
diff {
- var n int
- var havepc *uint32
- var havefunc *uint32
}
diff {
- n = ((npcdata+31)/32 + (nfuncdata+31)/32) * 4
-
- havepc = (*uint32)(make([]byte, n))
- havefunc = havepc + (npcdata+31)/32
+ havepc := make([]uint32, (npcdata+31)/32)
+ havefunc := make([]uint32, (nfuncdata+31)/32)
}
func yy_isalpha(c int) bool {
return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z'
}
diff {
- nuxiinit(arch)
}
diff {
- ctxt.Goroot_final = Getenv("GOROOT_FINAL")
- if ctxt.Goroot_final != "" && ctxt.Goroot_final[0] == '\x00' {
- ctxt.Goroot_final = ""
- }
+ ctxt.Goroot_final = os.Getenv("GOROOT_FINAL")
}
diff {
- p = obj.Getgoarch()
+ p = Getgoarch()
}
diff {
- if getwd(buf, sizeof(buf)) == 0 {
- buf = "/???"
- }
- if yy_isalpha(int(buf[0])) && buf[1] == ':' {
- // On Windows.
- ctxt.Windows = 1
-
- // Canonicalize path by converting \ to / (Windows accepts both).
- for p = buf; p[0] != 0; p = p[1:] {
- if p[0] == '\\' {
- p[0] = '/'
- }
- }
- }
+ buf, _ = os.Getwd()
+ if buf == "" {
+ buf = "/???"
+ }
+ buf = filepath.ToSlash(buf)
}
export linksymfmt
func Linksymfmt(s *LSym) string {
if s == nil {
return "<nil>"
}
return s.Name
}
slice asmoutnacl.out
slice asmout.out
bool immfloat.return
bool immhalf.return
bool cmp.return
bool isdata.return
bool iscall.return
bool LinkArch.iscall.return
bool LinkArch.isdata.return
diff {
- xcmp[i][n] = uint8(bool2int(cmp(n, i)))
+ if cmp(n, i) {
+ xcmp[i][n] = 1
+ }
}
diff {
- fmt.Fprintf(ctxt.Bso, "%5.2f span1\n", obj.Cputime())
+ fmt.Fprintf(ctxt.Bso, "%5.2f span1\n", obj.Cputime())
}
slice oplook.o
slice oplook.e
slice Oprang.start
slice Oprang.stop
delete listinit5 listinit6 listinit8 listinit9
diff {
- op = string(&"<<>>->@>"[((v>>5)&3)<<1])
+ op = string("<<>>->@>"[((v>>5)&3)<<1:])
}
delete DSconv
diff {
type Prog struct {
+ Ctxt *Link
}
diff {
type LinkArch struct {
+ Pconv func(*Prog) string
}
diff {
= obj.LinkArch{
+ Pconv: Pconv,
}
diff {
amd64 = obj.LinkArch{
+ ByteOrder: binary.LittleEndian,
}
diff {
amd64p32 = obj.LinkArch{
+ ByteOrder: binary.LittleEndian,
}
diff {
arm = obj.LinkArch{
+ ByteOrder: binary.LittleEndian,
}
diff {
386 = obj.LinkArch{
+ ByteOrder: binary.LittleEndian,
}
diff {
ppc64 = obj.LinkArch{
+ ByteOrder: binary.BigEndian,
}
diff {
ppc64le = obj.LinkArch{
+ ByteOrder: binary.LittleEndian,
}
diff {
= obj.LinkArch{
+ Rconv: Rconv,
}
diff {
= obj.LinkArch{
+ Dconv: Dconv,
}
diff {
- obj.Memmove(p, nop[m-1], m)
+ copy(p[:m], nop[m-1][:m])
}
diff {
- obj.Memmove(s.P[p.Pc:], ctxt.And, m)
+ copy(s.P[p.Pc:][:m], ctxt.And[:m])
}
# TODO(rsc): Why does len rewrite not catch this?
diff {
- wrdata(b, s.P, len(s.P))
+ wrdata(b, s.P)
}
diff {
- obj.Memmove(and0[np+1:], and0[np:], n-np)
+ copy(and0[np+1:], and0[np:n])
}
diff {
- fmt.Fprintf(ctxt.Bso, "%5.2f noops\n", obj.Cputime())
+ fmt.Fprintf(ctxt.Bso, "%5.2f noops\n", obj.Cputime())
}
diff {
- cast = []byte(&out[i])
- for j = 0; j < 4; j++ {
- bp[0] = cast[obj.Inuxi4[j]]
- bp = bp[1:]
- }
+ ctxt.Arch.ByteOrder.PutUint32(bp, out[i])
+ bp = bp[4:]
}
diff {
var i int32
- var j int32
var bp []byte
- var cast []byte
}
diff {
- var p string
var h uint32
- var c int
h = uint32(v)
- for p = symb; ; p = p[1:] {
- c = int(p[0])
- if c == 0 {
- break
- }
+ for i := 0; i < len(symb); i++ {
+ c := int(symb[i])
}
diff {
- StackPreempt = 1
+ StackPreempt = -1314 // 0xfff...fade
}
diff {
- p.From.Offset = int64(uint32(obj.StackPreempt))
+ p.From.Offset = int64(uint32(obj.StackPreempt & (1<<32-1)))
}
diff {
- p.To.Offset = int64(uint32(obj.StackPreempt))
+ p.To.Offset = int64(uint32(obj.StackPreempt & (1<<32-1)))
}
diff {
- if (ctxt.Windows == 0 && file[0] == '/') || (ctxt.Windows != 0 && file[1] == ':') || file[0] == '<' {
+ if filepath.IsAbs(file) || strings.HasPrefix(file, "<") {
}
diff {
- p = Getgoarch()
- if p != arch.Name {
- log.Fatalf("invalid goarch %s (want %s)", p, arch.Name)
- }
-
}
# export linkprfile via diff, because it was supplied as a func above.
# the matching for the func doesn't work right if you say func Linkprfile,
# but the func overrides any 'export linkprfile'.
diff {
-func linkprfile(ctxt *Link, line int) {
+func Linkprfile(ctxt *Link, line int) {
}
func prg() *obj.Prog {
p := zprg
return &p
}
diff {
- Exits("unknown experiment")
+ os.Exit(2)
}
func linksetexp() {
for _, f := range strings.Split(goexperiment, ",") {
if f != "" {
addexp(f)
}
}
}
export expstring
func Expstring() string {
buf := "X"
for i := range exper {
if *exper[i].val != 0 {
buf += "," + exper[i].name
}
}
if buf == "X" {
buf += ",none"
}
return "X:" + buf[2:]
}
diff {
- ctxt.Diag("argument %v is TYPE_CONST, should be TYPE_ADDR, in %v", Dconv(p, 0, a), p)
+ ctxt.Diag("argument is TYPE_CONST, should be TYPE_ADDR, in %v", p)
}
diff {
- ctxt.Diag("argument %v is TYPE_ADDR, should be TYPE_CONST, in %v", Dconv(p, 0, a), p)
+ ctxt.Diag("argument is TYPE_ADDR, should be TYPE_CONST, in %v", p)
}
diff {
- ctxt.Diag("invalid encoding for argument %v in %v", Dconv(p, 0, a), p)
+ ctxt.Diag("invalid encoding for argument %v", p)
}
diff {
- ArgsSizeUnknown = 0x80000000
+ ArgsSizeUnknown = -0x80000000
}
diff {
-new(Prog)
+ctxt.NewProg()
}
diff {
- if str[0] == 0 {
+ if str == "" {
str += "[R"
}
# compiler starts roughly here
diff {
- b [XXX]uint32
+ b []uint32
}
func bvalloc(n int32) *Bvec {
return &Bvec{n, make([]uint32, bvsize(uint32(n))/4)}
}
diff {
- return obj.Memcmp(bv1.b, bv2.b, int(nbytes))
+ for i, x := range bv1.b {
+ if x != bv2.b[i] {
+ return 1
+ }
+ }
+ return 0
}
diff {
- obj.Memmove(dst.b, src.b, bvsize(uint32(dst.n)))
+ for i, x := range src.b {
+ dst.b[i] = x
+ }
}
diff {
- obj.Memset(bv.b, 0x00, bvsize(bv.n))
+ for i := range bv.b {
+ bv.b[i] = 0
+ }
}
diff {
- indent((*obj.Fmt)(fp))
+ fp = indent(fp)
}
func indent(s string) string {
return s + "\n" + strings.Repeat(". ", dumpdepth)
}
slice dotoffset.oary
delete DEFAULTCAPACITY arraynew arrayfree arraylength arrayget arrayset ensurecapacity arrayadd arraysort
slice Liveness.uevar
slice Liveness.varkill
slice Liveness.livein
slice Liveness.liveout
slice Liveness.avarinit
slice Liveness.avarinitany
slice Liveness.avarinitall
slice inithash.autohash inithash.nautohash
slice indexdup.hash indexdup.nhash
slice keydup.hash keydup.nhash
slice fielddup.hash fielddup.nhash
slice typecheckcomplit.hash typecheckcomplit.nhash
diff {
-func vmkcall(fn *Node, t *Type, init **NodeList, va []interface{}) *Node {
+func vmkcall(fn *Node, t *Type, init **NodeList, va []*Node) *Node {
}
diff {
for i = 0; i < n; i++ {
- args = list(args, va_arg(va, *Node))
+ args = list(args, va[i])
}
func mkcall(name string, t *Type, init **NodeList, args ...*Node) *Node {
return vmkcall(syslook(name, 0), t, init, args)
}
func mkcall1(fn *Node, t *Type, init **NodeList, args ...*Node) *Node {
return vmkcall(fn, t, init, args)
}
diff {
- hash = hash[:inithash(n, (***Node)(&hash), autohash[:])]
+ hash = inithash(n, autohash[:])
}
diff {
- func inithash(n *Node, hash ***Node, autohash []*Node) uint32 {
+ func inithash(n *Node, autohash []*Node) []*Node {
}
diff {
- *hash = &autohash[0]
- for i = 0; i < len(autohash); i++ {
- (*hash)[i] = nil
- }
- return uint32(len(autohash))
+ for i := range autohash {
+ autohash[i] = nil
+ }
+ return autohash
}
diff {
// build and return a throw-away hash table
- *hash = make([]*Node, h)
-
- for i = 0; i < h; i++ {
- (*hash)[i] = nil
- }
- return h
+ return make([]*Node, h)
}
diff {
- s = string(&d)
- b = 0
- for i = sizeof(d); i > 0; i-- {
- b = b*PRIME1 + uint32(s[0])
- s = s[1:]
- }
+ x := math.Float64bits(d)
+ for i := 0; i < 8; i++ {
+ b = b*PRIME1 + uint32(x&0xFF)
+ x >>= 8
+ }
}
diff {
func onearg(n *Node, f string, args ...interface{}) int {
- var arg []interface{}
}
diff {
- obj.Va_start(arg, f)
- p = obj.Vsmprint(f, arg)
- obj.Va_end(arg)
+ p = fmt.Sprintf(f, args...)
}
diff {
- if descbuf < sizeof(descbuf) {
desc = descbuf
- } else {
- desc = "function argument"
- }
}
slice postorder.rpo2r
slice flowrpo.rpo2r
slice rpolca.idom
slice loophead.idom
slice flowrpo.idom
slice doms.idom
slice Graph.rpo
slice InitPlan.e
slice err nerr merr
rename err errors
slice ispkgin.pkgs ispkgin.n
slice mergetemp.var mergetemp.nvar
rename append walkappend
func stringtoarraylit(np **Node) {