From e5fdceb9b869f010a2a75638fd38aaf1867f3008 Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Sun, 9 Aug 2026 04:40:17 +0800 Subject: [CodeGen] Complete register allocation infrastructure --- .../tools/DescriptionGenerator/DescriptionGeneratorMain.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'backend/tools/DescriptionGenerator') diff --git a/backend/tools/DescriptionGenerator/DescriptionGeneratorMain.cpp b/backend/tools/DescriptionGenerator/DescriptionGeneratorMain.cpp index 80b4767..13927e1 100644 --- a/backend/tools/DescriptionGenerator/DescriptionGeneratorMain.cpp +++ b/backend/tools/DescriptionGenerator/DescriptionGeneratorMain.cpp @@ -97,9 +97,14 @@ int main(int ArgumentCount, char *Arguments[]) { return 1; } - return writeFile(Command.RegisterHeaderPath, Result.Output->RegisterHeader) && - writeFile(Command.InstructionHeaderPath, Result.Output->InstructionHeader) && - writeFile(Command.TablesPath, Result.Output->TargetTables) + if (!Result.Output) { + std::cerr << "rcc-backend-descgen: successful generation produced no output\n"; + return 1; + } + const rcc::targetgen::GeneratedDescription &Output = Result.Output.value(); + return writeFile(Command.RegisterHeaderPath, Output.RegisterHeader) && + writeFile(Command.InstructionHeaderPath, Output.InstructionHeader) && + writeFile(Command.TablesPath, Output.TargetTables) ? 0 : 1; } -- cgit v1.2.3