From 82803112da19d29ee79bc25e7810a09af82c8347 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 10 Mar 2012 02:04:38 +0000 Subject: [PATCH] Fix uses of the C99 PRI format macros not to conflict with C++11 UDLs. llvm-svn: 152474 --- llvm/tools/llvm-nm/llvm-nm.cpp | 5 +++-- llvm/tools/llvm-objdump/llvm-objdump.cpp | 16 ++++++++-------- llvm/tools/llvm-readobj/llvm-readobj.cpp | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index 9cf83b63370a..8d9e51e56ebd 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -204,9 +204,10 @@ static void SortAndPrintSymbolList() { strcpy(SymbolSizeStr, " "); if (i->Address != object::UnknownAddressOrSize) - format("%08"PRIx64, i->Address).print(SymbolAddrStr, sizeof(SymbolAddrStr)); + format("%08" PRIx64, i->Address).print(SymbolAddrStr, + sizeof(SymbolAddrStr)); if (i->Size != object::UnknownAddressOrSize) - format("%08"PRIx64, i->Size).print(SymbolSizeStr, sizeof(SymbolSizeStr)); + format("%08" PRIx64, i->Size).print(SymbolSizeStr, sizeof(SymbolSizeStr)); if (OutputFormat == posix) { outs() << i->Name << " " << i->TypeChar << " " diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index deb4dd1fcbcf..94becaefc553 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -300,7 +300,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { if (DisAsm->getInstruction(Inst, Size, memoryObject, Index, DebugOut, nulls())) { - outs() << format("%8"PRIx64":\t", SectionAddr + Index); + outs() << format("%8" PRIx64 ":\t", SectionAddr + Index); DumpBytes(StringRef(Bytes.data() + Index, Size)); IP->printInst(&Inst, outs(), ""); outs() << "\n"; @@ -327,8 +327,8 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) { if (error(rel_cur->getTypeName(name))) goto skip_print_rel; if (error(rel_cur->getValueString(val))) goto skip_print_rel; - outs() << format("\t\t\t%8"PRIx64": ", SectionAddr + addr) << name << "\t" - << val << "\n"; + outs() << format("\t\t\t%8" PRIx64 ": ", SectionAddr + addr) << name + << "\t" << val << "\n"; skip_print_rel: ++rel_cur; @@ -388,8 +388,8 @@ static void PrintSectionHeaders(const ObjectFile *o) { if (error(si->isBSS(BSS))) return; std::string Type = (std::string(Text ? "TEXT " : "") + (Data ? "DATA " : "") + (BSS ? "BSS" : "")); - outs() << format("%3d %-13s %09"PRIx64" %017"PRIx64" %s\n", i, Name.str().c_str(), Size, - Address, Type.c_str()); + outs() << format("%3d %-13s %09" PRIx64 " %017" PRIx64 " %s\n", + i, Name.str().c_str(), Size, Address, Type.c_str()); ++i; } } @@ -411,7 +411,7 @@ static void PrintSectionContents(const ObjectFile *o) { // Dump out the content as hex and printable ascii characters. for (std::size_t addr = 0, end = Contents.size(); addr < end; addr += 16) { - outs() << format(" %04"PRIx64" ", BaseAddr + addr); + outs() << format(" %04" PRIx64 " ", BaseAddr + addr); // Dump line of hex. for (std::size_t i = 0; i < 16; ++i) { if (i != 0 && i % 4 == 0) @@ -519,7 +519,7 @@ static void PrintSymbolTable(const ObjectFile *o) { else if (Type == SymbolRef::ST_Function) FileFunc = 'F'; - outs() << format("%08"PRIx64, Address) << " " + outs() << format("%08" PRIx64, Address) << " " << GlobLoc // Local -> 'l', Global -> 'g', Neither -> ' ' << (Weak ? 'w' : ' ') // Weak? << ' ' // Constructor. Not supported yet. @@ -539,7 +539,7 @@ static void PrintSymbolTable(const ObjectFile *o) { outs() << SectionName; } outs() << '\t' - << format("%08"PRIx64" ", Size) + << format("%08" PRIx64 " ", Size) << Name << '\n'; } diff --git a/llvm/tools/llvm-readobj/llvm-readobj.cpp b/llvm/tools/llvm-readobj/llvm-readobj.cpp index 0c58fb3fb46c..3be12899aea7 100644 --- a/llvm/tools/llvm-readobj/llvm-readobj.cpp +++ b/llvm/tools/llvm-readobj/llvm-readobj.cpp @@ -109,9 +109,9 @@ void DumpSymbol(const SymbolRef &Sym, const ObjectFile *obj, bool IsDynamic) { // format() can't handle StringRefs outs() << format(" %-32s", FullName.c_str()) << format(" %-4s", GetTypeStr(Type)) - << format(" %16"PRIx64, Address) - << format(" %16"PRIx64, Size) - << format(" %16"PRIx64, FileOffset) + << format(" %16" PRIx64, Address) + << format(" %16" PRIx64, Size) + << format(" %16" PRIx64, FileOffset) << " " << GetFlagStr(Flags) << "\n"; }