[clang] [clang] Load `-fms-secure-hotpatch-functions-file=` through the VFS (PR #160146)
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 22 09:39:16 PDT 2025
https://github.com/jansvoboda11 created https://github.com/llvm/llvm-project/pull/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.
>From 46cb594a30ec768a230109da4656259ffe4d85c6 Mon Sep 17 00:00:00 2001
From: Jan Svoboda <jan_svoboda at apple.com>
Date: Fri, 19 Sep 2025 14:19:28 -0700
Subject: [PATCH] [clang] Load `-fms-secure-hotpatch-functions-file=` through
the VFS
---
clang/lib/CodeGen/CodeGenModule.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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