Documentation
¶
Overview ¶
Package enc implements encoding of identifiers for LLVM IR assembly.
Index ¶
- func AttrGroupID(id int64) string
- func Comdat(name string) string
- func Escape(s []byte, valid func(b byte) bool) string
- func EscapeIdent(s string) string
- func EscapeString(s []byte) string
- func Global(name string) string
- func Label(name string) string
- func Local(name string) string
- func MetadataID(id int64) string
- func MetadataName(name string) string
- func Quote(s []byte) 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 Comdat ¶
Comdat 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 Global ¶
Global encodes a global 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 Label ¶
Label encodes a label 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 Local ¶
Local encodes a local 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 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
Types ¶
This section is empty.