[clang] [clang] Use the VFS to get the OpenMP entry info (PR #160935)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 26 12:44:00 PDT 2025


https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/160935

This PR uses the VFS to get the OpenMP entry info instead of going straight to the real file system. This matches the behavior of other input files of the compiler.

>From bdcc3b6d803b1b894330d76e35cb2f4733eb6822 Mon Sep 17 00:00:00 2001
From: Jan Svoboda <jan_svoboda at apple.com>
Date: Fri, 26 Sep 2025 12:35:34 -0700
Subject: [PATCH] [clang] Use the VFS to get the OpenMP entry info

---
 clang/lib/CodeGen/CGOpenMPRuntime.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index 0136f69172aa5..75bde3f72c4c2 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -1542,10 +1542,8 @@ static llvm::TargetRegionEntryInfo getEntryInfoFromPresumedLoc(
     SourceManager &SM = CGM.getContext().getSourceManager();
     PresumedLoc PLoc = SM.getPresumedLoc(BeginLoc);
 
-    llvm::sys::fs::UniqueID ID;
-    if (llvm::sys::fs::getUniqueID(PLoc.getFilename(), ID)) {
+    if (CGM.getFileSystem()->exists(PLoc.getFilename()))
       PLoc = SM.getPresumedLoc(BeginLoc, /*UseLineDirectives=*/false);
-    }
 
     return std::pair<std::string, uint64_t>(PLoc.getFilename(), PLoc.getLine());
   };



More information about the cfe-commits mailing list