Skip to content

Conversation

jansvoboda11
Copy link
Contributor

This PR uses the VFS/FileManager to check the system framework marker instead of going straight to the real file system. This matches the behavior of other input files of the compiler.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Sep 26, 2025
@llvmbot
Copy link
Member

llvmbot commented Sep 26, 2025

@llvm/pr-subscribers-clang

Author: Jan Svoboda (jansvoboda11)

Changes

This PR uses the VFS/FileManager to check the system framework marker instead of going straight to the real file system. This matches the behavior of other input files of the compiler.


Full diff: https://github.com/llvm/llvm-project/pull/160946.diff

1 Files Affected:

  • (modified) clang/lib/Lex/HeaderSearch.cpp (+1-2)
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index f28a74f5d0ae5..ae09f70ee7896 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -672,9 +672,8 @@ OptionalFileEntryRef DirectoryLookup::DoFrameworkLookup(
     if (getDirCharacteristic() == SrcMgr::C_User) {
       SmallString<1024> SystemFrameworkMarker(FrameworkName);
       SystemFrameworkMarker += ".system_framework";
-      if (llvm::sys::fs::exists(SystemFrameworkMarker)) {
+      if (FileMgr.getOptionalFileRef(SystemFrameworkMarker))
         CacheEntry.IsUserSpecifiedSystemFramework = true;
-      }
     }
   }
 

@jansvoboda11 jansvoboda11 merged commit 1aefabe into llvm:main Sep 26, 2025
12 checks passed
@jansvoboda11 jansvoboda11 deleted the system-framework-marker-vfs branch September 26, 2025 21:53
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Oct 3, 2025
This PR uses the VFS/`FileManager` to check the system framework marker
instead of going straight to the real file system. This matches the
behavior of other input files of the compiler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants