[clang] bf9b3a5 - [clang] Load `-fms-secure-hotpatch-functions-file=` through the VFS (#160146)

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 22 10:06:56 PDT 2025


Author: Jan Svoboda
Date: 2025-09-22T10:06:52-07:00
New Revision: bf9b3a51e4e8a393308bb0e4229e9eee92dc5811

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

LOG: [clang] Load `-fms-secure-hotpatch-functions-file=` through the VFS (#160146)

This PR uses the correctly-configured VFS to load the file specified via
`-fms-secure-hotpatch-functions-file=`, matching other input files of
the compiler.

Added: 
    

Modified: 
    clang/lib/CodeGen/CodeGenModule.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d05092a250040..0eac7c351b164 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -528,8 +528,7 @@ CodeGenModule::CodeGenModule(ASTContext &C,
   if (!CGO.MSSecureHotPatchFunctionsFile.empty() ||
       !CGO.MSSecureHotPatchFunctionsList.empty()) {
     if (!CGO.MSSecureHotPatchFunctionsFile.empty()) {
-      auto BufOrErr =
-          llvm::MemoryBuffer::getFile(CGO.MSSecureHotPatchFunctionsFile);
+      auto BufOrErr = FS->getBufferForFile(CGO.MSSecureHotPatchFunctionsFile);
       if (BufOrErr) {
         const llvm::MemoryBuffer &FileBuffer = **BufOrErr;
         for (llvm::line_iterator I(FileBuffer.getMemBufferRef(), true), E;


        


More information about the cfe-commits mailing list