aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorZhaoQi <zhaoqi01@loongson.cn>2025-09-26 10:45:29 +0800
committerGitHub <noreply@github.com>2025-09-26 10:45:29 +0800
commit4321d4fe8039a745796726dfe145e5e699b928b3 (patch)
tree589d406b275c99425ea9c7ee22776e9920d7de4f /clang/lib/CodeGen/BackendUtil.cpp
parentd516d07c268f260e245690f89ab0f3e727389cb5 (diff)
parentef876268b97d664a90dc0d9a044f518557270e3d (diff)
downloadllvm-users/zhaoqi5/override-isxxxcheap-hooks.zip
llvm-users/zhaoqi5/override-isxxxcheap-hooks.tar.gz
llvm-users/zhaoqi5/override-isxxxcheap-hooks.tar.bz2
Merge branch 'users/zhaoqi5/test-isxxxcheap' into users/zhaoqi5/override-isxxxcheap-hooksusers/zhaoqi5/override-isxxxcheap-hooks
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 106363fa..3f38741 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -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();
@@ -785,7 +786,8 @@ static void addSanitizers(const Triple &TargetTriple,
HWASanPass(SanitizerKind::KernelHWAddress, true);
if (LangOpts.Sanitize.has(SanitizerKind::DataFlow)) {
- MPM.addPass(DataFlowSanitizerPass(LangOpts.NoSanitizeFiles));
+ MPM.addPass(DataFlowSanitizerPass(LangOpts.NoSanitizeFiles,
+ PB.getVirtualFileSystemPtr()));
}
};
if (ClSanitizeOnOptimizerEarlyEP) {
@@ -837,9 +839,9 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
if (CodeGenOpts.hasProfileIRInstr())
// -fprofile-generate.
PGOOpt = PGOOptions(getProfileGenName(CodeGenOpts), "", "",
- CodeGenOpts.MemoryProfileUsePath, nullptr,
- PGOOptions::IRInstr, PGOOptions::NoCSAction,
- ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling,
+ CodeGenOpts.MemoryProfileUsePath, PGOOptions::IRInstr,
+ PGOOptions::NoCSAction, ClPGOColdFuncAttr,
+ CodeGenOpts.DebugInfoForProfiling,
/*PseudoProbeForProfiling=*/false,
CodeGenOpts.AtomicProfileUpdate);
else if (CodeGenOpts.hasProfileIRUse()) {
@@ -848,32 +850,30 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
: PGOOptions::NoCSAction;
PGOOpt = PGOOptions(CodeGenOpts.ProfileInstrumentUsePath, "",
CodeGenOpts.ProfileRemappingFile,
- CodeGenOpts.MemoryProfileUsePath, VFS,
- PGOOptions::IRUse, CSAction, ClPGOColdFuncAttr,
+ CodeGenOpts.MemoryProfileUsePath, PGOOptions::IRUse,
+ CSAction, ClPGOColdFuncAttr,
CodeGenOpts.DebugInfoForProfiling);
} else if (!CodeGenOpts.SampleProfileFile.empty())
// -fprofile-sample-use
PGOOpt = PGOOptions(
CodeGenOpts.SampleProfileFile, "", CodeGenOpts.ProfileRemappingFile,
- CodeGenOpts.MemoryProfileUsePath, VFS, PGOOptions::SampleUse,
+ CodeGenOpts.MemoryProfileUsePath, PGOOptions::SampleUse,
PGOOptions::NoCSAction, ClPGOColdFuncAttr,
CodeGenOpts.DebugInfoForProfiling, CodeGenOpts.PseudoProbeForProfiling);
else if (!CodeGenOpts.MemoryProfileUsePath.empty())
// -fmemory-profile-use (without any of the above options)
- PGOOpt = PGOOptions("", "", "", CodeGenOpts.MemoryProfileUsePath, VFS,
+ PGOOpt = PGOOptions("", "", "", CodeGenOpts.MemoryProfileUsePath,
PGOOptions::NoAction, PGOOptions::NoCSAction,
ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling);
else if (CodeGenOpts.PseudoProbeForProfiling)
// -fpseudo-probe-for-profiling
- PGOOpt =
- PGOOptions("", "", "", /*MemoryProfile=*/"", nullptr,
- PGOOptions::NoAction, PGOOptions::NoCSAction,
- ClPGOColdFuncAttr, CodeGenOpts.DebugInfoForProfiling, true);
+ PGOOpt = PGOOptions("", "", "", /*MemoryProfile=*/"", PGOOptions::NoAction,
+ PGOOptions::NoCSAction, ClPGOColdFuncAttr,
+ CodeGenOpts.DebugInfoForProfiling, true);
else if (CodeGenOpts.DebugInfoForProfiling)
// -fdebug-info-for-profiling
- PGOOpt = PGOOptions("", "", "", /*MemoryProfile=*/"", nullptr,
- PGOOptions::NoAction, PGOOptions::NoCSAction,
- ClPGOColdFuncAttr, true);
+ PGOOpt = PGOOptions("", "", "", /*MemoryProfile=*/"", PGOOptions::NoAction,
+ PGOOptions::NoCSAction, ClPGOColdFuncAttr, true);
// Check to see if we want to generate a CS profile.
if (CodeGenOpts.hasProfileCSIRInstr()) {
@@ -889,7 +889,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
PGOOpt->CSAction = PGOOptions::CSIRInstr;
} else
PGOOpt = PGOOptions("", getProfileGenName(CodeGenOpts), "",
- /*MemoryProfile=*/"", nullptr, PGOOptions::NoAction,
+ /*MemoryProfile=*/"", PGOOptions::NoAction,
PGOOptions::CSIRInstr, ClPGOColdFuncAttr,
CodeGenOpts.DebugInfoForProfiling);
}
@@ -926,7 +926,7 @@ void EmitAssemblyHelper::RunOptimizationPipeline(
(CodeGenOpts.DebugPassManager || DebugPassStructure),
CodeGenOpts.VerifyEach, PrintPassOpts);
SI.registerCallbacks(PIC, &MAM);
- PassBuilder PB(TM.get(), PTO, PGOOpt, &PIC);
+ PassBuilder PB(TM.get(), PTO, PGOOpt, &PIC, CI.getVirtualFileSystemPtr());
// Handle the assignment tracking feature options.
switch (CodeGenOpts.getAssignmentTrackingMode()) {