[PATCH] D96542: [clang-tidy] Fix `TransformerClangTidyCheck`'s handling of include insertions.

Yitzhak Mandelbaum via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 12 08:24:45 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG33f35a4b793b: [clang-tidy] Fix `TransformerClangTidyCheck`'s handling of include insertions. (authored by ymandel).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96542/new/

https://reviews.llvm.org/D96542

Files:
  clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp


Index: clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
+++ clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp
@@ -104,7 +104,8 @@
       Diag << FixItHint::CreateReplacement(T.Range, T.Replacement);
       break;
     case transformer::EditKind::AddInclude:
-      Diag << Inserter.createMainFileIncludeInsertion(T.Replacement);
+      Diag << Inserter.createIncludeInsertion(
+          Result.SourceManager->getFileID(T.Range.getBegin()), T.Replacement);
       break;
     }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96542.323341.patch
Type: text/x-patch
Size: 649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210212/55bcc288/attachment.bin>


More information about the cfe-commits mailing list