aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2025-09-26 10:35:22 -0700
committerGitHub <noreply@github.com>2025-09-26 10:35:22 -0700
commit37282bcee10dc20d0469d014e566f42377f0c22c (patch)
tree6ec8f2e46cf59adeb1dfd0787e66f3915b4a55c5 /clang/lib/CodeGen/BackendUtil.cpp
parentff98e516136a2e4c77934c52e6c7cef65a9fadee (diff)
downloadllvm-37282bcee10dc20d0469d014e566f42377f0c22c.zip
llvm-37282bcee10dc20d0469d014e566f42377f0c22c.tar.gz
llvm-37282bcee10dc20d0469d014e566f42377f0c22c.tar.bz2
[clang] Load `-fembed-offload-object=` through the VFS (#160906)
This PR loads the path from `-fembed-offload-object=<path>` through the VFS rather than going straight to the real file system. This matches the behavior of other input files of the compiler. This technically changes behavior in that `-fembed-offload-object=-` no longer loads the file from stdin, but I don't think that was the intention of the original code anyways.
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 3f38741..57db20f7 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -1476,13 +1476,13 @@ void clang::EmbedBitcode(llvm::Module *M, const CodeGenOptions &CGOpts,
}
void clang::EmbedObject(llvm::Module *M, const CodeGenOptions &CGOpts,
- DiagnosticsEngine &Diags) {
+ llvm::vfs::FileSystem &VFS, DiagnosticsEngine &Diags) {
if (CGOpts.OffloadObjects.empty())
return;
for (StringRef OffloadObject : CGOpts.OffloadObjects) {
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> ObjectOrErr =
- llvm::MemoryBuffer::getFileOrSTDIN(OffloadObject);
+ VFS.getBufferForFile(OffloadObject);
if (ObjectOrErr.getError()) {
auto DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,
"could not open '%0' for embedding");