From 1775d50ba02dab033c639f5c8fedd46cb6613bef Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Wed, 12 Aug 2026 04:21:14 +0800 Subject: [Tooling] Adopt LLVM MIR command-line spellings --- backend/lib/Tooling/BackendDriver.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'backend/lib/Tooling/BackendDriver.cpp') diff --git a/backend/lib/Tooling/BackendDriver.cpp b/backend/lib/Tooling/BackendDriver.cpp index 2a2a500..fff58c5 100644 --- a/backend/lib/Tooling/BackendDriver.cpp +++ b/backend/lib/Tooling/BackendDriver.cpp @@ -49,9 +49,10 @@ namespace { [[nodiscard]] Expected> printMIR(const mir::MIRDocument &Document, const TargetDescription &Target, - const BackendInvocation &Invocation) { + const BackendInvocation &Invocation, + bool Simplify) { mir::MIRDocumentPrinterOptions Options; - Options.Mode = mir::MIPrintMode::Complete; + Options.Mode = Simplify ? mir::MIPrintMode::Readable : mir::MIPrintMode::Complete; Options.EmitEmbeddedIR = true; Options.DataLayout = Invocation.DataLayout; auto Printed = mir::printMIRDocument(Document, Target, std::move(Options)); @@ -103,6 +104,8 @@ Expected runBackend(CanonicalMIR Input, const TargetDescriptio Controls.StopAtStage = RequiredStage; } + const bool SimplifyMIR = Controls.SimplifyMIR; + MachinePassInstrumentation LocalInstrumentation; MachinePassInstrumentation *ActiveInstrumentation = Instrumentation == nullptr ? &LocalInstrumentation : Instrumentation; @@ -113,7 +116,7 @@ Expected runBackend(CanonicalMIR Input, const TargetDescriptio std::vector Bytes; if (isMIR(Output)) { - auto Printed = printMIR(Input.Document, Target, Invocation); + auto Printed = printMIR(Input.Document, Target, Invocation, SimplifyMIR); if (!Printed) return std::unexpected(Printed.error()); Bytes = std::move(*Printed); -- cgit v1.2.3