[all-commits] [llvm/llvm-project] fd1d93: [clang-format] Mark pragma region lines as StringL...

Tobias Hieta via All-commits all-commits at lists.llvm.org
Tue Oct 25 00:59:53 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd1d93db71066bedc11944bd32f3540b8084b060
      https://github.com/llvm/llvm-project/commit/fd1d93db71066bedc11944bd32f3540b8084b060
  Author: Tobias Hieta <tobias at hieta.se>
  Date:   2022-10-25 (Tue, 25 Oct 2022)

  Changed paths:
    M clang/lib/Format/TokenAnnotator.cpp
    M clang/unittests/Format/FormatTest.cpp
    M clang/unittests/Format/TokenAnnotatorTest.cpp

  Log Message:
  -----------
  [clang-format] Mark pragma region lines as StringLiterals

In our code-base we auto-generate pragma regions the regions
look like method signatures like:

`#pragma region MYREGION(Foo: bar)`

The problem here was that the rest of the line after region
was not marked as stringliteral as in the case of pragma mark
so clang-format tried to change the formatting based on the
method signature.

Added test and mark it similar as pragma mark.

Reviewed By: owenpan

Differential Revision: https://reviews.llvm.org/D136336




More information about the All-commits mailing list