[clang] Load -fbasic-block-sections=list= through the VFS (#160785)

This PR loads the path from `-fbasic-block-sections=list=<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 commit is contained in:
Jan Svoboda 2025-09-25 15:25:08 -07:00 committed by GitHub
parent 70eb6cc662
commit 078a4e93da
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -437,7 +437,8 @@ static bool initTargetOptions(const CompilerInstance &CI,
if (Options.BBSections == llvm::BasicBlockSection::List) {
ErrorOr<std::unique_ptr<MemoryBuffer>> MBOrErr =
MemoryBuffer::getFile(CodeGenOpts.BBSections.substr(5));
CI.getVirtualFileSystem().getBufferForFile(
CodeGenOpts.BBSections.substr(5));
if (!MBOrErr) {
Diags.Report(diag::err_fe_unable_to_load_basic_block_sections_file)
<< MBOrErr.getError().message();