[PATCH] D121733: Clean pathnames in FileManager.

2022-03-23 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

> Ignoring the ".." path components for the moment, is this patch good to go as 
> is? It doesn't affect that behavior.

This patch still breaks Winx64 
`clang-tidy/checkers/google-upgrade-googletest-case.cpp`.

The failure log here 

 doesn't show //why// that test is failing, but I reproduced the failure on my 
home Windows 10 machine, and I am still digging into the failure reason.

One thing I noticed is this diff from running `clang-tidy`:

  < Suppressed 15 warnings (8 in non-user code, 7 with check filters).
  > Suppressed 38 warnings (31 in non-user code, 7 with check filters).

It appears that additional files are treated as "non-user code" after the patch.

However I don't think that's the root cause of the failure: when I added 
`--header-filter='.*'` I got:

  > Suppressed 7 warnings (7 with check filters).

but the test still failed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121658: Use llvm::sys::path::append to fix FIXME

2022-03-14 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov created this revision.
Herald added a project: All.
ppluzhnikov requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121658

Files:
  clang/lib/Lex/HeaderSearch.cpp


Index: clang/lib/Lex/HeaderSearch.cpp
===
--- clang/lib/Lex/HeaderSearch.cpp
+++ clang/lib/Lex/HeaderSearch.cpp
@@ -883,10 +883,8 @@
   const FileEntry *Includer = IncluderAndDir.first;
 
   // Concatenate the requested file onto the directory.
-  // FIXME: Portability.  Filename concatenation should be in sys::Path.
   TmpDir = IncluderAndDir.second->getName();
-  TmpDir.push_back('/');
-  TmpDir.append(Filename.begin(), Filename.end());
+  llvm::sys::path::append(TmpDir, Filename);
 
   // FIXME: We don't cache the result of getFileInfo across the call to
   // getFileAndSuggestModule, because it's a reference to an element of


Index: clang/lib/Lex/HeaderSearch.cpp
===
--- clang/lib/Lex/HeaderSearch.cpp
+++ clang/lib/Lex/HeaderSearch.cpp
@@ -883,10 +883,8 @@
   const FileEntry *Includer = IncluderAndDir.first;
 
   // Concatenate the requested file onto the directory.
-  // FIXME: Portability.  Filename concatenation should be in sys::Path.
   TmpDir = IncluderAndDir.second->getName();
-  TmpDir.push_back('/');
-  TmpDir.append(Filename.begin(), Filename.end());
+  llvm::sys::path::append(TmpDir, Filename);
 
   // FIXME: We don't cache the result of getFileInfo across the call to
   // getFileAndSuggestModule, because it's a reference to an element of
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121658: Use llvm::sys::path::append to fix FIXME

2022-03-14 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov abandoned this revision.
ppluzhnikov added a comment.

Breaks Windows tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121658

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121733: Clean pathnames in FileManager.

2022-03-15 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov created this revision.
Herald added subscribers: dexonsmith, arphaman.
Herald added a project: All.
ppluzhnikov requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This reduces visual noise ("./foo.h" -> "foo.h") in error messages.

Fix all tests which fail as a result.

This also fixes a class of failures when __FILE__ is used in modules, and
the module specifies 'textual header "foo.h"' but Clang has "./foo.h"
included elsewhere.

Finally this should fix Windows failure from https://reviews.llvm.org/D121658


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121733

Files:
  clang/bindings/python/tests/cindex/test_translation_unit.py
  clang/lib/Basic/FileManager.cpp
  clang/test/Frontend/dependency-gen.c
  clang/test/Index/skip-parsed-bodies/compile_commands.json
  clang/test/Modules/filename.cpp
  clang/unittests/Lex/HeaderSearchTest.cpp
  clang/unittests/Tooling/Syntax/TokensTest.cpp
  clang/unittests/Tooling/TransformerTest.cpp

Index: clang/unittests/Tooling/TransformerTest.cpp
===
--- clang/unittests/Tooling/TransformerTest.cpp
+++ clang/unittests/Tooling/TransformerTest.cpp
@@ -1593,21 +1593,22 @@
   return L.getFilePath() < R.getFilePath();
 });
 
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
-  EXPECT_THAT(Changes[0].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
+  const auto &change_h = Changes[1];
+  ASSERT_EQ(change_h.getFilePath(), "input.h");
+  EXPECT_THAT(change_h.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_h.getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
-  clang::tooling::applyAllReplacements(Header,
-   Changes[0].getReplacements());
+  clang::tooling::applyAllReplacements(Header, change_h.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), "");
 
-  ASSERT_EQ(Changes[1].getFilePath(), "input.cc");
-  EXPECT_THAT(Changes[1].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[1].getRemovedHeaders(), IsEmpty());
-  UpdatedCode = clang::tooling::applyAllReplacements(
-  Source, Changes[1].getReplacements());
+  const auto &change_cc = Changes[0];
+  ASSERT_EQ(change_cc.getFilePath(), "input.cc");
+  EXPECT_THAT(change_cc.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_cc.getRemovedHeaders(), IsEmpty());
+  UpdatedCode =
+  clang::tooling::applyAllReplacements(Source, change_cc.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), format("#include \"input.h\"\n"));
@@ -1630,7 +1631,7 @@
   {{"input.h", Header}}));
 
   ASSERT_EQ(Changes.size(), 1U);
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
+  ASSERT_EQ(Changes[0].getFilePath(), "input.h");
   EXPECT_THAT(Changes[0].getInsertedHeaders(), ElementsAre("header.h"));
   EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
@@ -1679,7 +1680,7 @@
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
"input.cc"),
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
-   "./input.h";
+   "input.h";
 }
 
 } // namespace
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -292,7 +292,7 @@
   {"int main() {}",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -301,7 +301,7 @@
   {"\t\n  int\t\n  main\t\n  (\t\n  )\t\n{\t\n  }\t\n",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -313,7 +313,7 @@
   )cpp",
R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 # pragma GCC visibility push ( public ) # pragma GCC visibility pop
   mappings:
@@ -322,7 +322,7 @@
   // Empty files should not crash.
   {R"cpp()cpp", R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 
   no mappings.
@@ -336,7 +336,7 @@
 )cpp",
   R"(expanded tokens:
   a
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 a # define MACRO ( ) A # B
   mappings:
@@ -401,7 +401,7 @@
   std::string Expected =
   "expanded tokens:\n"
   "  int a ;\n"
-  "file './input.cpp'\n"
+  "file 'input.cpp'\n"
   "  spelled tokens:\n"
   "# define FOO a # include \"unresolved_file.h\" # undef FOO "
   

[PATCH] D121733: Clean pathnames in FileManager.

2022-03-17 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 416255.
ppluzhnikov added a comment.
Herald added a project: clang-tools-extra.

Fix Win x64 failures.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

Files:
  clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
  clang/bindings/python/tests/cindex/test_translation_unit.py
  clang/lib/Basic/FileManager.cpp
  clang/test/Frontend/dependency-gen.c
  clang/test/Index/skip-parsed-bodies/compile_commands.json
  clang/test/Modules/filename.cpp
  clang/unittests/Lex/HeaderSearchTest.cpp
  clang/unittests/Tooling/Syntax/TokensTest.cpp
  clang/unittests/Tooling/TransformerTest.cpp

Index: clang/unittests/Tooling/TransformerTest.cpp
===
--- clang/unittests/Tooling/TransformerTest.cpp
+++ clang/unittests/Tooling/TransformerTest.cpp
@@ -1593,21 +1593,22 @@
   return L.getFilePath() < R.getFilePath();
 });
 
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
-  EXPECT_THAT(Changes[0].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
+  const auto &change_h = Changes[1];
+  ASSERT_EQ(change_h.getFilePath(), "input.h");
+  EXPECT_THAT(change_h.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_h.getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
-  clang::tooling::applyAllReplacements(Header,
-   Changes[0].getReplacements());
+  clang::tooling::applyAllReplacements(Header, change_h.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), "");
 
-  ASSERT_EQ(Changes[1].getFilePath(), "input.cc");
-  EXPECT_THAT(Changes[1].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[1].getRemovedHeaders(), IsEmpty());
-  UpdatedCode = clang::tooling::applyAllReplacements(
-  Source, Changes[1].getReplacements());
+  const auto &change_cc = Changes[0];
+  ASSERT_EQ(change_cc.getFilePath(), "input.cc");
+  EXPECT_THAT(change_cc.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_cc.getRemovedHeaders(), IsEmpty());
+  UpdatedCode =
+  clang::tooling::applyAllReplacements(Source, change_cc.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), format("#include \"input.h\"\n"));
@@ -1630,7 +1631,7 @@
   {{"input.h", Header}}));
 
   ASSERT_EQ(Changes.size(), 1U);
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
+  ASSERT_EQ(Changes[0].getFilePath(), "input.h");
   EXPECT_THAT(Changes[0].getInsertedHeaders(), ElementsAre("header.h"));
   EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
@@ -1679,7 +1680,7 @@
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
"input.cc"),
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
-   "./input.h";
+   "input.h";
 }
 
 } // namespace
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -292,7 +292,7 @@
   {"int main() {}",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -301,7 +301,7 @@
   {"\t\n  int\t\n  main\t\n  (\t\n  )\t\n{\t\n  }\t\n",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -313,7 +313,7 @@
   )cpp",
R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 # pragma GCC visibility push ( public ) # pragma GCC visibility pop
   mappings:
@@ -322,7 +322,7 @@
   // Empty files should not crash.
   {R"cpp()cpp", R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 
   no mappings.
@@ -336,7 +336,7 @@
 )cpp",
   R"(expanded tokens:
   a
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 a # define MACRO ( ) A # B
   mappings:
@@ -401,7 +401,7 @@
   std::string Expected =
   "expanded tokens:\n"
   "  int a ;\n"
-  "file './input.cpp'\n"
+  "file 'input.cpp'\n"
   "  spelled tokens:\n"
   "# define FOO a # include \"unresolved_file.h\" # undef FOO "
   "# ifdef X # else # endif # ifndef Y # endif # if 1 # elif 2 # else "
@@ -420,7 +420,7 @@
   )cpp",
R"(expanded tokens:
   int const a ;
-

[PATCH] D121733: Clean pathnames in FileManager.

2022-03-17 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 416330.
ppluzhnikov added a comment.

Use single quotes in sed -- don't want shell expansion there.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

Files:
  clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
  clang/bindings/python/tests/cindex/test_translation_unit.py
  clang/lib/Basic/FileManager.cpp
  clang/test/Frontend/dependency-gen.c
  clang/test/Index/skip-parsed-bodies/compile_commands.json
  clang/test/Modules/filename.cpp
  clang/unittests/Lex/HeaderSearchTest.cpp
  clang/unittests/Tooling/Syntax/TokensTest.cpp
  clang/unittests/Tooling/TransformerTest.cpp

Index: clang/unittests/Tooling/TransformerTest.cpp
===
--- clang/unittests/Tooling/TransformerTest.cpp
+++ clang/unittests/Tooling/TransformerTest.cpp
@@ -1593,21 +1593,22 @@
   return L.getFilePath() < R.getFilePath();
 });
 
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
-  EXPECT_THAT(Changes[0].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
+  const auto &change_h = Changes[1];
+  ASSERT_EQ(change_h.getFilePath(), "input.h");
+  EXPECT_THAT(change_h.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_h.getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
-  clang::tooling::applyAllReplacements(Header,
-   Changes[0].getReplacements());
+  clang::tooling::applyAllReplacements(Header, change_h.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), "");
 
-  ASSERT_EQ(Changes[1].getFilePath(), "input.cc");
-  EXPECT_THAT(Changes[1].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[1].getRemovedHeaders(), IsEmpty());
-  UpdatedCode = clang::tooling::applyAllReplacements(
-  Source, Changes[1].getReplacements());
+  const auto &change_cc = Changes[0];
+  ASSERT_EQ(change_cc.getFilePath(), "input.cc");
+  EXPECT_THAT(change_cc.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_cc.getRemovedHeaders(), IsEmpty());
+  UpdatedCode =
+  clang::tooling::applyAllReplacements(Source, change_cc.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), format("#include \"input.h\"\n"));
@@ -1630,7 +1631,7 @@
   {{"input.h", Header}}));
 
   ASSERT_EQ(Changes.size(), 1U);
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
+  ASSERT_EQ(Changes[0].getFilePath(), "input.h");
   EXPECT_THAT(Changes[0].getInsertedHeaders(), ElementsAre("header.h"));
   EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
@@ -1679,7 +1680,7 @@
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
"input.cc"),
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
-   "./input.h";
+   "input.h";
 }
 
 } // namespace
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -292,7 +292,7 @@
   {"int main() {}",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -301,7 +301,7 @@
   {"\t\n  int\t\n  main\t\n  (\t\n  )\t\n{\t\n  }\t\n",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -313,7 +313,7 @@
   )cpp",
R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 # pragma GCC visibility push ( public ) # pragma GCC visibility pop
   mappings:
@@ -322,7 +322,7 @@
   // Empty files should not crash.
   {R"cpp()cpp", R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 
   no mappings.
@@ -336,7 +336,7 @@
 )cpp",
   R"(expanded tokens:
   a
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 a # define MACRO ( ) A # B
   mappings:
@@ -401,7 +401,7 @@
   std::string Expected =
   "expanded tokens:\n"
   "  int a ;\n"
-  "file './input.cpp'\n"
+  "file 'input.cpp'\n"
   "  spelled tokens:\n"
   "# define FOO a # include \"unresolved_file.h\" # undef FOO "
   "# ifdef X # else # endif # ifndef Y # endif # if 1 # elif 2 # else "
@@ -420,7 +420,7 @@
   )cpp",
R"(expanded tokens:
   int const a ;
-fil

[PATCH] D121733: Clean pathnames in FileManager.

2022-03-18 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

> @ppluzhnikov, can you give more context on how this interacts with 
> https://reviews.llvm.org/D121658? I had a quick look but it wasn't 
> immediately obvious.

D121658  broke Winx64 test due to "./" vs. 
".\\" mismatch. This change removes "./", so hopefully after this goes in 
D121658  will no longer break anything.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121733: Clean pathnames in FileManager.

2022-03-18 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

> There's also some others where I wouldn't expect them to be failing in this 
> patch, eg. the ones from `/` -> `{{[/\\]}}`.

These are failing because `remove_dots` (un-intuitively) also changes 
"foo/bar\\baz" to "foo\\bar\\baz"

> Are there tests that we can't just fix to expect either `/` or `\\`?

That's what this change is doing (but there is more Winx64 cleanup pending; 
sorry, I should have sent this as a draft, but I am still learning the ropes 
here).

> Why do we need to change the underlying behaviour here at all?

Sorry, I didn't understand that comment.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121733: Clean pathnames in FileManager.

2022-03-18 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov planned changes to this revision.
ppluzhnikov added a comment.

Pending further Win x64 failure cleanup.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121733: Clean pathnames in FileManager.

2022-03-18 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 416633.
ppluzhnikov added a comment.

More Debian and Win x64 fixes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

Files:
  clang-tools-extra/test/clang-apply-replacements/conflict.cpp
  clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
  clang/bindings/python/tests/cindex/test_translation_unit.py
  clang/lib/Basic/FileManager.cpp
  clang/test/ClangScanDeps/header-search-pruning-transitive.c
  clang/test/Frontend/dependency-gen.c
  clang/test/Index/skip-parsed-bodies/compile_commands.json
  clang/test/Modules/filename.cpp
  clang/unittests/Lex/HeaderSearchTest.cpp
  clang/unittests/Tooling/Syntax/TokensTest.cpp
  clang/unittests/Tooling/TransformerTest.cpp

Index: clang/unittests/Tooling/TransformerTest.cpp
===
--- clang/unittests/Tooling/TransformerTest.cpp
+++ clang/unittests/Tooling/TransformerTest.cpp
@@ -1593,21 +1593,22 @@
   return L.getFilePath() < R.getFilePath();
 });
 
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
-  EXPECT_THAT(Changes[0].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
+  const auto &change_h = Changes[1];
+  ASSERT_EQ(change_h.getFilePath(), "input.h");
+  EXPECT_THAT(change_h.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_h.getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
-  clang::tooling::applyAllReplacements(Header,
-   Changes[0].getReplacements());
+  clang::tooling::applyAllReplacements(Header, change_h.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), "");
 
-  ASSERT_EQ(Changes[1].getFilePath(), "input.cc");
-  EXPECT_THAT(Changes[1].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[1].getRemovedHeaders(), IsEmpty());
-  UpdatedCode = clang::tooling::applyAllReplacements(
-  Source, Changes[1].getReplacements());
+  const auto &change_cc = Changes[0];
+  ASSERT_EQ(change_cc.getFilePath(), "input.cc");
+  EXPECT_THAT(change_cc.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_cc.getRemovedHeaders(), IsEmpty());
+  UpdatedCode =
+  clang::tooling::applyAllReplacements(Source, change_cc.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), format("#include \"input.h\"\n"));
@@ -1630,7 +1631,7 @@
   {{"input.h", Header}}));
 
   ASSERT_EQ(Changes.size(), 1U);
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
+  ASSERT_EQ(Changes[0].getFilePath(), "input.h");
   EXPECT_THAT(Changes[0].getInsertedHeaders(), ElementsAre("header.h"));
   EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
@@ -1679,7 +1680,7 @@
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
"input.cc"),
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
-   "./input.h";
+   "input.h";
 }
 
 } // namespace
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -292,7 +292,7 @@
   {"int main() {}",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -301,7 +301,7 @@
   {"\t\n  int\t\n  main\t\n  (\t\n  )\t\n{\t\n  }\t\n",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -313,7 +313,7 @@
   )cpp",
R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 # pragma GCC visibility push ( public ) # pragma GCC visibility pop
   mappings:
@@ -322,7 +322,7 @@
   // Empty files should not crash.
   {R"cpp()cpp", R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 
   no mappings.
@@ -336,7 +336,7 @@
 )cpp",
   R"(expanded tokens:
   a
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 a # define MACRO ( ) A # B
   mappings:
@@ -401,7 +401,7 @@
   std::string Expected =
   "expanded tokens:\n"
   "  int a ;\n"
-  "file './input.cpp'\n"
+  "file 'input.cpp'\n"
   "  spelled tokens:\n"
   "# define FOO a # include \"unresolved_file.h\" # undef FOO "
   "# ifdef X # else # endif # ifndef Y # endif # if 1 # e

[PATCH] D121733: Clean pathnames in FileManager.

2022-05-05 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 427460.
ppluzhnikov added a comment.
Herald added a subscriber: carlosgalvezp.

Fix Winx64 `clang-tidy/checkers/google-upgrade-googletest-case.cpp` failure.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

Files:
  clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
  clang-tools-extra/test/clang-apply-replacements/conflict.cpp
  clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
  clang/bindings/python/tests/cindex/test_translation_unit.py
  clang/lib/Basic/FileManager.cpp
  clang/test/ClangScanDeps/header-search-pruning-transitive.c
  clang/test/Frontend/dependency-gen.c
  clang/test/Index/skip-parsed-bodies/compile_commands.json
  clang/test/Modules/cxx20-hu-04.cpp
  clang/test/Modules/cxx20-hu-05.cpp
  clang/test/Modules/cxx20-hu-06.cpp
  clang/test/Modules/filename.cpp
  clang/unittests/Lex/HeaderSearchTest.cpp
  clang/unittests/Tooling/Syntax/TokensTest.cpp
  clang/unittests/Tooling/TransformerTest.cpp

Index: clang/unittests/Tooling/TransformerTest.cpp
===
--- clang/unittests/Tooling/TransformerTest.cpp
+++ clang/unittests/Tooling/TransformerTest.cpp
@@ -1622,21 +1622,22 @@
   return L.getFilePath() < R.getFilePath();
 });
 
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
-  EXPECT_THAT(Changes[0].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
+  const auto &change_h = Changes[1];
+  ASSERT_EQ(change_h.getFilePath(), "input.h");
+  EXPECT_THAT(change_h.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_h.getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
-  clang::tooling::applyAllReplacements(Header,
-   Changes[0].getReplacements());
+  clang::tooling::applyAllReplacements(Header, change_h.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), "");
 
-  ASSERT_EQ(Changes[1].getFilePath(), "input.cc");
-  EXPECT_THAT(Changes[1].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[1].getRemovedHeaders(), IsEmpty());
-  UpdatedCode = clang::tooling::applyAllReplacements(
-  Source, Changes[1].getReplacements());
+  const auto &change_cc = Changes[0];
+  ASSERT_EQ(change_cc.getFilePath(), "input.cc");
+  EXPECT_THAT(change_cc.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_cc.getRemovedHeaders(), IsEmpty());
+  UpdatedCode =
+  clang::tooling::applyAllReplacements(Source, change_cc.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), format("#include \"input.h\"\n"));
@@ -1659,7 +1660,7 @@
   {{"input.h", Header}}));
 
   ASSERT_EQ(Changes.size(), 1U);
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
+  ASSERT_EQ(Changes[0].getFilePath(), "input.h");
   EXPECT_THAT(Changes[0].getInsertedHeaders(), ElementsAre("header.h"));
   EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
@@ -1708,7 +1709,7 @@
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
"input.cc"),
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
-   "./input.h";
+   "input.h";
 }
 
 TEST_F(TransformerTest, GeneratesMetadata) {
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -292,7 +292,7 @@
   {"int main() {}",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -301,7 +301,7 @@
   {"\t\n  int\t\n  main\t\n  (\t\n  )\t\n{\t\n  }\t\n",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -313,7 +313,7 @@
   )cpp",
R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 # pragma GCC visibility push ( public ) # pragma GCC visibility pop
   mappings:
@@ -322,7 +322,7 @@
   // Empty files should not crash.
   {R"cpp()cpp", R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 
   no mappings.
@@ -336,7 +336,7 @@
 )cpp",
   R"(expanded tokens:
   a
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 a # define MACRO ( ) A # B
   mappings:
@@ -401,7 +401,7 @@

[PATCH] D121733: Clean pathnames in FileManager.

2022-05-05 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 427526.
ppluzhnikov added a comment.

Fix more UNIX and Winx64 failures.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

Files:
  clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
  clang-tools-extra/test/clang-apply-replacements/conflict.cpp
  clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp
  clang-tools-extra/test/modularize/ProblemsMissingHeader.modularize
  clang/bindings/python/tests/cindex/test_translation_unit.py
  clang/lib/Basic/FileManager.cpp
  clang/test/ClangScanDeps/header-search-pruning-transitive.c
  clang/test/Frontend/dependency-gen.c
  clang/test/Index/skip-parsed-bodies/compile_commands.json
  clang/test/Modules/cxx20-hu-04.cpp
  clang/test/Modules/cxx20-hu-05.cpp
  clang/test/Modules/cxx20-hu-06.cpp
  clang/test/Modules/filename.cpp
  clang/unittests/Lex/HeaderSearchTest.cpp
  clang/unittests/Tooling/Syntax/TokensTest.cpp
  clang/unittests/Tooling/TransformerTest.cpp

Index: clang/unittests/Tooling/TransformerTest.cpp
===
--- clang/unittests/Tooling/TransformerTest.cpp
+++ clang/unittests/Tooling/TransformerTest.cpp
@@ -1622,21 +1622,22 @@
   return L.getFilePath() < R.getFilePath();
 });
 
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
-  EXPECT_THAT(Changes[0].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
+  const auto &change_h = Changes[1];
+  ASSERT_EQ(change_h.getFilePath(), "input.h");
+  EXPECT_THAT(change_h.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_h.getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
-  clang::tooling::applyAllReplacements(Header,
-   Changes[0].getReplacements());
+  clang::tooling::applyAllReplacements(Header, change_h.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), "");
 
-  ASSERT_EQ(Changes[1].getFilePath(), "input.cc");
-  EXPECT_THAT(Changes[1].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[1].getRemovedHeaders(), IsEmpty());
-  UpdatedCode = clang::tooling::applyAllReplacements(
-  Source, Changes[1].getReplacements());
+  const auto &change_cc = Changes[0];
+  ASSERT_EQ(change_cc.getFilePath(), "input.cc");
+  EXPECT_THAT(change_cc.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_cc.getRemovedHeaders(), IsEmpty());
+  UpdatedCode =
+  clang::tooling::applyAllReplacements(Source, change_cc.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), format("#include \"input.h\"\n"));
@@ -1659,7 +1660,7 @@
   {{"input.h", Header}}));
 
   ASSERT_EQ(Changes.size(), 1U);
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
+  ASSERT_EQ(Changes[0].getFilePath(), "input.h");
   EXPECT_THAT(Changes[0].getInsertedHeaders(), ElementsAre("header.h"));
   EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
@@ -1708,7 +1709,7 @@
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
"input.cc"),
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
-   "./input.h";
+   "input.h";
 }
 
 TEST_F(TransformerTest, GeneratesMetadata) {
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -292,7 +292,7 @@
   {"int main() {}",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -301,7 +301,7 @@
   {"\t\n  int\t\n  main\t\n  (\t\n  )\t\n{\t\n  }\t\n",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -313,7 +313,7 @@
   )cpp",
R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 # pragma GCC visibility push ( public ) # pragma GCC visibility pop
   mappings:
@@ -322,7 +322,7 @@
   // Empty files should not crash.
   {R"cpp()cpp", R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 
   no mappings.
@@ -336,7 +336,7 @@
 )cpp",
   R"(expanded tokens:
   a
-file './input.cpp'
+file 'input.cpp'
  

[PATCH] D121733: Clean pathnames in FileManager.

2022-05-09 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 428275.
ppluzhnikov added a comment.

Fix one more Winx64 failure.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

Files:
  clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
  clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp
  clang-tools-extra/test/clang-apply-replacements/conflict.cpp
  clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp
  clang-tools-extra/test/modularize/ProblemsMissingHeader.modularize
  clang/bindings/python/tests/cindex/test_translation_unit.py
  clang/lib/Basic/FileManager.cpp
  clang/test/ClangScanDeps/header-search-pruning-transitive.c
  clang/test/Frontend/dependency-gen.c
  clang/test/Index/skip-parsed-bodies/compile_commands.json
  clang/test/Modules/cxx20-hu-04.cpp
  clang/test/Modules/cxx20-hu-05.cpp
  clang/test/Modules/cxx20-hu-06.cpp
  clang/test/Modules/filename.cpp
  clang/unittests/Lex/HeaderSearchTest.cpp
  clang/unittests/Tooling/Syntax/TokensTest.cpp
  clang/unittests/Tooling/TransformerTest.cpp

Index: clang/unittests/Tooling/TransformerTest.cpp
===
--- clang/unittests/Tooling/TransformerTest.cpp
+++ clang/unittests/Tooling/TransformerTest.cpp
@@ -1622,21 +1622,22 @@
   return L.getFilePath() < R.getFilePath();
 });
 
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
-  EXPECT_THAT(Changes[0].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
+  const auto &change_h = Changes[1];
+  ASSERT_EQ(change_h.getFilePath(), "input.h");
+  EXPECT_THAT(change_h.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_h.getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
-  clang::tooling::applyAllReplacements(Header,
-   Changes[0].getReplacements());
+  clang::tooling::applyAllReplacements(Header, change_h.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), "");
 
-  ASSERT_EQ(Changes[1].getFilePath(), "input.cc");
-  EXPECT_THAT(Changes[1].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[1].getRemovedHeaders(), IsEmpty());
-  UpdatedCode = clang::tooling::applyAllReplacements(
-  Source, Changes[1].getReplacements());
+  const auto &change_cc = Changes[0];
+  ASSERT_EQ(change_cc.getFilePath(), "input.cc");
+  EXPECT_THAT(change_cc.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_cc.getRemovedHeaders(), IsEmpty());
+  UpdatedCode =
+  clang::tooling::applyAllReplacements(Source, change_cc.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), format("#include \"input.h\"\n"));
@@ -1659,7 +1660,7 @@
   {{"input.h", Header}}));
 
   ASSERT_EQ(Changes.size(), 1U);
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
+  ASSERT_EQ(Changes[0].getFilePath(), "input.h");
   EXPECT_THAT(Changes[0].getInsertedHeaders(), ElementsAre("header.h"));
   EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
@@ -1708,7 +1709,7 @@
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
"input.cc"),
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
-   "./input.h";
+   "input.h";
 }
 
 TEST_F(TransformerTest, GeneratesMetadata) {
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -295,7 +295,7 @@
   {"int main() {}",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -304,7 +304,7 @@
   {"\t\n  int\t\n  main\t\n  (\t\n  )\t\n{\t\n  }\t\n",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -316,7 +316,7 @@
   )cpp",
R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 # pragma GCC visibility push ( public ) # pragma GCC visibility pop
   mappings:
@@ -325,7 +325,7 @@
   // Empty files should not crash.
   {R"cpp()cpp", R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 
   no mappings.
@@ -339,7 +339,7 @@
 )cpp",
   

[PATCH] D121733: Clean pathnames in FileManager.

2022-05-09 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 428293.
ppluzhnikov added a comment.
Herald added subscribers: usaxena95, kadircet.

Fix FIXME in CanonicalIncludesTests.cpp (yet another Winx64 failure).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

Files:
  clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
  clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp
  clang-tools-extra/clangd/unittests/CanonicalIncludesTests.cpp
  clang-tools-extra/test/clang-apply-replacements/conflict.cpp
  clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp
  clang-tools-extra/test/modularize/ProblemsMissingHeader.modularize
  clang/bindings/python/tests/cindex/test_translation_unit.py
  clang/lib/Basic/FileManager.cpp
  clang/test/ClangScanDeps/header-search-pruning-transitive.c
  clang/test/Frontend/dependency-gen.c
  clang/test/Index/skip-parsed-bodies/compile_commands.json
  clang/test/Modules/cxx20-hu-04.cpp
  clang/test/Modules/cxx20-hu-05.cpp
  clang/test/Modules/cxx20-hu-06.cpp
  clang/test/Modules/filename.cpp
  clang/unittests/Lex/HeaderSearchTest.cpp
  clang/unittests/Tooling/Syntax/TokensTest.cpp
  clang/unittests/Tooling/TransformerTest.cpp

Index: clang/unittests/Tooling/TransformerTest.cpp
===
--- clang/unittests/Tooling/TransformerTest.cpp
+++ clang/unittests/Tooling/TransformerTest.cpp
@@ -1622,21 +1622,22 @@
   return L.getFilePath() < R.getFilePath();
 });
 
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
-  EXPECT_THAT(Changes[0].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
+  const auto &change_h = Changes[1];
+  ASSERT_EQ(change_h.getFilePath(), "input.h");
+  EXPECT_THAT(change_h.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_h.getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
-  clang::tooling::applyAllReplacements(Header,
-   Changes[0].getReplacements());
+  clang::tooling::applyAllReplacements(Header, change_h.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), "");
 
-  ASSERT_EQ(Changes[1].getFilePath(), "input.cc");
-  EXPECT_THAT(Changes[1].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[1].getRemovedHeaders(), IsEmpty());
-  UpdatedCode = clang::tooling::applyAllReplacements(
-  Source, Changes[1].getReplacements());
+  const auto &change_cc = Changes[0];
+  ASSERT_EQ(change_cc.getFilePath(), "input.cc");
+  EXPECT_THAT(change_cc.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_cc.getRemovedHeaders(), IsEmpty());
+  UpdatedCode =
+  clang::tooling::applyAllReplacements(Source, change_cc.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), format("#include \"input.h\"\n"));
@@ -1659,7 +1660,7 @@
   {{"input.h", Header}}));
 
   ASSERT_EQ(Changes.size(), 1U);
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
+  ASSERT_EQ(Changes[0].getFilePath(), "input.h");
   EXPECT_THAT(Changes[0].getInsertedHeaders(), ElementsAre("header.h"));
   EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
@@ -1708,7 +1709,7 @@
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
"input.cc"),
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
-   "./input.h";
+   "input.h";
 }
 
 TEST_F(TransformerTest, GeneratesMetadata) {
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -295,7 +295,7 @@
   {"int main() {}",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -304,7 +304,7 @@
   {"\t\n  int\t\n  main\t\n  (\t\n  )\t\n{\t\n  }\t\n",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -316,7 +316,7 @@
   )cpp",
R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 # pragma GCC visibility push ( public ) # pragma GCC visibility pop
   mappings:
@@ -325,7 +325,7 @@
   // Empty files should not crash.
   

[PATCH] D121733: Clean pathnames in FileManager.

2022-05-11 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 428693.
ppluzhnikov added a comment.

Fix clangd test failure.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

Files:
  clang-tools-extra/clang-tidy/google/UpgradeGoogletestCaseCheck.cpp
  clang-tools-extra/clang-tidy/llvmlibc/RestrictSystemLibcHeadersCheck.cpp
  clang-tools-extra/clangd/index/CanonicalIncludes.cpp
  clang-tools-extra/clangd/unittests/CanonicalIncludesTests.cpp
  clang-tools-extra/test/clang-apply-replacements/conflict.cpp
  clang-tools-extra/test/clang-apply-replacements/order-dependent.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-internal-dependencies.cpp
  clang-tools-extra/test/clang-tidy/checkers/abseil-no-namespace.cpp
  
clang-tools-extra/test/clang-tidy/checkers/readability-identifier-naming-multiple-styles.cpp
  clang-tools-extra/test/modularize/ProblemsMissingHeader.modularize
  clang/bindings/python/tests/cindex/test_translation_unit.py
  clang/lib/Basic/FileManager.cpp
  clang/test/ClangScanDeps/header-search-pruning-transitive.c
  clang/test/Frontend/dependency-gen.c
  clang/test/Index/skip-parsed-bodies/compile_commands.json
  clang/test/Modules/cxx20-hu-04.cpp
  clang/test/Modules/cxx20-hu-05.cpp
  clang/test/Modules/cxx20-hu-06.cpp
  clang/test/Modules/filename.cpp
  clang/unittests/Lex/HeaderSearchTest.cpp
  clang/unittests/Tooling/Syntax/TokensTest.cpp
  clang/unittests/Tooling/TransformerTest.cpp

Index: clang/unittests/Tooling/TransformerTest.cpp
===
--- clang/unittests/Tooling/TransformerTest.cpp
+++ clang/unittests/Tooling/TransformerTest.cpp
@@ -1622,21 +1622,22 @@
   return L.getFilePath() < R.getFilePath();
 });
 
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
-  EXPECT_THAT(Changes[0].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
+  const auto &change_h = Changes[1];
+  ASSERT_EQ(change_h.getFilePath(), "input.h");
+  EXPECT_THAT(change_h.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_h.getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
-  clang::tooling::applyAllReplacements(Header,
-   Changes[0].getReplacements());
+  clang::tooling::applyAllReplacements(Header, change_h.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), "");
 
-  ASSERT_EQ(Changes[1].getFilePath(), "input.cc");
-  EXPECT_THAT(Changes[1].getInsertedHeaders(), IsEmpty());
-  EXPECT_THAT(Changes[1].getRemovedHeaders(), IsEmpty());
-  UpdatedCode = clang::tooling::applyAllReplacements(
-  Source, Changes[1].getReplacements());
+  const auto &change_cc = Changes[0];
+  ASSERT_EQ(change_cc.getFilePath(), "input.cc");
+  EXPECT_THAT(change_cc.getInsertedHeaders(), IsEmpty());
+  EXPECT_THAT(change_cc.getRemovedHeaders(), IsEmpty());
+  UpdatedCode =
+  clang::tooling::applyAllReplacements(Source, change_cc.getReplacements());
   ASSERT_TRUE(static_cast(UpdatedCode))
   << "Could not update code: " << llvm::toString(UpdatedCode.takeError());
   EXPECT_EQ(format(*UpdatedCode), format("#include \"input.h\"\n"));
@@ -1659,7 +1660,7 @@
   {{"input.h", Header}}));
 
   ASSERT_EQ(Changes.size(), 1U);
-  ASSERT_EQ(Changes[0].getFilePath(), "./input.h");
+  ASSERT_EQ(Changes[0].getFilePath(), "input.h");
   EXPECT_THAT(Changes[0].getInsertedHeaders(), ElementsAre("header.h"));
   EXPECT_THAT(Changes[0].getRemovedHeaders(), IsEmpty());
   llvm::Expected UpdatedCode =
@@ -1708,7 +1709,7 @@
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
"input.cc"),
   ResultOf([](const AtomicChange &C) { return C.getFilePath(); },
-   "./input.h";
+   "input.h";
 }
 
 TEST_F(TransformerTest, GeneratesMetadata) {
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -295,7 +295,7 @@
   {"int main() {}",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -304,7 +304,7 @@
   {"\t\n  int\t\n  main\t\n  (\t\n  )\t\n{\t\n  }\t\n",
R"(expanded tokens:
   int main ( ) { }
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 int main ( ) { }
   no mappings.
@@ -316,7 +316,7 @@
   )cpp",
R"(expanded tokens:
   
-file './input.cpp'
+file 'input.cpp'
   spelled tokens:
 # pragma GCC visibility push ( public ) # pragma GCC visibility pop
   mappings:
@@ -325,7 +325,7 @@
   // Empty files should not crash.
   {R"cpp()cpp", R"(expanded tokens:
   

[PATCH] D121733: Clean pathnames in FileManager.

2022-05-11 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov planned changes to this revision.
ppluzhnikov added inline comments.



Comment at: clang-tools-extra/clangd/index/CanonicalIncludes.cpp:24
+  static auto *Mappings =
+  new std::array, 645>{{
+  {"algorithm", ""},

ilya-biryukov wrote:
> Don't specify sizes of arrays explicitly. This is error prone.
std::array requires size.

I could use std::vector instead, at the cost of an extra allocation.



Comment at: clang-tools-extra/clangd/index/CanonicalIncludes.cpp:546
+  {"include/wordexp.h", ""},
+  {"include/x86intrin.h", ""},
+  {"include/xlocale.h", ""},

ilya-biryukov wrote:
> Why do we change the order of elements here?
> Please revert, this increases the diff and is not relevant to the actual 
> change.
Note that the elements are inserted into a map
(after commit b3a991df3cd6a; used to be a vector before).

Also note that there are duplicates, e.g.

{"bits/typesizes.h", ""},
{"bits/typesizes.h", ""},

which can't work as intended / is already broken.

Sorting helps to find these duplicates.




Comment at: clang-tools-extra/clangd/index/CanonicalIncludes.cpp:670
+  }};
+  auto *HeaderMapping = new llvm::StringMap(Mappings->size());
+

ilya-biryukov wrote:
> This line introduces a memory leak.
> Notice how the previous version had a `static` variable.
No, it does not. This function is called only once to initialize a static 
variable: 

static const auto *SystemHeaderMap = GetHeaderMapping();
 



Comment at: clang-tools-extra/clangd/index/CanonicalIncludes.cpp:677
+  };
+  for (auto &p : *Mappings) {
+Canonicalize(p.first);

ilya-biryukov wrote:
> This function is on a critical path. We don't want to pay for `Canonicalize` 
> on every call to it.
> Please create a static variable and initialize in a lambda if that's 
> absolutely necessary.
> ```
> static auto *Mapping = []{ StringMap *Mapping = new ...; /* init code*/ 
> return Mapping; }();
> ```
This function is only called once.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121733: Clean pathnames in FileManager.

2022-05-11 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added inline comments.



Comment at: clang/lib/Basic/FileManager.cpp:218
+  llvm::sys::path::remove_dots(CleanFilename, /*remove_dot_dot=*/false);
+  Filename = CleanFilename;
+

kadircet wrote:
> this is actually breaking the [contract of 
> FileEntryRef](https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/FileEntry.h#L58-L59),
>  is this the point?
> 
> ```
> /// A reference to a \c FileEntry that includes the name of the file as it was
> /// accessed by the FileManager's client.
> ```
> 
> I don't see mention of this contract being changed explicitly anywhere, if so 
> can you mention it in the commit message and also update the documentation? 
> (the same applies to DirectoryEntryRef changes as well)
> 
> I am not able to take a detailed look at this at the moment, but this doesn't 
> feel like a safe change for all clients. Because people might be relying on 
> this contract without explicitly testing the behaviour for "./" in the 
> filenames. So tests passing (especially when you're just updating them to not 
> have `./`) might not be implying it's safe.
I chased this comment down to commit 4dc5573acc0d2e7c59d8bac2543eb25cb4b32984.

The commit message says:

   This commit introduces a parallel API to FileManager's getFile: 
getFileEntryRef, which returns
a reference to the FileEntry, and the name that was used to access the 
file. In the case of
a VFS with 'use-external-names', the FileEntyRef contains the external name 
of the file,
not the filename that was used to access it.

So it appears that the comment itself is not quite correct.

It's also a bit ambiguous (I think) -- "name used to access the file"
could be interpreted as the name which clang itself used to access
the file, and not necessarily the name client used.

> people might be relying on this contract without explicitly testing the 
> behaviour for "./" in the filenames.

That's a possibility.

I am not sure how to evaluate the benefit of this patch (avoiding noise 
everywhere) vs. possibly breaking clients.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D125742: Minor refactor of CanonicalIncludes::addSystemHeadersMapping.

2022-05-16 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov created this revision.
ppluzhnikov added a reviewer: ilya-biryukov.
Herald added subscribers: usaxena95, kadircet, arphaman.
Herald added a project: All.
ppluzhnikov requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Before commit b3a991df3cd6a SystemHeaderMap used to be a vector.

Commit b3a991df3cd6a changed it into a map, but neglected to remove
duplicate keys (e.g. "bits/typesizes.h", "include/stdint.h", etc.).

To prevent confusion, remove all duplicates, build HeaderMapping
one pair at a time and assert() that no duplicates are found.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125742

Files:
  clang-tools-extra/clangd/index/CanonicalIncludes.cpp

Index: clang-tools-extra/clangd/index/CanonicalIncludes.cpp
===
--- clang-tools-extra/clangd/index/CanonicalIncludes.cpp
+++ clang-tools-extra/clangd/index/CanonicalIncludes.cpp
@@ -18,6 +18,655 @@
 namespace clangd {
 namespace {
 const char IWYUPragma[] = "// IWYU pragma: private, include ";
+
+const std::pair IncludeMappings[] = {
+{"include/__stddef_max_align_t.h", ""},
+{"include/__wmmintrin_aes.h", ""},
+{"include/__wmmintrin_pclmul.h", ""},
+{"include/adxintrin.h", ""},
+{"include/ammintrin.h", ""},
+{"include/avx2intrin.h", ""},
+{"include/avx512bwintrin.h", ""},
+{"include/avx512cdintrin.h", ""},
+{"include/avx512dqintrin.h", ""},
+{"include/avx512erintrin.h", ""},
+{"include/avx512fintrin.h", ""},
+{"include/avx512ifmaintrin.h", ""},
+{"include/avx512ifmavlintrin.h", ""},
+{"include/avx512pfintrin.h", ""},
+{"include/avx512vbmiintrin.h", ""},
+{"include/avx512vbmivlintrin.h", ""},
+{"include/avx512vlbwintrin.h", ""},
+{"include/avx512vlcdintrin.h", ""},
+{"include/avx512vldqintrin.h", ""},
+{"include/avx512vlintrin.h", ""},
+{"include/avxintrin.h", ""},
+{"include/bmi2intrin.h", ""},
+{"include/bmiintrin.h", ""},
+{"include/emmintrin.h", ""},
+{"include/f16cintrin.h", ""},
+{"include/float.h", ""},
+{"include/fma4intrin.h", ""},
+{"include/fmaintrin.h", ""},
+{"include/fxsrintrin.h", ""},
+{"include/ia32intrin.h", ""},
+{"include/immintrin.h", ""},
+{"include/inttypes.h", ""},
+{"include/limits.h", ""},
+{"include/lzcntintrin.h", ""},
+{"include/mm3dnow.h", ""},
+{"include/mm_malloc.h", ""},
+{"include/mmintrin.h", ""},
+{"include/mwaitxintrin.h", ""},
+{"include/pkuintrin.h", ""},
+{"include/pmmintrin.h", ""},
+{"include/popcntintrin.h", ""},
+{"include/prfchwintrin.h", ""},
+{"include/rdseedintrin.h", ""},
+{"include/rtmintrin.h", ""},
+{"include/shaintrin.h", ""},
+{"include/smmintrin.h", ""},
+{"include/stdalign.h", ""},
+{"include/stdarg.h", ""},
+{"include/stdbool.h", ""},
+{"include/stddef.h", ""},
+{"include/stdint.h", ""},
+{"include/tbmintrin.h", ""},
+{"include/tmmintrin.h", ""},
+{"include/wmmintrin.h", ""},
+{"include/x86intrin.h", ""},
+{"include/xmmintrin.h", ""},
+{"include/xopintrin.h", ""},
+{"include/xsavecintrin.h", ""},
+{"include/xsaveintrin.h", ""},
+{"include/xsaveoptintrin.h", ""},
+{"include/xsavesintrin.h", ""},
+{"include/xtestintrin.h", ""},
+{"include/_G_config.h", ""},
+{"include/assert.h", ""},
+{"algorithm", ""},
+{"valarray", ""},
+{"array", ""},
+{"atomic", ""},
+{"backward/auto_ptr.h", ""},
+{"backward/binders.h", ""},
+{"bits/algorithmfwd.h", ""},
+{"bits/alloc_traits.h", ""},
+{"bits/allocated_ptr.h", ""},
+{"bits/allocator.h", ""},
+{"bits/atomic_base.h", ""},
+{"bits/atomic_lockfree_defines.h", ""},
+{"bits/atomic_futex.h", ""},
+{"bits/basic_ios.h", ""},
+{"bits/basic_ios.tcc", ""},
+{"bits/basic_string.h", ""},
+{"bits/basic_string.tcc", ""},
+{"bits/char_traits.h", ""},
+{"bits/codecvt.h", ""},
+{"bits/concept_check.h", ""},
+{"bits/cpp_type_traits.h", ""},
+{"bits/cxxabi_forced.h", ""},
+{"bits/deque.tcc", ""},
+{"bits/exception.h", ""},
+{"bits/exception_defines.h", ""},
+{"bits/exception_ptr.h", ""},
+{"bits/forward_list.h", ""},
+{"bits/forward_list.tcc", ""},
+{"bits/fstream.tcc", ""},
+{"bits/functexcept.h", ""},
+{"bits/functional_hash.h", ""},
+{"bits/gslice.h", ""},
+{"bits/gslice_array.h", ""},
+{"bits/hash_bytes.h", ""},
+{"bits/hashtable.h", ""},
+{"bits/hashtable_policy.h", ""},
+{"bits/indirect_array.h", ""},
+{"bits/invoke.h", ""},
+{"bits/ios_base.h", ""},
+{"bits/istream.tcc", ""},
+{"bits/list.tcc", ""},
+{"bits/locale_classes.h", ""},
+{"bits/locale_classes.tcc", ""},
+{"bits/locale_conv.h", ""},
+{"bits/locale_facets.h", ""},
+{"bits/locale_facets.tcc", ""},
+{"bits/locale_facets_nonio.

[PATCH] D121733: Clean pathnames in FileManager.

2022-05-17 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added inline comments.



Comment at: clang-tools-extra/clangd/index/CanonicalIncludes.cpp:546
+  {"include/wordexp.h", ""},
+  {"include/x86intrin.h", ""},
+  {"include/xlocale.h", ""},

ilya-biryukov wrote:
> ppluzhnikov wrote:
> > ilya-biryukov wrote:
> > > Why do we change the order of elements here?
> > > Please revert, this increases the diff and is not relevant to the actual 
> > > change.
> > Note that the elements are inserted into a map
> > (after commit b3a991df3cd6a; used to be a vector before).
> > 
> > Also note that there are duplicates, e.g.
> > 
> > {"bits/typesizes.h", ""},
> > {"bits/typesizes.h", ""},
> > 
> > which can't work as intended / is already broken.
> > 
> > Sorting helps to find these duplicates.
> > 
> This refactoring makes sense, but please split this into a separate change.
https://reviews.llvm.org/D125742


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D135192: Fix incorrect check for running out of source locations.

2022-10-18 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

Richard, ping?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135192

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D135192: Fix incorrect check for running out of source locations.

2022-10-18 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

In D135192#3866294 , @dblaikie wrote:

> Sounds good (guess this is pretty impractical to have a regression test/would 
> require very large files to test?)

Yea, overflowing this requires a very convoluted setup; I don't think it's 
practical to have a unit test for this.

Could you commit this change? (I don't have commit rights in LLVM).

Thanks,


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135192

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D135192: Fix incorrect check for running out of source locations.

2022-10-04 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov created this revision.
Herald added a project: All.
ppluzhnikov published this revision for review.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

When CurrentLoadedOffset is less than TotalSize, current code will
trigger unsigned overflow and will not return an "allocation failed"
indicator.

Google ref: b/248613299


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D135192

Files:
  clang/lib/Basic/SourceManager.cpp


Index: clang/lib/Basic/SourceManager.cpp
===
--- clang/lib/Basic/SourceManager.cpp
+++ clang/lib/Basic/SourceManager.cpp
@@ -455,8 +455,10 @@
  SourceLocation::UIntTy TotalSize) {
   assert(ExternalSLocEntries && "Don't have an external sloc source");
   // Make sure we're not about to run out of source locations.
-  if (CurrentLoadedOffset - TotalSize < NextLocalOffset)
+  if (CurrentLoadedOffset < TotalSize ||
+  CurrentLoadedOffset - TotalSize < NextLocalOffset) {
 return std::make_pair(0, 0);
+  }
   LoadedSLocEntryTable.resize(LoadedSLocEntryTable.size() + NumSLocEntries);
   SLocEntryLoaded.resize(LoadedSLocEntryTable.size());
   CurrentLoadedOffset -= TotalSize;


Index: clang/lib/Basic/SourceManager.cpp
===
--- clang/lib/Basic/SourceManager.cpp
+++ clang/lib/Basic/SourceManager.cpp
@@ -455,8 +455,10 @@
  SourceLocation::UIntTy TotalSize) {
   assert(ExternalSLocEntries && "Don't have an external sloc source");
   // Make sure we're not about to run out of source locations.
-  if (CurrentLoadedOffset - TotalSize < NextLocalOffset)
+  if (CurrentLoadedOffset < TotalSize ||
+  CurrentLoadedOffset - TotalSize < NextLocalOffset) {
 return std::make_pair(0, 0);
+  }
   LoadedSLocEntryTable.resize(LoadedSLocEntryTable.size() + NumSLocEntries);
   SLocEntryLoaded.resize(LoadedSLocEntryTable.size());
   CurrentLoadedOffset -= TotalSize;
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D135192: Fix incorrect check for running out of source locations.

2022-10-06 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a reviewer: HAPPY.
ppluzhnikov added a comment.

Richard, could you take a look?

You've added the check in commit 78d81ecfc38c2


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135192

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126412: Fix a buglet in remove_dots().

2022-05-27 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
ppluzhnikov updated this revision to Diff 432324.
ppluzhnikov added a comment.
ppluzhnikov updated this revision to Diff 432461.
ppluzhnikov updated this revision to Diff 432551.
ppluzhnikov updated this revision to Diff 432577.
ppluzhnikov updated this revision to Diff 432592.
ppluzhnikov updated this revision to Diff 432612.
ppluzhnikov updated this revision to Diff 432623.
ppluzhnikov published this revision for review.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Fix failed tests.


ppluzhnikov added a comment.

Rebase to ToT.


ppluzhnikov added a comment.

Fix InMemoryFileSystemTest bug.


ppluzhnikov added a comment.

Fix ProxyFileSystemTest.Basic on Win/x64


ppluzhnikov added a comment.

One more ProxyFileSystemTest fixe.


ppluzhnikov added a comment.

Fix compile failure.


ppluzhnikov added a comment.

Fix formatting.


The function promises to canonicalize the path, but neglected to do so
for the root component.

For example, calling remove_dots("/tmp/foo.c", Style::windows_backslash)
resulted in "/tmp\foo.c". Now it produces "\tmp\foo.c".

Also fix FIXME in the corresponding test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126412

Files:
  clang/unittests/Basic/FileManagerTest.cpp
  clang/unittests/Frontend/PCHPreambleTest.cpp
  llvm/lib/Support/Path.cpp
  llvm/unittests/Support/Path.cpp
  llvm/unittests/Support/VirtualFileSystemTest.cpp

Index: llvm/unittests/Support/VirtualFileSystemTest.cpp
===
--- llvm/unittests/Support/VirtualFileSystemTest.cpp
+++ llvm/unittests/Support/VirtualFileSystemTest.cpp
@@ -199,7 +199,7 @@
 };
 
 /// Replace back-slashes by front-slashes.
-std::string getPosixPath(std::string S) {
+std::string getPosixPath(const Twine &S) {
   SmallString<128> Result;
   llvm::sys::path::native(S, Result, llvm::sys::path::Style::posix);
   return std::string(Result.str());
@@ -923,11 +923,11 @@
 
   auto PWD = PFS.getCurrentWorkingDirectory();
   ASSERT_FALSE(PWD.getError());
-  ASSERT_EQ("/", *PWD);
+  ASSERT_EQ("/", getPosixPath(*PWD));
 
   SmallString<16> Path;
   ASSERT_FALSE(PFS.getRealPath("a", Path));
-  ASSERT_EQ("/a", Path);
+  ASSERT_EQ("/a", getPosixPath(Path));
 
   bool Local = true;
   ASSERT_FALSE(PFS.isLocal("/a", Local));
@@ -1343,7 +1343,8 @@
   EXPECT_NE(FS.status("/a")->getUniqueID(), FS.status("/e")->getUniqueID());
 
   // Recreating the "same" FS yields the same UniqueIDs.
-  vfs::InMemoryFileSystem FS2;
+  // Note: FS2 should match FS with respect to path normalization.
+  vfs::InMemoryFileSystem FS2(/*UseNormalizedPath=*/false);
   ASSERT_TRUE(FS2.addFile("/a/b", 0, MemoryBuffer::getMemBuffer("text")));
   EXPECT_EQ(FS.status("/a/b")->getUniqueID(),
 FS2.status("/a/b")->getUniqueID());
Index: llvm/unittests/Support/Path.cpp
===
--- llvm/unittests/Support/Path.cpp
+++ llvm/unittests/Support/Path.cpp
@@ -1544,16 +1544,14 @@
   EXPECT_EQ("C:\\a\\c", remove_dots("C:\\foo\\bar//..\\..\\a\\c", true,
 path::Style::windows));
 
-  // FIXME: These leading forward slashes are emergent behavior. VFS depends on
-  // this behavior now.
-  EXPECT_EQ("C:/bar",
+  EXPECT_EQ("C:\\bar",
 remove_dots("C:/foo/../bar", true, path::Style::windows));
-  EXPECT_EQ("C:/foo\\bar",
+  EXPECT_EQ("C:\\foo\\bar",
 remove_dots("C:/foo/bar", true, path::Style::windows));
-  EXPECT_EQ("C:/foo\\bar",
+  EXPECT_EQ("C:\\foo\\bar",
 remove_dots("C:/foo\\bar", true, path::Style::windows));
-  EXPECT_EQ("/", remove_dots("/", true, path::Style::windows));
-  EXPECT_EQ("C:/", remove_dots("C:/", true, path::Style::windows));
+  EXPECT_EQ("\\", remove_dots("/", true, path::Style::windows));
+  EXPECT_EQ("C:\\", remove_dots("C:/", true, path::Style::windows));
 
   // Some clients of remove_dots expect it to remove trailing slashes. Again,
   // this is emergent behavior that VFS relies on, and not inherently part of
@@ -1564,7 +1562,8 @@
 remove_dots("/foo/bar/", true, path::Style::posix));
 
   // A double separator is rewritten.
-  EXPECT_EQ("C:/foo\\bar", remove_dots("C:/foo//bar", true, path::Style::windows));
+  EXPECT_EQ("C:\\foo\\bar",
+remove_dots("C:/foo//bar", true, path::Style::windows));
 
   SmallString<64> Path1(".\\.\\c");
   EXPECT_TRUE(path::remove_dots(Path1, true, path::Style::windows));
Index: llvm/lib/Support/Path.cpp
===
--- llvm/lib/Support/Path.cpp
+++ llvm/lib/Support/Path.cpp
@@ -760,11 +760,15 @@
 }
   }
 
+  SmallString<256> buffer = root;
+  // "root" could be "/", which may need to be translated into "\".
+  make_preferred(buffer, style);
+  needs_change |= root != buffer;
+
   // Avoid rewriting t

[PATCH] D125742: Minor refactor of CanonicalIncludes::addSystemHeadersMapping.

2022-05-31 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

Ping?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125742

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126412: Fix a buglet in remove_dots().

2022-06-02 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

In D126412#3553796 , @rnk wrote:

> do you need someone to push this?

Yes, please.
I do not have commit rights.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126412

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126396: Clean "./" from __FILE__ expansion.

2022-06-02 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov created this revision.
Herald added a project: All.
ppluzhnikov updated this revision to Diff 432064.
ppluzhnikov added a comment.
Herald added a subscriber: hiraditya.
ppluzhnikov updated this revision to Diff 433837.
ppluzhnikov published this revision for review.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Also fix a buglet in remove_dots().


ppluzhnikov added a comment.

Rebase to ToT.


This is alternative to https://reviews.llvm.org/D121733
and helps with Clang header modules in which FILE
may expand to "./foo.h" or "foo.h" depending on whether the file was
included directly or not.

Only do this when UseTargetPathSeparator is true, as we are already
changing the path in that case.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126396

Files:
  clang/lib/Lex/PPMacroExpansion.cpp


Index: clang/lib/Lex/PPMacroExpansion.cpp
===
--- clang/lib/Lex/PPMacroExpansion.cpp
+++ clang/lib/Lex/PPMacroExpansion.cpp
@@ -1895,9 +1895,9 @@
   LangOpts.remapPathPrefix(Path);
   if (LangOpts.UseTargetPathSeparator) {
 if (TI.getTriple().isOSWindows())
-  llvm::sys::path::make_preferred(
-  Path, llvm::sys::path::Style::windows_backslash);
+  llvm::sys::path::remove_dots(Path, false,
+   llvm::sys::path::Style::windows_backslash);
 else
-  llvm::sys::path::make_preferred(Path, llvm::sys::path::Style::posix);
+  llvm::sys::path::remove_dots(Path, false, llvm::sys::path::Style::posix);
   }
 }


Index: clang/lib/Lex/PPMacroExpansion.cpp
===
--- clang/lib/Lex/PPMacroExpansion.cpp
+++ clang/lib/Lex/PPMacroExpansion.cpp
@@ -1895,9 +1895,9 @@
   LangOpts.remapPathPrefix(Path);
   if (LangOpts.UseTargetPathSeparator) {
 if (TI.getTriple().isOSWindows())
-  llvm::sys::path::make_preferred(
-  Path, llvm::sys::path::Style::windows_backslash);
+  llvm::sys::path::remove_dots(Path, false,
+   llvm::sys::path::Style::windows_backslash);
 else
-  llvm::sys::path::make_preferred(Path, llvm::sys::path::Style::posix);
+  llvm::sys::path::remove_dots(Path, false, llvm::sys::path::Style::posix);
   }
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126396: Clean "./" from __FILE__ expansion.

2022-06-02 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

Alan,

Thanks for the approval.
Could you push this patch -- I don't have commit rights.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126396

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127009: Modify test case so it verifies the fix from D126396.

2022-06-03 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov created this revision.
ppluzhnikov added a reviewer: MaskRay.
Herald added a subscriber: StephenFan.
Herald added a project: All.
ppluzhnikov requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127009

Files:
  clang/test/Preprocessor/file_test.c


Index: clang/test/Preprocessor/file_test.c
===
--- clang/test/Preprocessor/file_test.c
+++ clang/test/Preprocessor/file_test.c
@@ -8,9 +8,10 @@
 // RUN: %clang -E -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-reproducible -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS-REPRODUCIBLE
+// RUN: %clang -E -ffile-reproducible -target x86_64-pc-linux-gnu -c -o - %s | 
FileCheck %s --check-prefix CHECK-LINUX-REPRODUCIBLE
 
 filename: __FILE__
-#include "Inputs/include-file-test/file_test.h"
+#include "./Inputs/./include-file-test/file_test.h"
 
 // CHECK: filename: "/UNLIKELY_PATH/empty/file_test.c"
 // CHECK: filename: "/UNLIKELY_PATH/empty/Inputs/include-file-test/file_test.h"
@@ -23,7 +24,7 @@
 // CHECK-EVIL-NOT: filename:
 
 // CHECK-REMOVE: filename: "file_test.c"
-// CHECK-REMOVE: filename: "Inputs/include-file-test/file_test.h"
+// CHECK-REMOVE: filename: "{{.*}}Inputs/{{.*}}include-file-test/file_test.h"
 // CHECK-REMOVE: basefile: "file_test.c"
 // CHECK-REMOVE-NOT: filename:
 
@@ -32,7 +33,12 @@
 // CHECK-WINDOWS: basefile: "file_test.c"
 // CHECK-WINDOWS-NOT: filename:
 
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}file_test.c"
-// CHECK-WINDOWS-REPRODUCIBLE: filename: 
"{{[^/]*}}Inputs\\include-file-test\\file_test.h"
-// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{[^/]*}}file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: 
"{{.*}}\\Inputs\\include-file-test\\file_test.h"
+// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{.*}}\\file_test.c"
 // CHECK-WINDOWS-REPRODUCIBLE-NOT: filename:
+
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE: filename: 
"{{.*}}/Inputs/include-file-test/file_test.h"
+// CHECK-LINUX-REPRODUCIBLE: basefile: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE-NOT: filename:


Index: clang/test/Preprocessor/file_test.c
===
--- clang/test/Preprocessor/file_test.c
+++ clang/test/Preprocessor/file_test.c
@@ -8,9 +8,10 @@
 // RUN: %clang -E -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-reproducible -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS-REPRODUCIBLE
+// RUN: %clang -E -ffile-reproducible -target x86_64-pc-linux-gnu -c -o - %s | FileCheck %s --check-prefix CHECK-LINUX-REPRODUCIBLE
 
 filename: __FILE__
-#include "Inputs/include-file-test/file_test.h"
+#include "./Inputs/./include-file-test/file_test.h"
 
 // CHECK: filename: "/UNLIKELY_PATH/empty/file_test.c"
 // CHECK: filename: "/UNLIKELY_PATH/empty/Inputs/include-file-test/file_test.h"
@@ -23,7 +24,7 @@
 // CHECK-EVIL-NOT: filename:
 
 // CHECK-REMOVE: filename: "file_test.c"
-// CHECK-REMOVE: filename: "Inputs/include-file-test/file_test.h"
+// CHECK-REMOVE: filename: "{{.*}}Inputs/{{.*}}include-file-test/file_test.h"
 // CHECK-REMOVE: basefile: "file_test.c"
 // CHECK-REMOVE-NOT: filename:
 
@@ -32,7 +33,12 @@
 // CHECK-WINDOWS: basefile: "file_test.c"
 // CHECK-WINDOWS-NOT: filename:
 
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}file_test.c"
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}Inputs\\include-file-test\\file_test.h"
-// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{[^/]*}}file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\Inputs\\include-file-test\\file_test.h"
+// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{.*}}\\file_test.c"
 // CHECK-WINDOWS-REPRODUCIBLE-NOT: filename:
+
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/Inputs/include-file-test/file_test.h"
+// CHECK-LINUX-REPRODUCIBLE: basefile: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE-NOT: filename:
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D126396: Clean "./" from __FILE__ expansion.

2022-06-03 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

In D126396#3556321 , @MaskRay wrote:

> Is it feasible to add a test?

Sure. I extended the existing tests added in https://reviews.llvm.org/D122766 
to cover this.
https://reviews.llvm.org/D127009


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126396

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D127009: Modify test case so it verifies the fix from D126396.

2022-06-03 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 434198.
ppluzhnikov marked an inline comment as done.
ppluzhnikov added a comment.

Add comment and suppress clang-format.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127009

Files:
  clang/test/Preprocessor/file_test.c


Index: clang/test/Preprocessor/file_test.c
===
--- clang/test/Preprocessor/file_test.c
+++ clang/test/Preprocessor/file_test.c
@@ -8,9 +8,16 @@
 // RUN: %clang -E -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-reproducible -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS-REPRODUCIBLE
+// RUN: %clang -E -ffile-reproducible -target x86_64-pc-linux-gnu -c -o - %s | 
FileCheck %s --check-prefix CHECK-LINUX-REPRODUCIBLE
+
+// Clang-format wants to do something unreasonable to this file.
+// clang-format off
 
 filename: __FILE__
-#include "Inputs/include-file-test/file_test.h"
+
+// This line tests that the __FILE__ in included is canonicalized
+// (has ./ removed).
+#include "./Inputs/./include-file-test/file_test.h"
 
 // CHECK: filename: "/UNLIKELY_PATH/empty/file_test.c"
 // CHECK: filename: "/UNLIKELY_PATH/empty/Inputs/include-file-test/file_test.h"
@@ -23,7 +30,7 @@
 // CHECK-EVIL-NOT: filename:
 
 // CHECK-REMOVE: filename: "file_test.c"
-// CHECK-REMOVE: filename: "Inputs/include-file-test/file_test.h"
+// CHECK-REMOVE: filename: "{{.*}}Inputs/{{.*}}include-file-test/file_test.h"
 // CHECK-REMOVE: basefile: "file_test.c"
 // CHECK-REMOVE-NOT: filename:
 
@@ -32,7 +39,12 @@
 // CHECK-WINDOWS: basefile: "file_test.c"
 // CHECK-WINDOWS-NOT: filename:
 
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}file_test.c"
-// CHECK-WINDOWS-REPRODUCIBLE: filename: 
"{{[^/]*}}Inputs\\include-file-test\\file_test.h"
-// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{[^/]*}}file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: 
"{{.*}}\\Inputs\\include-file-test\\file_test.h"
+// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{.*}}\\file_test.c"
 // CHECK-WINDOWS-REPRODUCIBLE-NOT: filename:
+
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE: filename: 
"{{.*}}/Inputs/include-file-test/file_test.h"
+// CHECK-LINUX-REPRODUCIBLE: basefile: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE-NOT: filename:


Index: clang/test/Preprocessor/file_test.c
===
--- clang/test/Preprocessor/file_test.c
+++ clang/test/Preprocessor/file_test.c
@@ -8,9 +8,16 @@
 // RUN: %clang -E -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-reproducible -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS-REPRODUCIBLE
+// RUN: %clang -E -ffile-reproducible -target x86_64-pc-linux-gnu -c -o - %s | FileCheck %s --check-prefix CHECK-LINUX-REPRODUCIBLE
+
+// Clang-format wants to do something unreasonable to this file.
+// clang-format off
 
 filename: __FILE__
-#include "Inputs/include-file-test/file_test.h"
+
+// This line tests that the __FILE__ in included is canonicalized
+// (has ./ removed).
+#include "./Inputs/./include-file-test/file_test.h"
 
 // CHECK: filename: "/UNLIKELY_PATH/empty/file_test.c"
 // CHECK: filename: "/UNLIKELY_PATH/empty/Inputs/include-file-test/file_test.h"
@@ -23,7 +30,7 @@
 // CHECK-EVIL-NOT: filename:
 
 // CHECK-REMOVE: filename: "file_test.c"
-// CHECK-REMOVE: filename: "Inputs/include-file-test/file_test.h"
+// CHECK-REMOVE: filename: "{{.*}}Inputs/{{.*}}include-file-test/file_test.h"
 // CHECK-REMOVE: basefile: "file_test.c"
 // CHECK-REMOVE-NOT: filename:
 
@@ -32,7 +39,12 @@
 // CHECK-WINDOWS: basefile: "file_test.c"
 // CHECK-WINDOWS-NOT: filename:
 
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}file_test.c"
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}Inputs\\include-file-test\\file_test.h"
-// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{[^/]*}}file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\Inputs\\include-file-test\\file_test.h"
+// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{.*}}\\file_test.c"
 // CHECK-WINDOWS-REPRODUCIBLE-NOT: filename:
+
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/Inputs/include-file-test/file_test.h"
+// CHECK-LINUX-REPRODUCIBLE: basefile: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE-NOT: filename:

[PATCH] D127009: Modify test case so it verifies the fix from D126396.

2022-06-03 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 434199.
ppluzhnikov added a comment.

Make comment better.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127009

Files:
  clang/test/Preprocessor/file_test.c


Index: clang/test/Preprocessor/file_test.c
===
--- clang/test/Preprocessor/file_test.c
+++ clang/test/Preprocessor/file_test.c
@@ -8,9 +8,16 @@
 // RUN: %clang -E -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-reproducible -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS-REPRODUCIBLE
+// RUN: %clang -E -ffile-reproducible -target x86_64-pc-linux-gnu -c -o - %s | 
FileCheck %s --check-prefix CHECK-LINUX-REPRODUCIBLE
+
+// Clang-format wants to do something unreasonable to this file.
+// clang-format off
 
 filename: __FILE__
-#include "Inputs/include-file-test/file_test.h"
+
+// This line tests that the __FILE__ in included header is canonicalized
+// (has "./" removed).
+#include "./Inputs/./include-file-test/file_test.h"
 
 // CHECK: filename: "/UNLIKELY_PATH/empty/file_test.c"
 // CHECK: filename: "/UNLIKELY_PATH/empty/Inputs/include-file-test/file_test.h"
@@ -23,7 +30,7 @@
 // CHECK-EVIL-NOT: filename:
 
 // CHECK-REMOVE: filename: "file_test.c"
-// CHECK-REMOVE: filename: "Inputs/include-file-test/file_test.h"
+// CHECK-REMOVE: filename: "{{.*}}Inputs/{{.*}}include-file-test/file_test.h"
 // CHECK-REMOVE: basefile: "file_test.c"
 // CHECK-REMOVE-NOT: filename:
 
@@ -32,7 +39,12 @@
 // CHECK-WINDOWS: basefile: "file_test.c"
 // CHECK-WINDOWS-NOT: filename:
 
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}file_test.c"
-// CHECK-WINDOWS-REPRODUCIBLE: filename: 
"{{[^/]*}}Inputs\\include-file-test\\file_test.h"
-// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{[^/]*}}file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: 
"{{.*}}\\Inputs\\include-file-test\\file_test.h"
+// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{.*}}\\file_test.c"
 // CHECK-WINDOWS-REPRODUCIBLE-NOT: filename:
+
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE: filename: 
"{{.*}}/Inputs/include-file-test/file_test.h"
+// CHECK-LINUX-REPRODUCIBLE: basefile: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE-NOT: filename:


Index: clang/test/Preprocessor/file_test.c
===
--- clang/test/Preprocessor/file_test.c
+++ clang/test/Preprocessor/file_test.c
@@ -8,9 +8,16 @@
 // RUN: %clang -E -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-reproducible -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS-REPRODUCIBLE
+// RUN: %clang -E -ffile-reproducible -target x86_64-pc-linux-gnu -c -o - %s | FileCheck %s --check-prefix CHECK-LINUX-REPRODUCIBLE
+
+// Clang-format wants to do something unreasonable to this file.
+// clang-format off
 
 filename: __FILE__
-#include "Inputs/include-file-test/file_test.h"
+
+// This line tests that the __FILE__ in included header is canonicalized
+// (has "./" removed).
+#include "./Inputs/./include-file-test/file_test.h"
 
 // CHECK: filename: "/UNLIKELY_PATH/empty/file_test.c"
 // CHECK: filename: "/UNLIKELY_PATH/empty/Inputs/include-file-test/file_test.h"
@@ -23,7 +30,7 @@
 // CHECK-EVIL-NOT: filename:
 
 // CHECK-REMOVE: filename: "file_test.c"
-// CHECK-REMOVE: filename: "Inputs/include-file-test/file_test.h"
+// CHECK-REMOVE: filename: "{{.*}}Inputs/{{.*}}include-file-test/file_test.h"
 // CHECK-REMOVE: basefile: "file_test.c"
 // CHECK-REMOVE-NOT: filename:
 
@@ -32,7 +39,12 @@
 // CHECK-WINDOWS: basefile: "file_test.c"
 // CHECK-WINDOWS-NOT: filename:
 
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}file_test.c"
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}Inputs\\include-file-test\\file_test.h"
-// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{[^/]*}}file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\Inputs\\include-file-test\\file_test.h"
+// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{.*}}\\file_test.c"
 // CHECK-WINDOWS-REPRODUCIBLE-NOT: filename:
+
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/Inputs/include-file-test/file_test.h"
+// CHECK-LINUX-REPRODUCIBLE: basefile: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE-NOT: filename:
___
cfe-commits ma

[PATCH] D127009: [test] Modify test case so it verifies the fix from D126396

2022-06-03 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 434202.
ppluzhnikov added a comment.

Update.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127009

Files:
  clang/test/Preprocessor/file_test.c


Index: clang/test/Preprocessor/file_test.c
===
--- clang/test/Preprocessor/file_test.c
+++ clang/test/Preprocessor/file_test.c
@@ -8,9 +8,16 @@
 // RUN: %clang -E -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-reproducible -target x86_64-pc-win32 -c -o - %s | 
FileCheck %s --check-prefix CHECK-WINDOWS-REPRODUCIBLE
+// RUN: %clang -E -ffile-reproducible -target x86_64-pc-linux-gnu -c -o - %s | 
FileCheck %s --check-prefix CHECK-LINUX-REPRODUCIBLE
+
+// Clang-format wants to do something unreasonable to this file.
+// clang-format off
 
 filename: __FILE__
-#include "Inputs/include-file-test/file_test.h"
+
+// This line tests that the __FILE__ in included header is canonicalized
+// (has "./" removed).
+#include "./Inputs/./include-file-test/file_test.h"
 
 // CHECK: filename: "/UNLIKELY_PATH/empty/file_test.c"
 // CHECK: filename: "/UNLIKELY_PATH/empty/Inputs/include-file-test/file_test.h"
@@ -23,7 +30,7 @@
 // CHECK-EVIL-NOT: filename:
 
 // CHECK-REMOVE: filename: "file_test.c"
-// CHECK-REMOVE: filename: "Inputs/include-file-test/file_test.h"
+// CHECK-REMOVE: filename: "{{.*}}Inputs/{{.*}}include-file-test/file_test.h"
 // CHECK-REMOVE: basefile: "file_test.c"
 // CHECK-REMOVE-NOT: filename:
 
@@ -32,7 +39,12 @@
 // CHECK-WINDOWS: basefile: "file_test.c"
 // CHECK-WINDOWS-NOT: filename:
 
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}file_test.c"
-// CHECK-WINDOWS-REPRODUCIBLE: filename: 
"{{[^/]*}}Inputs\\include-file-test\\file_test.h"
-// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{[^/]*}}file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: 
"{{.*}}\\Inputs\\include-file-test\\file_test.h"
+// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{.*}}\\file_test.c"
 // CHECK-WINDOWS-REPRODUCIBLE-NOT: filename:
+
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE: filename: 
"{{.*}}/Inputs/include-file-test/file_test.h"
+// CHECK-LINUX-REPRODUCIBLE: basefile: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE-NOT: filename:


Index: clang/test/Preprocessor/file_test.c
===
--- clang/test/Preprocessor/file_test.c
+++ clang/test/Preprocessor/file_test.c
@@ -8,9 +8,16 @@
 // RUN: %clang -E -fmacro-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-prefix-map=%p/= -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS
 // RUN: %clang -E -ffile-reproducible -target x86_64-pc-win32 -c -o - %s | FileCheck %s --check-prefix CHECK-WINDOWS-REPRODUCIBLE
+// RUN: %clang -E -ffile-reproducible -target x86_64-pc-linux-gnu -c -o - %s | FileCheck %s --check-prefix CHECK-LINUX-REPRODUCIBLE
+
+// Clang-format wants to do something unreasonable to this file.
+// clang-format off
 
 filename: __FILE__
-#include "Inputs/include-file-test/file_test.h"
+
+// This line tests that the __FILE__ in included header is canonicalized
+// (has "./" removed).
+#include "./Inputs/./include-file-test/file_test.h"
 
 // CHECK: filename: "/UNLIKELY_PATH/empty/file_test.c"
 // CHECK: filename: "/UNLIKELY_PATH/empty/Inputs/include-file-test/file_test.h"
@@ -23,7 +30,7 @@
 // CHECK-EVIL-NOT: filename:
 
 // CHECK-REMOVE: filename: "file_test.c"
-// CHECK-REMOVE: filename: "Inputs/include-file-test/file_test.h"
+// CHECK-REMOVE: filename: "{{.*}}Inputs/{{.*}}include-file-test/file_test.h"
 // CHECK-REMOVE: basefile: "file_test.c"
 // CHECK-REMOVE-NOT: filename:
 
@@ -32,7 +39,12 @@
 // CHECK-WINDOWS: basefile: "file_test.c"
 // CHECK-WINDOWS-NOT: filename:
 
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}file_test.c"
-// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{[^/]*}}Inputs\\include-file-test\\file_test.h"
-// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{[^/]*}}file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\file_test.c"
+// CHECK-WINDOWS-REPRODUCIBLE: filename: "{{.*}}\\Inputs\\include-file-test\\file_test.h"
+// CHECK-WINDOWS-REPRODUCIBLE: basefile: "{{.*}}\\file_test.c"
 // CHECK-WINDOWS-REPRODUCIBLE-NOT: filename:
+
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE: filename: "{{.*}}/Inputs/include-file-test/file_test.h"
+// CHECK-LINUX-REPRODUCIBLE: basefile: "{{.*}}/file_test.c"
+// CHECK-LINUX-REPRODUCIBLE-NOT: filename:
___
cfe-commits mailing list
cf

[PATCH] D127009: [test] Modify test case so it verifies the fix from D126396

2022-06-03 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

I think I've done the cleanups requested.

If this looks good, please push it (I don't have commit rights).

Thanks,


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127009

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D125742: Minor refactor of CanonicalIncludes::addSystemHeadersMapping.

2022-06-06 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

Ping x2?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125742

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D121733: Clean pathnames in FileManager.

2022-06-06 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov abandoned this revision.
ppluzhnikov added a comment.

This proved to be too hard :-(
A smaller change: https://reviews.llvm.org/D126396 fixed one aspect of this 
problem.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121733

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D125742: Minor refactor of CanonicalIncludes::addSystemHeadersMapping.

2022-06-07 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov updated this revision to Diff 434828.
ppluzhnikov marked 4 inline comments as done.
ppluzhnikov added a comment.

Address review comments.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125742

Files:
  clang-tools-extra/clangd/index/CanonicalIncludes.cpp

Index: clang-tools-extra/clangd/index/CanonicalIncludes.cpp
===
--- clang-tools-extra/clangd/index/CanonicalIncludes.cpp
+++ clang-tools-extra/clangd/index/CanonicalIncludes.cpp
@@ -18,6 +18,655 @@
 namespace clangd {
 namespace {
 const char IWYUPragma[] = "// IWYU pragma: private, include ";
+
+const std::pair IncludeMappings[] = {
+{"include/__stddef_max_align_t.h", ""},
+{"include/__wmmintrin_aes.h", ""},
+{"include/__wmmintrin_pclmul.h", ""},
+{"include/adxintrin.h", ""},
+{"include/ammintrin.h", ""},
+{"include/avx2intrin.h", ""},
+{"include/avx512bwintrin.h", ""},
+{"include/avx512cdintrin.h", ""},
+{"include/avx512dqintrin.h", ""},
+{"include/avx512erintrin.h", ""},
+{"include/avx512fintrin.h", ""},
+{"include/avx512ifmaintrin.h", ""},
+{"include/avx512ifmavlintrin.h", ""},
+{"include/avx512pfintrin.h", ""},
+{"include/avx512vbmiintrin.h", ""},
+{"include/avx512vbmivlintrin.h", ""},
+{"include/avx512vlbwintrin.h", ""},
+{"include/avx512vlcdintrin.h", ""},
+{"include/avx512vldqintrin.h", ""},
+{"include/avx512vlintrin.h", ""},
+{"include/avxintrin.h", ""},
+{"include/bmi2intrin.h", ""},
+{"include/bmiintrin.h", ""},
+{"include/emmintrin.h", ""},
+{"include/f16cintrin.h", ""},
+{"include/float.h", ""},
+{"include/fma4intrin.h", ""},
+{"include/fmaintrin.h", ""},
+{"include/fxsrintrin.h", ""},
+{"include/ia32intrin.h", ""},
+{"include/immintrin.h", ""},
+{"include/inttypes.h", ""},
+{"include/limits.h", ""},
+{"include/lzcntintrin.h", ""},
+{"include/mm3dnow.h", ""},
+{"include/mm_malloc.h", ""},
+{"include/mmintrin.h", ""},
+{"include/mwaitxintrin.h", ""},
+{"include/pkuintrin.h", ""},
+{"include/pmmintrin.h", ""},
+{"include/popcntintrin.h", ""},
+{"include/prfchwintrin.h", ""},
+{"include/rdseedintrin.h", ""},
+{"include/rtmintrin.h", ""},
+{"include/shaintrin.h", ""},
+{"include/smmintrin.h", ""},
+{"include/stdalign.h", ""},
+{"include/stdarg.h", ""},
+{"include/stdbool.h", ""},
+{"include/stddef.h", ""},
+{"include/stdint.h", ""},
+{"include/tbmintrin.h", ""},
+{"include/tmmintrin.h", ""},
+{"include/wmmintrin.h", ""},
+{"include/x86intrin.h", ""},
+{"include/xmmintrin.h", ""},
+{"include/xopintrin.h", ""},
+{"include/xsavecintrin.h", ""},
+{"include/xsaveintrin.h", ""},
+{"include/xsaveoptintrin.h", ""},
+{"include/xsavesintrin.h", ""},
+{"include/xtestintrin.h", ""},
+{"include/_G_config.h", ""},
+{"include/assert.h", ""},
+{"algorithm", ""},
+{"valarray", ""},
+{"array", ""},
+{"atomic", ""},
+{"backward/auto_ptr.h", ""},
+{"backward/binders.h", ""},
+{"bits/algorithmfwd.h", ""},
+{"bits/alloc_traits.h", ""},
+{"bits/allocated_ptr.h", ""},
+{"bits/allocator.h", ""},
+{"bits/atomic_base.h", ""},
+{"bits/atomic_lockfree_defines.h", ""},
+{"bits/atomic_futex.h", ""},
+{"bits/basic_ios.h", ""},
+{"bits/basic_ios.tcc", ""},
+{"bits/basic_string.h", ""},
+{"bits/basic_string.tcc", ""},
+{"bits/char_traits.h", ""},
+{"bits/codecvt.h", ""},
+{"bits/concept_check.h", ""},
+{"bits/cpp_type_traits.h", ""},
+{"bits/cxxabi_forced.h", ""},
+{"bits/deque.tcc", ""},
+{"bits/exception.h", ""},
+{"bits/exception_defines.h", ""},
+{"bits/exception_ptr.h", ""},
+{"bits/forward_list.h", ""},
+{"bits/forward_list.tcc", ""},
+{"bits/fstream.tcc", ""},
+{"bits/functexcept.h", ""},
+{"bits/functional_hash.h", ""},
+{"bits/gslice.h", ""},
+{"bits/gslice_array.h", ""},
+{"bits/hash_bytes.h", ""},
+{"bits/hashtable.h", ""},
+{"bits/hashtable_policy.h", ""},
+{"bits/indirect_array.h", ""},
+{"bits/invoke.h", ""},
+{"bits/ios_base.h", ""},
+{"bits/istream.tcc", ""},
+{"bits/list.tcc", ""},
+{"bits/locale_classes.h", ""},
+{"bits/locale_classes.tcc", ""},
+{"bits/locale_conv.h", ""},
+{"bits/locale_facets.h", ""},
+{"bits/locale_facets.tcc", ""},
+{"bits/locale_facets_nonio.h", ""},
+{"bits/locale_facets_nonio.tcc", ""},
+{"bits/localefwd.h", ""},
+{"bits/mask_array.h", ""},
+{"bits/memoryfwd.h", ""},
+{"bits/move.h", ""},
+{"bits/nested_exception.h", ""},
+{"bits/ostream.tcc", ""},
+{"bits/ostream_insert.h", ""},
+{"bits/parse_numbers.h", ""},
+{"bits/postypes.h", ""},
+{"bits/predefined_ops.h", ""},
+{"bits/ptr_traits.h", ""},

[PATCH] D125742: Minor refactor of CanonicalIncludes::addSystemHeadersMapping.

2022-06-07 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

Thanks for the review.

Comments addressed in new revision.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125742

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D125742: Minor refactor of CanonicalIncludes::addSystemHeadersMapping.

2022-06-07 Thread Paul Pluzhnikov via Phabricator via cfe-commits
ppluzhnikov added a comment.

Thanks for the review.

Could you commit this?
I don't have commit rights.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125742

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits