Skip to content

Commit 078a4e9

Browse files
authored
[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.
1 parent 70eb6cc commit 078a4e9

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
@@ -437,7 +437,8 @@ static bool initTargetOptions(const CompilerInstance &CI,
437437

438438
if (Options.BBSections == llvm::BasicBlockSection::List) {
439439
ErrorOr<std::unique_ptr<MemoryBuffer>> MBOrErr =
440-
MemoryBuffer::getFile(CodeGenOpts.BBSections.substr(5));
440+
CI.getVirtualFileSystem().getBufferForFile(
441+
CodeGenOpts.BBSections.substr(5));
441442
if (!MBOrErr) {
442443
Diags.Report(diag::err_fe_unable_to_load_basic_block_sections_file)
443444
<< MBOrErr.getError().message();

0 commit comments

Comments
 (0)