https://github.com/vsapsai updated 
https://github.com/llvm/llvm-project/pull/182426

>From fd6d7c78169da03d4d4c59c171b1a6b32d0ae41d Mon Sep 17 00:00:00 2001
From: Volodymyr Sapsai <[email protected]>
Date: Thu, 19 Feb 2026 18:08:16 -0800
Subject: [PATCH] [c-index-test] Avoid loading a module input file when we need
 a file name only.

Loading a module input file triggers its validation. Avoid this process
when we need only a file name.

rdar://167647519
---
 clang/tools/c-index-test/core_main.cpp | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/clang/tools/c-index-test/core_main.cpp 
b/clang/tools/c-index-test/core_main.cpp
index c67479fd130ca..923609276eee8 100644
--- a/clang/tools/c-index-test/core_main.cpp
+++ b/clang/tools/c-index-test/core_main.cpp
@@ -206,12 +206,17 @@ class PrintIndexDataConsumer : public IndexDataConsumer {
 static void dumpModuleFileInputs(serialization::ModuleFile &Mod,
                                  ASTReader &Reader,
                                  raw_ostream &OS) {
+  SmallString<0> PathBuf;
+  PathBuf.reserve(256);
   OS << "---- Module Inputs ----\n";
-  Reader.visitInputFiles(Mod, /*IncludeSystem=*/true, /*Complain=*/false,
-                        [&](const serialization::InputFile &IF, bool isSystem) 
{
-    OS << (isSystem ? "system" : "user") << " | ";
-    OS << IF.getFile()->getName() << '\n';
-  });
+  Reader.visitInputFileInfos(
+      Mod, /*IncludeSystem=*/true,
+      [&](const serialization::InputFileInfo &IFI, bool isSystem) {
+        OS << (isSystem ? "system" : "user") << " | ";
+        auto Filename = ASTReader::ResolveImportedPath(
+            PathBuf, IFI.UnresolvedImportedFilenameAsRequested, Mod);
+        OS << *Filename << '\n';
+      });
 }
 
 static bool printSourceSymbols(const char *Executable,

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to