[PATCH] D85666: [clang-tidy] IncludeInserter: allow <> in header name

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 10 10:23:53 PDT 2020


alexfh created this revision.
alexfh added reviewers: aaron.ballman, hokein.
Herald added subscribers: cfe-commits, arphaman, kbarton, xazax.hun, nemanjai.
Herald added a project: clang.
alexfh requested review of this revision.
Herald added a subscriber: wuzish.

This adds a pair of overloads for create(MainFile)?IncludeInsertion methods that
use the presence of the <> in the file name to control whether the #include
directive will use angle brackets or quotes. Motivating examples:
https://reviews.llvm.org/D82089#inline-789412 and
https://github.com/llvm/llvm-project/blob/master/clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp#L433

The overloads with the IsAngled parameter can be removed after the users are
updated.

Update usages of createIncludeInsertion.

Update (almost all) usages of createMainFileIncludeInsertion.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85666

Files:
  clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
  clang-tools-extra/clang-tidy/cppcoreguidelines/InitVariablesCheck.cpp
  clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
  clang-tools-extra/clang-tidy/modernize/MakeSmartPtrCheck.cpp
  clang-tools-extra/clang-tidy/modernize/PassByValueCheck.cpp
  clang-tools-extra/clang-tidy/modernize/ReplaceAutoPtrCheck.cpp
  clang-tools-extra/clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp
  clang-tools-extra/clang-tidy/performance/TypePromotionInMathFnCheck.cpp
  clang-tools-extra/clang-tidy/performance/UnnecessaryValueParamCheck.cpp
  clang-tools-extra/clang-tidy/utils/IncludeInserter.cpp
  clang-tools-extra/clang-tidy/utils/IncludeInserter.h
  clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-init-variables.cpp
  clang-tools-extra/unittests/clang-tidy/IncludeInserterTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85666.284428.patch
Type: text/x-patch
Size: 15263 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200810/528bb7f9/attachment.bin>


More information about the cfe-commits mailing list