return OutputFileOpt;
}
+void llvm::dsymutil::exitDsymutil(int ExitStatus) {
+ exit(ExitStatus);
+}
+
int main(int argc, char **argv) {
llvm::sys::PrintStackTraceOnErrorSignal();
llvm::PrettyStackTraceProgram StackPrinter(argc, argv);
if (auto EC = DebugMapPtrOrErr.getError()) {
llvm::errs() << "error: cannot parse the debug map for \"" << InputFile
<< "\": " << EC.message() << '\n';
- return 1;
+ exitDsymutil(1);
}
if (Verbose || DumpDebugMap)
std::string OutputFile = getOutputFileName(InputFile);
if (!linkDwarf(OutputFile, **DebugMapPtrOrErr, Options))
- return 1;
+ exitDsymuti(1);
}
- return 0;
+ exitDsymutil(0);
}
/// \returns false if the link failed.
bool linkDwarf(StringRef OutputFilename, const DebugMap &DM,
const LinkOptions &Options);
+
+/// \brief Exit the dsymutil process, cleaning up every temporary
+/// files that we created.
+LLVM_ATTRIBUTE_NORETURN void exitDsymutil(int ExitStatus);
+
}
}
#endif // LLVM_TOOLS_DSYMUTIL_DSYMUTIL_H