Skip to content

Commit 288a403

Browse files
committed
[clang] Load -fbasic-block-sections=list= through the VFS (llvm#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.
1 parent 4895353 commit 288a403

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,8 @@ static bool initTargetOptions(const CompilerInstance &CI,
447447

448448
if (Options.BBSections == llvm::BasicBlockSection::List) {
449449
ErrorOr<std::unique_ptr<MemoryBuffer>> MBOrErr =
450-
MemoryBuffer::getFile(CodeGenOpts.BBSections.substr(5));
450+
CI.getVirtualFileSystem().getBufferForFile(
451+
CodeGenOpts.BBSections.substr(5));
451452
if (!MBOrErr) {
452453
Diags.Report(diag::err_fe_unable_to_load_basic_block_sections_file)
453454
<< MBOrErr.getError().message();

0 commit comments

Comments
 (0)