aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/Tooling
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-22 18:59:22 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-22 18:59:22 +0800
commit36b0be1ec1558f88d4f031a1817c3a4c2cba07a6 (patch)
tree3cf29b19ec7e450bd04dca8d416d68350aa20de2 /backend/lib/Tooling
parent8a4bb6e3b0bffa0ed79b51347b12ee4293b622a7 (diff)
downloadrcc-project-36b0be1ec1558f88d4f031a1817c3a4c2cba07a6.tar.gz
rcc-project-36b0be1ec1558f88d4f031a1817c3a4c2cba07a6.tar.xz
[CodeGen] Match LLVM machine debug stripping
Diffstat (limited to 'backend/lib/Tooling')
-rw-r--r--backend/lib/Tooling/PipelineDriver.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/backend/lib/Tooling/PipelineDriver.cpp b/backend/lib/Tooling/PipelineDriver.cpp
index 0ba0c54..959ff4c 100644
--- a/backend/lib/Tooling/PipelineDriver.cpp
+++ b/backend/lib/Tooling/PipelineDriver.cpp
@@ -6,6 +6,7 @@
#include "rcc/CodeGen/MIRPrinter.h"
#include "rcc/CodeGen/MachineFunction.h"
#include "rcc/CodeGen/MachineOptimizationPipeline.h"
+#include "rcc/CodeGen/MachineStripDebug.h"
#include "rcc/CodeGen/MachineVerifier.h"
#include "rcc/Target/RISCV/RISCVPipeline.h"
@@ -322,6 +323,13 @@ runFunction(MachineFunction &Function, mir::MIRDocument &Document, const TargetD
auto Run = SinglePass.run(Function, Target, Analyses, Instrumentation);
if (!Run)
return std::unexpected(Run.error());
+ if (Controls.DebugifyAndStripAllSafe) {
+ auto Stripped = stripDebugMachineFunction(Function);
+ if (!Stripped)
+ return std::unexpected(Stripped.error());
+ if (*Stripped)
+ Analyses.invalidate(Function, PreservedAnalyses::none(), MachinePassChanges::all());
+ }
Result.ExecutedPasses.push_back({
.Function = std::string(Function.name()),
.Pass = Name,