[all-commits] [llvm/llvm-project] 99b5ec: [include-cleaner] Merge 2 parseIWYUPragma impls in...

Sam McCall via All-commits all-commits at lists.llvm.org
Mon Nov 28 04:21:43 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 99b5ec1fd1a70680a8483e5efb86807254e44e0e
      https://github.com/llvm/llvm-project/commit/99b5ec1fd1a70680a8483e5efb86807254e44e0e
  Author: Sam McCall <sam.mccall at gmail.com>
  Date:   2022-11-28 (Mon, 28 Nov 2022)

  Changed paths:
    M clang-tools-extra/clangd/Headers.cpp
    M clang-tools-extra/clangd/Headers.h
    M clang-tools-extra/clangd/unittests/HeadersTests.cpp
    M clang-tools-extra/include-cleaner/lib/Record.cpp
    M clang/include/clang/Tooling/Inclusions/HeaderAnalysis.h
    M clang/lib/Tooling/Inclusions/HeaderAnalysis.cpp
    M clang/unittests/Tooling/HeaderAnalysisTest.cpp

  Log Message:
  -----------
  [include-cleaner] Merge 2 parseIWYUPragma impls in libToolingInclusions

Based on include-cleaner's version, but:

- remove assert that can fail for input `/\<newline>* */`
- assert was also checking the wrong condition: that the prefix *differed* from
  either `//` or from `/*`. Avoid use of strncmp where we can.
- add a comment that the brittleness of the text matching is intentional

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




More information about the All-commits mailing list