compiler, reflect: add map key and element type info

This commit is contained in:
Damian Gryski
2023-02-15 12:11:13 -08:00
committed by Ayke
parent cdf785629a
commit 60a93e8e2d
2 changed files with 13 additions and 0 deletions
+9
View File
@@ -33,6 +33,8 @@
// - map types (this is still missing the key and element types)
// meta uint8
// ptrTo *typeStruct
// elem *typeStruct
// key *typeStruct
// - struct types (see structType):
// meta uint8
// numField uint16
@@ -408,6 +410,13 @@ type arrayType struct {
arrayLen uintptr
}
type mapType struct {
rawType
ptrTo *rawType
elem *rawType
key *rawType
}
// Type for struct types. The numField value is intentionally put before ptrTo
// for better struct packing on 32-bit and 64-bit architectures. On these
// architectures, the ptrTo field still has the same offset as in all the other