File tree Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Expand file tree Collapse file tree 1 file changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,13 @@ run by the parser after parsing input assembly and by the optimizer
61
61
before it outputs bitcode. The violations pointed out by the verifier
62
62
pass indicate bugs in transformation passes or input to the parser.
63
63
64
+ Syntax
65
+ ======
66
+
64
67
.. _identifiers:
65
68
66
69
Identifiers
67
- ===========
70
+ -----------
68
71
69
72
LLVM identifiers come in two basic types: global and local. Global
70
73
identifiers (functions, global variables) begin with the ``'@'``
@@ -140,6 +143,34 @@ It also shows a convention that we follow in this document. When
140
143
demonstrating instructions, we will follow an instruction with a comment
141
144
that defines the type and name of value produced.
142
145
146
+ .. _strings:
147
+
148
+ String constants
149
+ ----------------
150
+
151
+ Strings in LLVM programs are delimited by ``"`` characters. Within a
152
+ string, all bytes are treated literally with the exception of ``\``
153
+ characters, which start escapes, and the first ``"`` character, which
154
+ ends the string.
155
+
156
+ There are two kinds of escapes.
157
+
158
+ * ``\\`` represents a single ``\`` character.
159
+
160
+ * ``\`` followed by two hexadecimal characters (0-9, a-f, or A-F)
161
+ represents the byte with the given value (e.g. \x00 represents a
162
+ null byte).
163
+
164
+ To represent a ``"`` character, use ``\22``. (``\"`` will end the string
165
+ with a trailing ``\``.)
166
+
167
+ Newlines do not terminate string constants; strings can span multiple
168
+ lines.
169
+
170
+ The interpretation of string constants (e.g. their character encoding)
171
+ depends on context.
172
+
173
+
143
174
High Level Structure
144
175
====================
145
176
You can’t perform that action at this time.
0 commit comments