Documentation
¶
Overview ¶
Package enc implements encoding of identifiers for LLVM IR assembly.
Index ¶
- func AttrGroupID(id int64) string
- func ComdatName(name string) string
- func Escape(s []byte, valid func(b byte) bool) string
- func EscapeIdent(s string) string
- func EscapeString(s []byte) string
- func GlobalID(id int64) string
- func GlobalName(name string) string
- func LabelID(id int64) string
- func LabelName(name string) string
- func LocalID(id int64) string
- func LocalName(name string) string
- func MetadataID(id int64) string
- func MetadataName(name string) string
- func Quote(s []byte) string
- func TypeName(name string) string
- func Unescape(s string) []byte
- func Unquote(s string) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttrGroupID ¶
AttrGroupID encodes a attribute group ID to its LLVM IR assembly representation.
Examples:
"42" -> "#42"
References:
http://www.llvm.org/docs/LangRef.html#identifiers
func ComdatName ¶
ComdatName encodes a comdat name to its LLVM IR assembly representation.
Examples:
"foo" -> $%foo" "a b" -> `$"a b"` "世" -> `$"\E4\B8\96"`
References:
http://www.llvm.org/docs/LangRef.html#identifiers
func Escape ¶
Escape replaces any characters in s categorized as invalid by the valid function with corresponding hexadecimal escape sequence (\XX).
func EscapeIdent ¶
EscapeIdent replaces any characters which are not valid in identifiers with corresponding hexadecimal escape sequence (\XX).
func EscapeString ¶
EscapeString replaces any characters in s categorized as invalid in string literals with corresponding hexadecimal escape sequence (\XX).
func GlobalID ¶
GlobalID encodes a global ID to its LLVM IR assembly representation.
Examples:
"42" -> "@42"
References:
http://www.llvm.org/docs/LangRef.html#identifiers
func GlobalName ¶
GlobalName encodes a global name to its LLVM IR assembly representation.
Examples:
"foo" -> "@foo" "a b" -> `@"a b"` "世" -> `@"\E4\B8\96"` "2" -> `@"2"`
References:
http://www.llvm.org/docs/LangRef.html#identifiers
func LabelID ¶
LabelID encodes a label ID to its LLVM IR assembly representation.
Examples:
"42" -> 42:
References:
http://www.llvm.org/docs/LangRef.html#identifiers
func LabelName ¶
LabelName encodes a label name to its LLVM IR assembly representation.
Examples:
"foo" -> "foo:" "a b" -> `"a b":` "世" -> `"\E4\B8\96":` "2" -> `"2":`
References:
http://www.llvm.org/docs/LangRef.html#identifiers
func LocalID ¶
LocalID encodes a local ID to its LLVM IR assembly representation.
Examples:
"42" -> "%42"
References:
http://www.llvm.org/docs/LangRef.html#identifiers
func LocalName ¶
LocalName encodes a local name to its LLVM IR assembly representation.
Examples:
"foo" -> "%foo" "a b" -> `%"a b"` "世" -> `%"\E4\B8\96"` "2" -> `%"2"`
References:
http://www.llvm.org/docs/LangRef.html#identifiers
func MetadataID ¶
MetadataID encodes a metadata ID to its LLVM IR assembly representation.
Examples:
"42" -> "!42"
References:
http://www.llvm.org/docs/LangRef.html#identifiers
func MetadataName ¶
MetadataName encodes a metadata name to its LLVM IR assembly representation.
Examples:
"foo" -> "!foo" "a b" -> `!a\20b` "世" -> `!\E4\B8\96`
References:
http://www.llvm.org/docs/LangRef.html#identifiers
func TypeName ¶
TypeName encodes a type name to its LLVM IR assembly representation.
Examples:
"foo" -> "%foo" "a b" -> `%"a b"` "世" -> `%"\E4\B8\96"` "2" -> `%2`
References:
http://www.llvm.org/docs/LangRef.html#identifiers
Types ¶
This section is empty.