[all-commits] [llvm/llvm-project] ffcd3f: [Remarks] Escape control characters in YAML remark...
Henrich Lauko via All-commits
all-commits at lists.llvm.org
Wed Sep 30 05:04:26 PDT 2026
Branch: refs/heads/users/xlauko/yaml-remark-block-control-chars
Home: https://github.com/llvm/llvm-project
Commit: ffcd3f19df5bc8e989c31bd7aa840dcb38edea6d
https://github.com/llvm/llvm-project/commit/ffcd3f19df5bc8e989c31bd7aa840dcb38edea6d
Author: Henrich Lauko <hlauko at nvidia.com>
Date: 2026-09-30 (Wed, 30 Sep 2026)
Changed paths:
M llvm/lib/Remarks/YAMLRemarkParser.cpp
M llvm/lib/Remarks/YAMLRemarkParser.h
M llvm/lib/Remarks/YAMLRemarkSerializer.cpp
M llvm/unittests/Remarks/YAMLRemarksParsingTest.cpp
M llvm/unittests/Remarks/YAMLRemarksSerializerTest.cpp
Log Message:
-----------
[Remarks] Escape control characters in YAML remark arguments and decode them when parsing
The serializer writes argument values with more than one newline as
literal block scalars. A block scalar has no escapes, so a value that
also contained a control character other than tab or newline was
written with the raw byte, which strict YAML readers reject. Such
values now use the double-quoted form, as do values whose first line
starts with a space, which a block scalar would read as indentation.
The parser took the raw scalar text and stripped only single quotes, so
double-quoted values came back with their quotes and escapes, and ''
inside single quotes was not unescaped. Decode scalars with
ScalarNode::getValue instead and report escape errors. Unescaped values
and block scalar values are copied into storage owned by the parser.
Block scalar values used to point into the YAML document, which next()
frees before returning the remark.
Assisted-by: Claude
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list