[all-commits] [llvm/llvm-project] 3f3a23: [clang-apply-replacements] Added an option to igno...

Liu Ke via All-commits all-commits at lists.llvm.org
Sun May 29 22:05:34 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3f3a235aa2e610b5ba393228a666d55a8135ef4a
      https://github.com/llvm/llvm-project/commit/3f3a235aa2e610b5ba393228a666d55a8135ef4a
  Author: Sockke <liuke.gehry at bytedance.com>
  Date:   2022-05-30 (Mon, 30 May 2022)

  Changed paths:
    M clang-tools-extra/clang-apply-replacements/include/clang-apply-replacements/Tooling/ApplyReplacements.h
    M clang-tools-extra/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
    M clang-tools-extra/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
    M clang-tools-extra/clang-tidy/tool/run-clang-tidy.py
    A clang-tools-extra/test/clang-apply-replacements/Inputs/ignore-conflict/file1.yaml
    A clang-tools-extra/test/clang-apply-replacements/Inputs/ignore-conflict/ignore-conflict.cpp
    A clang-tools-extra/test/clang-apply-replacements/ignore-conflict.cpp
    M clang/include/clang/Tooling/Refactoring/AtomicChange.h

  Log Message:
  -----------
  [clang-apply-replacements] Added an option to ignore insert conflict.

If two different texts are inserted at the same offset, clang-apply-replacements prints the conflict error and discards all fixes. This patch adds support for adjusting conflict offset and keeps running to continually fix them.

https://godbolt.org/z/P938EGoxj doesn't have any fixes when I run run-clang-tidy.py to generate a YAML file with clang-tidy and fix them with clang-apply-replacements. The YAML file has two different header texts insertions at the same offset, unlike clang-tidy with '-fix', clang-apply-replacements does not adjust for this conflict.

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list