[all-commits] [llvm/llvm-project] 629ca6: [Remarks] Fix YAML remark round-trip for values th...

Henrich Lauko via All-commits all-commits at lists.llvm.org
Wed Sep 30 04:03:24 PDT 2026


  Branch: refs/heads/users/xlauko/yaml-remark-block-control-chars
  Home:   https://github.com/llvm/llvm-project
  Commit: 629ca6556fa12dbeb69ada35d6a33ce6cff710df
      https://github.com/llvm/llvm-project/commit/629ca6556fa12dbeb69ada35d6a33ce6cff710df
  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] Fix YAML remark round-trip for values that need escaping

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.

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