MCPcopy Create free account
hub / github.com/llir/llvm / LLString

Method LLString

ir/types/types.go:835–861  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

833//
834// '<' '{' Fields=(Type separator ',')+? '}' '>' -> PackedStructType
835func (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.
864func (t *StructType) Name() string {

Callers 1

StringMethod · 0.95

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected