LLString returns the LLVM syntax representation of the definition of the type. Opaque struct type. 'opaque' Struct type. '{' Fields=(Type separator ',')+? '}' Packed struct type. '<' '{' Fields=(Type separator ',')+? '}' '>' -> PackedStructType
()
| 833 | // |
| 834 | // '<' '{' Fields=(Type separator ',')+? '}' '>' -> PackedStructType |
| 835 | func (t *StructType) LLString() string { |
| 836 | if t.Opaque { |
| 837 | return "opaque" |
| 838 | } |
| 839 | if len(t.Fields) == 0 { |
| 840 | if t.Packed { |
| 841 | return "<{}>" |
| 842 | } |
| 843 | return "{}" |
| 844 | } |
| 845 | buf := &strings.Builder{} |
| 846 | if t.Packed { |
| 847 | buf.WriteString("<") |
| 848 | } |
| 849 | buf.WriteString("{ ") |
| 850 | for i, field := range t.Fields { |
| 851 | if i != 0 { |
| 852 | buf.WriteString(", ") |
| 853 | } |
| 854 | buf.WriteString(field.String()) |
| 855 | } |
| 856 | buf.WriteString(" }") |
| 857 | if t.Packed { |
| 858 | buf.WriteString(">") |
| 859 | } |
| 860 | return buf.String() |
| 861 | } |
| 862 | |
| 863 | // Name returns the type name of the type. |
| 864 | func (t *StructType) Name() string { |