[clang] 34ebdaf - [clang][analyzer] Use the VFS to check model files (#160950)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 26 14:53:49 PDT 2025


Author: Jan Svoboda
Date: 2025-09-26T14:53:46-07:00
New Revision: 34ebdaf73287e4f0fd9e897d01060071dbc42e99

URL: https://github.com/llvm/llvm-project/commit/34ebdaf73287e4f0fd9e897d01060071dbc42e99
DIFF: https://github.com/llvm/llvm-project/commit/34ebdaf73287e4f0fd9e897d01060071dbc42e99.diff

LOG: [clang][analyzer] Use the VFS to check model files (#160950)

This PR uses the VFS to check `.model` files in the Clang static
analyzer to match the compiler's behavior for other input files.

Added: 
    

Modified: 
    clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp b/clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp
index be74ff2cd4799..5301f88057203 100644
--- a/clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp
+++ b/clang/lib/StaticAnalyzer/Frontend/ModelInjector.cpp
@@ -65,7 +65,7 @@ void ModelInjector::onBodySynthesis(const NamedDecl *D) {
   else
     fileName = llvm::StringRef(D->getName().str() + ".model");
 
-  if (!llvm::sys::fs::exists(fileName.str())) {
+  if (!CI.getVirtualFileSystem().exists(fileName)) {
     Bodies[D->getName()] = nullptr;
     return;
   }


        


More information about the cfe-commits mailing list