llvm-dwp: Move error handling code closer to use

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269864 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2016-05-17 23:37:44 +00:00
parent 51510adcfa
commit 34ab13fd25

View File

@ -54,12 +54,6 @@ static opt<std::string> OutputFilename(Required, "o",
value_desc("filename"),
cat(DwpCategory));
static int error(const Twine &Error, const Twine &Context) {
errs() << Twine("while processing ") + Context + ":\n";
errs() << Twine("error: ") + Error + "\n";
return 1;
}
static Error
writeStringsAndOffsets(MCStreamer &Out, StringMap<uint32_t> &Strings,
uint32_t &StringOffset, MCSection *StrSection,
@ -587,6 +581,12 @@ static Error write(MCStreamer &Out, ArrayRef<std::string> Inputs) {
return Error();
}
static int error(const Twine &Error, const Twine &Context) {
errs() << Twine("while processing ") + Context + ":\n";
errs() << Twine("error: ") + Error + "\n";
return 1;
}
int main(int argc, char **argv) {
ParseCommandLineOptions(argc, argv, "merge split dwarf (.dwo) files");