Update dependencies

This commit is contained in:
TwinProduction
2021-10-03 22:15:20 -04:00
parent 2d3fe9795f
commit 154bc7dbc6
1204 changed files with 373532 additions and 50576 deletions

4
vendor/modernc.org/cc/v3/Makefile generated vendored
View File

@ -95,8 +95,8 @@ edit:
editor: lexer.go
gofmt -l -s -w *.go
GO111MODULE=off go test -o /dev/null -c
GO111MODULE=off go install 2>&1 | tee log
go test -o /dev/null -c
go install 2>&1 | tee log
ast.go lexer.go stringer.go: lexer.l parser.yy enum.go
go generate

17
vendor/modernc.org/cc/v3/abi.go generated vendored
View File

@ -50,10 +50,9 @@ func NewABI(os, arch string) (ABI, error) {
return ABI{}, fmt.Errorf("unsupported os/arch pair: %s-%s", os, arch)
}
abi := ABI{
ByteOrder: order,
Types: make(map[Kind]ABIType, len(types)),
//TODO: depends on the OS?
SignedChar: true,
ByteOrder: order,
Types: make(map[Kind]ABIType, len(types)),
SignedChar: abiSignedChar[[2]string{os, arch}],
os: os,
arch: arch,
}
@ -276,10 +275,10 @@ func (a *ABI) layout(ctx *context, n Node, t *structType) *structType {
off := f.offset
m[off] = append(m[off], f)
}
for _, a := range m {
for _, s := range m {
var first *field
var w byte
for _, f := range a {
for _, f := range s {
if first == nil {
first = f
}
@ -291,11 +290,15 @@ func (a *ABI) layout(ctx *context, n Node, t *structType) *structType {
}
}
w = normalizeBitFieldWidth(w)
for _, f := range a {
for _, f := range s {
if f.isBitField {
f.blockStart = first
f.blockWidth = w
}
if a.ByteOrder == binary.BigEndian {
f.bitFieldOffset = w - f.bitFieldWidth - f.bitFieldOffset
f.bitFieldMask = (uint64(1)<<f.bitFieldWidth - 1) << f.bitFieldOffset
}
}
}
}()

View File

@ -3,13 +3,31 @@ package cc
import "encoding/binary"
// abiByteOrders contains byte order information for known architectures.
var abiByteOrders = map[string]binary.ByteOrder{
"amd64": binary.LittleEndian,
"386": binary.LittleEndian,
"arm": binary.LittleEndian,
"arm64": binary.LittleEndian,
"s390x": binary.BigEndian,
}
var (
abiByteOrders = map[string]binary.ByteOrder{
"amd64": binary.LittleEndian,
"386": binary.LittleEndian,
"arm": binary.LittleEndian,
"arm64": binary.LittleEndian,
"s390x": binary.BigEndian,
}
abiSignedChar = map[[2]string]bool{
{"linux", "arm"}: false,
{"linux", "arm64"}: false,
{"linux", "s390x"}: false,
{"darwin", "amd64"}: true,
{"darwin", "arm64"}: true,
{"freebsd", "amd64"}: true,
{"linux", "386"}: true,
{"linux", "amd64"}: true,
{"netbsd", "amd64"}: true,
{"openbsd", "amd64"}: true,
{"windows", "386"}: true,
{"windows", "amd64"}: true,
}
)
// abiTypes contains size and alignment information for known OS/arch pairs.
//
@ -332,4 +350,105 @@ var abiTypes = map[[2]string]map[Kind]ABIType{
Decimal64: {8, 8, 8},
Decimal128: {16, 8, 8},
},
// gcc (FreeBSD Ports Collection) 10.3.0
{"freebsd", "amd64"}: {
Void: {1, 1, 1},
Bool: {1, 1, 1},
Char: {1, 1, 1},
SChar: {1, 1, 1},
UChar: {1, 1, 1},
Short: {2, 2, 2},
UShort: {2, 2, 2},
Enum: {4, 4, 4},
Int: {4, 4, 4},
UInt: {4, 4, 4},
Long: {8, 8, 8},
ULong: {8, 8, 8},
LongLong: {8, 8, 8},
ULongLong: {8, 8, 8},
Ptr: {8, 8, 8},
Function: {8, 8, 8},
Float: {4, 4, 4},
Double: {8, 8, 8},
LongDouble: {16, 16, 16},
Int8: {1, 1, 1},
UInt8: {1, 1, 1},
Int16: {2, 2, 2},
UInt16: {2, 2, 2},
Int32: {4, 4, 4},
UInt32: {4, 4, 4},
Int64: {8, 8, 8},
UInt64: {8, 8, 8},
Int128: {16, 16, 16},
UInt128: {16, 16, 16},
},
// gcc (GCC) 8.4.0
{"openbsd", "amd64"}: {
Void: {1, 1, 1},
Bool: {1, 1, 1},
Char: {1, 1, 1},
SChar: {1, 1, 1},
UChar: {1, 1, 1},
Short: {2, 2, 2},
UShort: {2, 2, 2},
Enum: {4, 4, 4},
Int: {4, 4, 4},
UInt: {4, 4, 4},
Long: {8, 8, 8},
ULong: {8, 8, 8},
LongLong: {8, 8, 8},
ULongLong: {8, 8, 8},
Ptr: {8, 8, 8},
Function: {8, 8, 8},
Float: {4, 4, 4},
Double: {8, 8, 8},
LongDouble: {16, 16, 16},
Int8: {1, 1, 1},
UInt8: {1, 1, 1},
Int16: {2, 2, 2},
UInt16: {2, 2, 2},
Int32: {4, 4, 4},
UInt32: {4, 4, 4},
Int64: {8, 8, 8},
UInt64: {8, 8, 8},
Int128: {16, 16, 16},
UInt128: {16, 16, 16},
Float32: {4, 4, 4},
Float32x: {8, 8, 8},
Float64: {8, 8, 8},
Float64x: {16, 16, 16},
Float128: {16, 16, 16},
},
// gcc (GCC) 10.3.0
{"netbsd", "amd64"}: {
Void: {1, 1, 1},
Bool: {1, 1, 1},
Char: {1, 1, 1},
SChar: {1, 1, 1},
UChar: {1, 1, 1},
Short: {2, 2, 2},
UShort: {2, 2, 2},
Enum: {4, 4, 4},
Int: {4, 4, 4},
UInt: {4, 4, 4},
Long: {8, 8, 8},
ULong: {8, 8, 8},
LongLong: {8, 8, 8},
ULongLong: {8, 8, 8},
Ptr: {8, 8, 8},
Function: {8, 8, 8},
Float: {4, 4, 4},
Double: {8, 8, 8},
LongDouble: {16, 16, 16},
Int8: {1, 1, 1},
UInt8: {1, 1, 1},
Int16: {2, 2, 2},
UInt16: {2, 2, 2},
Int32: {4, 4, 4},
UInt32: {4, 4, 4},
Int64: {8, 8, 8},
UInt64: {8, 8, 8},
Int128: {16, 16, 16},
UInt128: {16, 16, 16},
},
}

21
vendor/modernc.org/cc/v3/ast2.go generated vendored
View File

@ -414,16 +414,16 @@ func Preprocess(cfg *Config, includePaths, sysIncludePaths []string, sources []S
func wTok(w io.Writer, tok Token) (err error) {
switch tok.Rune {
case STRINGLITERAL, LONGSTRINGLITERAL:
_, err = fmt.Fprintf(w, `%s"%s"`, tok.Sep, cQuotedString(tok.String()))
_, err = fmt.Fprintf(w, `%s"%s"`, tok.Sep, cQuotedString(tok.String(), true))
case CHARCONST, LONGCHARCONST:
_, err = fmt.Fprintf(w, `%s'%s'`, tok.Sep, cQuotedString(tok.String()))
_, err = fmt.Fprintf(w, `%s'%s'`, tok.Sep, cQuotedString(tok.String(), false))
default:
_, err = fmt.Fprintf(w, "%s%s", tok.Sep, tok)
}
return err
}
func cQuotedString(s string) []byte {
func cQuotedString(s string, isString bool) []byte {
var b []byte
for i := 0; i < len(s); i++ {
c := s[i]
@ -447,7 +447,20 @@ func cQuotedString(s string) []byte {
b = append(b, '\\', '\\')
continue
case '"':
b = append(b, '\\', '"')
switch {
case isString:
b = append(b, '\\', '"')
default:
b = append(b, '"')
}
continue
case '\'':
switch {
case isString:
b = append(b, '\'')
default:
b = append(b, '\\', '\'')
}
continue
}

12
vendor/modernc.org/cc/v3/cc.go generated vendored
View File

@ -154,8 +154,16 @@ func trc(s string, args ...interface{}) string { //TODO-
default:
s = fmt.Sprintf(s, args...)
}
_, fn, fl, _ := runtime.Caller(1)
r := fmt.Sprintf("%s:%d: TRC %s", fn, fl, s)
pc, fn, fl, _ := runtime.Caller(1)
f := runtime.FuncForPC(pc)
var fns string
if f != nil {
fns = f.Name()
if x := strings.LastIndex(fns, "."); x > 0 {
fns = fns[x+1:]
}
}
r := fmt.Sprintf("%s:%d:%s: TRC %s", fn, fl, fns, s)
fmt.Fprintf(os.Stdout, "%s\n", r)
os.Stdout.Sync()
return r

65
vendor/modernc.org/cc/v3/check.go generated vendored
View File

@ -283,6 +283,11 @@ func (n *InitializerList) setConstZero() {
// [0], 6.7.8 Initialization
func (n *Initializer) check(ctx *context, list *[]*Initializer, t Type, sc StorageClass, fld Field, off uintptr, il *InitializerList, designatorList *DesignatorList) *InitializerList {
// trc("Initializer.check: %v: t %v, off %v, designatorList != nil %v", n.Position(), t, off, designatorList != nil)
// if fld != nil {
// trc("\tfld %q", fld.Name())
// }
// 3 - The type of the entity to be initialized shall be an array of
// unknown size or an object type that is not a variable length array
// type.
@ -464,9 +469,13 @@ func (n *InitializerList) checkArray(ctx *context, list *[]*Initializer, t Type,
esz := elem.Size()
length := t.Len()
var i, maxI uintptr
nestedDesignator := designatorList != nil
retOnDesignator := false
loop:
for n != nil {
switch {
case retOnDesignator && n.Designation != nil:
return n
case designatorList == nil && n.Designation != nil:
designatorList = n.Designation.DesignatorList
fallthrough
@ -490,14 +499,12 @@ loop:
panic(todo(""))
}
designatorList = designatorList.DesignatorList
next := n.Initializer.check(ctx, list, elem, sc, nil, off+i*esz, n, designatorList)
if designatorList != nil {
panic(todo("", n.Position(), d.Position()))
n = n.Initializer.check(ctx, list, elem, sc, nil, off+i*esz, n, designatorList.DesignatorList)
designatorList = nil
if nestedDesignator {
retOnDesignator = true
}
i++
n = next
default:
if !t.IsIncomplete() && i >= length {
break loop
@ -506,9 +513,8 @@ loop:
if i > maxI {
maxI = i
}
next := n.Initializer.check(ctx, list, elem, sc, nil, off+i*esz, n, nil)
n = n.Initializer.check(ctx, list, elem, sc, nil, off+i*esz, n, nil)
i++
n = next
}
}
if t.IsIncomplete() {
@ -518,13 +524,19 @@ loop:
}
func (n *InitializerList) checkStruct(ctx *context, list *[]*Initializer, t Type, sc StorageClass, off uintptr, designatorList *DesignatorList) *InitializerList {
// trc("InitializerList.checkStruct: %v: t %v, off %v, dl %v", n.Position(), t, off, designatorList != nil)
t = t.underlyingType()
// trc("==== struct %v: %v, off %v", n.Position(), t, off) //TODO-
nf := t.NumField()
i := []int{0}
var f Field
nestedDesignator := designatorList != nil
retOnDesignator := false
for n != nil {
// trc("---- %v: t %v, dl %v", n.Position(), t, designatorList != nil)
switch {
case retOnDesignator && n.Designation != nil:
return n
case designatorList == nil && n.Designation != nil:
designatorList = n.Designation.DesignatorList
fallthrough
@ -544,22 +556,32 @@ func (n *InitializerList) checkStruct(ctx *context, list *[]*Initializer, t Type
f, xa, ok := t.FieldByName2(nm)
if !ok {
panic(todo("%v: %q", d.Position(), nm))
panic(todo("%v: t %v %q", d.Position(), t, nm))
}
t0 := t
switch {
case len(xa) != 1:
panic(todo("", d.Position()))
default:
designatorList = designatorList.DesignatorList
next := n.Initializer.check(ctx, list, f.Type(), sc, f, off+f.Offset(), n, designatorList)
if designatorList != nil && designatorList.DesignatorList != nil {
panic(todo("", d.Position()))
var f2 Field
var off2 uintptr
for len(xa) != 1 {
f2 = t.FieldByIndex(xa[:1])
off2 += f2.Offset()
t = f2.Type()
xa = xa[1:]
}
i[0] = xa[0] + 1
n = next
n = n.Initializer.check(ctx, list, t, sc, f, off+off2, n, designatorList)
if t.Kind() == Union {
t = t0
}
default:
n = n.Initializer.check(ctx, list, f.Type(), sc, f, off+f.Offset(), n, designatorList.DesignatorList)
}
designatorList = nil
if nestedDesignator {
retOnDesignator = true
}
i[0] = xa[0] + 1
default:
// [0], 6.7.8 Initialization
//
@ -575,9 +597,8 @@ func (n *InitializerList) checkStruct(ctx *context, list *[]*Initializer, t Type
f = t.FieldByIndex(i)
if f.Name() != 0 || !f.Type().IsBitFieldType() {
next := n.Initializer.check(ctx, list, f.Type(), sc, f, off+f.Offset(), n, nil)
n = n.Initializer.check(ctx, list, f.Type(), sc, f, off+f.Offset(), n, nil)
i[0]++
n = next
break
}
}
@ -1437,13 +1458,13 @@ func (n *PostfixExpression) addrOf(ctx *context) Operand {
case PostfixExpressionCall: // PostfixExpression '(' ArgumentExpressionList ')'
panic(n.Position().String())
case PostfixExpressionSelect: // PostfixExpression '.' IDENTIFIER
op := n.PostfixExpression.check(ctx, false)
op := n.PostfixExpression.addrOf(ctx)
n.IsSideEffectsFree = n.PostfixExpression.IsSideEffectsFree
if d := n.PostfixExpression.Declarator(); d != nil {
setAddressTaken(n, d, "PostfixExpression '.' IDENTIFIER")
d.Read += ctx.readDelta
}
st := op.Type()
st := op.Type().Elem()
if k := st.Kind(); k == Invalid || k != Struct && k != Union {
//TODO report error
break

54
vendor/modernc.org/cc/v3/cpp.go generated vendored
View File

@ -653,14 +653,21 @@ start:
}
arg := ap[0][0].value.String()
arg = arg[1 : len(arg)-1] // `"<x>"` -> `<x>`, `""y""` -> `"y"`
switch {
case strings.HasPrefix(arg, `"\"`): // `"\"stdio.h\""`
arg = arg[2:len(arg)-3] + `"` // -> `"stdio.h"`
case strings.HasPrefix(arg, `"<`): // `"<stdio.h>"`
arg = arg[1 : len(arg)-1] // -> `<stdio.h>`
default:
arg = ""
}
var tok3 token3
tok3.char = PPNUMBER
switch _, err := c.hasInclude(&tok, arg); {
case err != nil:
tok3.value = idZero
default:
tok3.value = idOne
tok3.value = idZero
if arg != "" {
if _, err := c.hasInclude(&tok, arg); err == nil {
tok3.value = idOne
}
}
tok := cppToken{token4{token3: tok3, file: c.file}, nil}
ts.ungets([]cppToken{tok})
@ -702,7 +709,11 @@ start:
goto start
}
func (c *cpp) hasInclude(n Node, nm string) (string, error) {
func (c *cpp) hasInclude(n Node, nm string) (rs string, err error) {
// nm0 := nm
// defer func() { //TODO-
// trc("nm0 %q nm %q rs %q err %v", nm0, nm, rs, err)
// }()
var (
b byte
paths []string
@ -2171,6 +2182,8 @@ func decodeEscapeSequence(ctx *context, tok cppToken, s string) (rune, int) {
return 7, 2
case 'b':
return 8, 2
case 'e':
return 0x1b, 2
case 'f':
return 12, 2
case 'n':
@ -2433,21 +2446,7 @@ func (n *ppIncludeDirective) translationPhase4(c *cpp) {
v = dir
}
var p string
switch {
case strings.HasPrefix(nm, "./"):
wd := c.ctx.cfg.WorkingDir
if wd == "" {
var err error
if wd, err = os.Getwd(); err != nil {
c.err(toks[0], "cannot determine working dir: %v", err)
return
}
}
p = filepath.Join(wd, nm)
default:
p = filepath.Join(v, nm)
}
p := filepath.Join(v, nm)
fi, err := c.ctx.statFile(p, sys)
if err != nil || fi.IsDir() {
continue
@ -2732,8 +2731,9 @@ func (n *ppTextLine) getToks() []token3 { return n.toks }
func (n *ppTextLine) translationPhase4(c *cpp) { c.send(n.toks) }
type ppLineDirective struct {
toks []token3
args []token3
toks []token3
args []token3
nextPos int
}
func (n *ppLineDirective) getToks() []token3 { return n.toks }
@ -2756,7 +2756,7 @@ func (n *ppLineDirective) translationPhase4(c *cpp) {
toks = toks[1:]
}
if len(toks) == 1 {
c.file.AddLineInfo(int(n.toks[len(n.toks)-1].pos), c.file.Name(), int(ln))
c.file.AddLineInfo(int(n.nextPos)-1, c.file.Name(), int(ln))
return
}
@ -2765,7 +2765,7 @@ func (n *ppLineDirective) translationPhase4(c *cpp) {
toks = toks[1:]
}
if len(toks) == 0 {
c.file.AddLineInfo(int(n.toks[len(n.toks)-1].pos), c.file.Name(), int(ln))
c.file.AddLineInfo(int(n.nextPos)-1, c.file.Name(), int(ln))
return
}
@ -2773,7 +2773,7 @@ func (n *ppLineDirective) translationPhase4(c *cpp) {
case STRINGLITERAL:
s := t.String()
s = s[1 : len(s)-1]
c.file.AddLineInfo(int(n.toks[len(n.toks)-1].pos), s, int(ln))
c.file.AddLineInfo(int(n.nextPos)-1, s, int(ln))
c.fileMacro.repl[0].value = t.value
for len(toks) != 0 && toks[0].char == ' ' {
toks = toks[1:]

8
vendor/modernc.org/cc/v3/lexer.go generated vendored
View File

@ -360,7 +360,7 @@ yystate20:
switch {
default:
goto yyabort
case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v':
case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'e' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v':
goto yystate18
case c == 'U':
goto yystate21
@ -662,7 +662,7 @@ yystate53:
switch {
default:
goto yyabort
case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v':
case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'e' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v':
goto yystate51
case c == 'U':
goto yystate54
@ -1137,7 +1137,7 @@ yystate105:
switch {
default:
goto yyabort
case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v':
case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'e' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v':
goto yystate103
case c == 'U':
goto yystate106
@ -1254,7 +1254,7 @@ yystate117:
switch {
default:
goto yyabort
case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v':
case c == '"' || c == '\'' || c >= '0' && c <= '7' || c == '?' || c == '\\' || c == 'a' || c == 'b' || c == 'e' || c == 'f' || c == 'n' || c == 'r' || c == 't' || c == 'v':
goto yystate115
case c == 'U':
goto yystate118

2
vendor/modernc.org/cc/v3/lexer.l generated vendored
View File

@ -34,7 +34,7 @@ pp-number ({digit}|\.{digit})({digit}|{identifier-nondigit}|[eEpP]{sign}|\.)*
s-char [^\x22\n\x80\\]|{escape-sequence}
s-char-sequence {s-char}+
sign [-+]
simple-sequence \\['\x22?\\abfnrtv]
simple-sequence \\['\x22?\\abefnrtv]
string-literal \x22{s-char-sequence}?\x22
universal-character-name \\u{hex-quad}|\\U{hex-quad}{hex-quad}
white-space [ \t\f\v]

View File

@ -275,7 +275,7 @@ func (v Float32Value) ge(b Value) Value { return boolValue(v >= b.(Float32Value
func (v Float32Value) gt(b Value) Value { return boolValue(v > b.(Float32Value)) }
func (v Float32Value) IsConst() bool { return true }
func (v Float32Value) IsNonZero() bool { return v != 0 }
func (v Float32Value) IsZero() bool { return v == 0 }
func (v Float32Value) IsZero() bool { return !math.Signbit(float64(v)) && v == 0 }
func (v Float32Value) le(b Value) Value { return boolValue(v <= b.(Float32Value)) }
func (v Float32Value) lsh(b Value) Value { panic(todo("")) }
func (v Float32Value) lt(b Value) Value { return boolValue(v < b.(Float32Value)) }
@ -299,7 +299,7 @@ func (v Float64Value) ge(b Value) Value { return boolValue(v >= b.(Float64Value
func (v Float64Value) gt(b Value) Value { return boolValue(v > b.(Float64Value)) }
func (v Float64Value) IsConst() bool { return true }
func (v Float64Value) IsNonZero() bool { return v != 0 }
func (v Float64Value) IsZero() bool { return v == 0 }
func (v Float64Value) IsZero() bool { return !math.Signbit(float64(v)) && v == 0 }
func (v Float64Value) le(b Value) Value { return boolValue(v <= b.(Float64Value)) }
func (v Float64Value) lsh(b Value) Value { panic(todo("")) }
func (v Float64Value) lt(b Value) Value { return boolValue(v < b.(Float64Value)) }
@ -328,7 +328,7 @@ func (v *Float128Value) ge(b Value) Value { panic(todo("")) }
func (v *Float128Value) gt(b Value) Value { return boolValue(v.cmp(b, -1, 0)) }
func (v *Float128Value) IsNonZero() bool { panic(todo("")) }
func (v *Float128Value) IsConst() bool { return true }
func (v *Float128Value) IsZero() bool { return v.cmp(float128Zero, 0) }
func (v *Float128Value) IsZero() bool { return !v.NaN && !v.N.Signbit() && v.cmp(float128Zero, 0) }
func (v *Float128Value) le(b Value) Value { panic(todo("")) }
func (v *Float128Value) lsh(b Value) Value { panic(todo("")) }
func (v *Float128Value) lt(b Value) Value { panic(todo("")) }

View File

@ -744,7 +744,8 @@ func (s *scanner) parseLine(toks []token3) *ppLineDirective {
return &ppLineDirective{toks: toks}
default:
toks := s.scanLineToEOL(toks)
r := &ppLineDirective{toks: toks}
last := toks[len(toks)-1]
r := &ppLineDirective{toks: toks, nextPos: int(last.pos) + len(last.src.String())}
toks = toks[:len(toks)-1] // sans new-line
toks = ltrim3(toks)
toks = toks[1:] // Skip '#'
@ -1177,10 +1178,6 @@ func (c *ppCache) getFile(ctx *context, name string, sys bool, doNotCache bool)
size := int(fi.Size())
if !filepath.IsAbs(name) { // Never cache relative paths
if isTesting {
panic(internalError())
}
f, err := ctx.openFile(name, sys)
if err != nil {
return nil, err

6
vendor/modernc.org/cc/v3/type.go generated vendored
View File

@ -3097,7 +3097,7 @@ func (t *vectorType) underlyingType() Type { return t }
func isCharType(t Type) bool {
switch t.Kind() {
case Char, SChar, UChar:
case Char, SChar, UChar, Int8, UInt8:
return true
}
@ -3164,10 +3164,6 @@ func NewStructLayout(t Type) *StructLayout {
//trc("%q off %d pos %d %v %v %v", f.Name(), off, pos, ft, ft.Kind(), ft.IsIncomplete())
switch {
case ft.IsBitFieldType():
if f.BitFieldOffset() != 0 {
break
}
if p := int(off - pos); p != 0 {
if pads == nil {
pads = map[Field]int{}