Skip to content

Commit a5998da

Browse files
committed
Replace '0' with 'z' for all-zero value
1 parent b19ed2c commit a5998da

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

llvm/docs/LangRef.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3145,7 +3145,7 @@ as follows:
31453145
denotes the default address space 0. The value of ``n`` must be
31463146
in the range [1,2^24). The fifth parameter ``<sentinel>`` specifies the
31473147
sentinel value of the pointer for the corresponding address space. It
3148-
currently accepts two values: ``0`` for an all-zero value and ``f`` for a
3148+
currently accepts two values: ``z`` for an all-zero value and ``f`` for a
31493149
full-bit set value. The default sentinel pointer value is all-zero.
31503150
``i<size>:<abi>[:<pref>]``
31513151
This specifies the alignment for an integer type of a given bit

llvm/lib/IR/DataLayout.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,16 +302,16 @@ static Error parseSentinelValue(StringRef Str, APInt &V) {
302302
if (Str.empty())
303303
return createStringError("sentinel value component cannot be empty");
304304
if (Str.size() != 1)
305-
return createStringError("sentinel value component must be a '0' or 'f'");
306-
if (Str[0] == '0') {
305+
return createStringError("sentinel value component must be a 'z' or 'f'");
306+
if (Str[0] == 'z') {
307307
V.clearAllBits();
308308
return Error::success();
309309
}
310310
if (Str[0] == 'f') {
311311
V.setAllBits();
312312
return Error::success();
313313
}
314-
return createStringError("sentinel value component must be a '0' or 'f'");
314+
return createStringError("sentinel value component must be a 'z' or 'f'");
315315
}
316316

317317
/// Attempts to parse an alignment component of a specification.

llvm/unittests/IR/DataLayoutTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ TEST(DataLayout, ParsePointerSpec) {
408408
{"p:32:32:32:32:a", "p0:32:32:32:32:ab", "p42:32:32:32:32:123"})
409409
EXPECT_THAT_EXPECTED(
410410
DataLayout::parse(Str),
411-
FailedWithMessage("sentinel value component must be a '0' or 'f'"));
411+
FailedWithMessage("sentinel value component must be a 'z' or 'f'"));
412412

413413
for (StringRef Str :
414414
{"p:32:32:32:32:", "p0:32:32:32:32:", "p42:32:32:32:32:"})

0 commit comments

Comments
 (0)