aboutsummaryrefslogtreecommitdiff
path: root/backend/tools/DescriptionGenerator
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-09 04:40:17 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-09 04:40:17 +0800
commite5fdceb9b869f010a2a75638fd38aaf1867f3008 (patch)
tree023d3e18960956f5ce369739c68aaa2a3e8400e7 /backend/tools/DescriptionGenerator
parent6c7cecc81a4c7e06e26027e21edd2cfd95a37a0b (diff)
downloadrcc-project-e5fdceb9b869f010a2a75638fd38aaf1867f3008.tar.gz
rcc-project-e5fdceb9b869f010a2a75638fd38aaf1867f3008.tar.xz
[CodeGen] Complete register allocation infrastructure
Diffstat (limited to 'backend/tools/DescriptionGenerator')
-rw-r--r--backend/tools/DescriptionGenerator/DescriptionGeneratorMain.cpp11
1 files changed, 8 insertions, 3 deletions
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;
}