diff options
Diffstat (limited to 'backend/tools/DescriptionGenerator')
| -rw-r--r-- | backend/tools/DescriptionGenerator/DescriptionGeneratorMain.cpp | 11 |
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; } |
