summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-cvtres/llvm-cvtres.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-cvtres/llvm-cvtres.cpp')
-rw-r--r--llvm/tools/llvm-cvtres/llvm-cvtres.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/llvm/tools/llvm-cvtres/llvm-cvtres.cpp b/llvm/tools/llvm-cvtres/llvm-cvtres.cpp
index eaba02c16f3..1e463399a59 100644
--- a/llvm/tools/llvm-cvtres/llvm-cvtres.cpp
+++ b/llvm/tools/llvm-cvtres/llvm-cvtres.cpp
@@ -191,11 +191,23 @@ int main(int argc_, const char *argv_[]) {
error(Parser.parse(RF));
}
- if (Verbose)
- Parser.printTree();
+ if (Verbose) {
+ Parser.printTree(outs());
+ Parser.printTree(errs());
+ }
error(
llvm::object::writeWindowsResourceCOFF(OutputFile, MachineType, Parser));
+ if (Verbose) {
+ Expected<object::OwningBinary<object::Binary>> BinaryOrErr =
+ object::createBinary(OutputFile);
+ if (!BinaryOrErr)
+ reportError(OutputFile, errorToErrorCode(BinaryOrErr.takeError()));
+ Binary &Binary = *BinaryOrErr.get().getBinary();
+ ScopedPrinter W(errs());
+ W.printBinaryBlock("Output File Raw Data", Binary.getData());
+ }
+
return 0;
}
OpenPOWER on IntegriCloud