diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2013-04-08 08:39:59 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2013-04-08 08:39:59 +0000 |
commit | 724a7b145d480018ddae894ffdd848154cd5478f (patch) | |
tree | 5a0bf2def7831fb108125da32eae4eb6add1ca5e /tools/obj2yaml | |
parent | bcff69a1e0788377b8bec87f850a6f5977fe9d22 (diff) | |
download | llvm-724a7b145d480018ddae894ffdd848154cd5478f.tar.gz llvm-724a7b145d480018ddae894ffdd848154cd5478f.tar.bz2 llvm-724a7b145d480018ddae894ffdd848154cd5478f.tar.xz |
Cleanup the formatting of obj2yaml.cpp.
I couldn't touch this file and not clean it up some. These reformattings
brought to you by clang-format, with some minor adjustments by me. More
spring cleaning to follow here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/obj2yaml')
-rw-r--r-- | tools/obj2yaml/obj2yaml.cpp | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/tools/obj2yaml/obj2yaml.cpp b/tools/obj2yaml/obj2yaml.cpp index 68701dea56..615ff863b1 100644 --- a/tools/obj2yaml/obj2yaml.cpp +++ b/tools/obj2yaml/obj2yaml.cpp @@ -21,9 +21,9 @@ namespace yaml { // generic yaml-writing specific routines unsigned char printable(unsigned char Ch) { return Ch >= ' ' && Ch <= '~' ? Ch : '.'; } - -llvm::raw_ostream &writeHexStream(llvm::raw_ostream &Out, - const llvm::ArrayRef<uint8_t> arr) { + +llvm::raw_ostream &writeHexStream(llvm::raw_ostream &Out, + const llvm::ArrayRef<uint8_t> arr) { const char *hex = "0123456789ABCDEF"; Out << " !hex \""; @@ -38,9 +38,10 @@ llvm::raw_ostream &writeHexStream(llvm::raw_ostream &Out, Out << "|\n"; return Out; - } +} -llvm::raw_ostream &writeHexNumber(llvm::raw_ostream &Out, unsigned long long N) { +llvm::raw_ostream &writeHexNumber(llvm::raw_ostream &Out, + unsigned long long N) { if (N >= 10) Out << "0x"; Out.write_hex(N); @@ -49,32 +50,32 @@ llvm::raw_ostream &writeHexNumber(llvm::raw_ostream &Out, unsigned long long N) } - using namespace llvm; -enum ObjectFileType { coff }; +enum ObjectFileType { + coff +}; cl::opt<ObjectFileType> InputFormat( - cl::desc("Choose input format"), - cl::values( - clEnumVal(coff, "process COFF object files"), - clEnumValEnd)); - -cl::opt<std::string> InputFilename(cl::Positional, cl::desc("<input file>"), cl::init("-")); - -int main(int argc, char * argv[]) { + cl::desc("Choose input format"), + cl::values(clEnumVal(coff, "process COFF object files"), clEnumValEnd)); + +cl::opt<std::string> InputFilename(cl::Positional, cl::desc("<input file>"), + cl::init("-")); + +int main(int argc, char *argv[]) { cl::ParseCommandLineOptions(argc, argv); sys::PrintStackTraceOnErrorSignal(); PrettyStackTraceProgram X(argc, argv); - llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. + llvm_shutdown_obj Y; // Call llvm_shutdown() on exit. -// Process the input file + // Process the input file OwningPtr<MemoryBuffer> buf; -// TODO: If this is an archive, then burst it and dump each entry - if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, buf)) - llvm::errs() << "Error: '" << ec.message() << "' opening file '" - << InputFilename << "'\n"; - else { + // TODO: If this is an archive, then burst it and dump each entry + if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, buf)) { + llvm::errs() << "Error: '" << ec.message() << "' opening file '" + << InputFilename << "'\n"; + } else { ec = coff2yaml(llvm::outs(), buf.take()); if (ec) llvm::errs() << "Error: " << ec.message() << " dumping COFF file\n"; |