#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PrettyStackTrace.h"
-#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Signals.h"
+#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/system_error.h"
#include <algorithm>
#include <string>
/// @brief Get the length of the string that represents @p num in Radix
/// including the leading 0x or 0 for hexadecimal and octal respectively.
-static unsigned int getNumLengthAsString(uint64_t num) {
+static size_t getNumLengthAsString(uint64_t num) {
APInt conv(64, num);
SmallString<32> result;
conv.toString(result, Radix, false, true);
const char *radix_fmt = 0;
switch (Radix) {
case octal:
- radix_fmt = "llo";
+ radix_fmt = PRIo64;
break;
case decimal:
- radix_fmt = "llu";
+ radix_fmt = PRIu64;
break;
case hexadecimal:
- radix_fmt = "llx";
+ radix_fmt = PRIx64;
break;
}
if (OutputFormat == sysv) {
std::size_t max_size_len = strlen("size");
std::size_t max_addr_len = strlen("addr");
error_code ec;
- for (ObjectFile::section_iterator i = o->begin_sections(),
- e = o->end_sections(); i != e;
- i.increment(ec)) {
+ for (section_iterator i = o->begin_sections(),
+ e = o->end_sections(); i != e;
+ i.increment(ec)) {
if (error(ec))
return;
uint64_t size = 0;
<< "%#" << max_addr_len << radix_fmt << "\n";
// Print each section.
- for (ObjectFile::section_iterator i = o->begin_sections(),
- e = o->end_sections(); i != e;
- i.increment(ec)) {
+ for (section_iterator i = o->begin_sections(),
+ e = o->end_sections(); i != e;
+ i.increment(ec)) {
if (error(ec))
return;
// Make one pass over the section table to calculate sizes.
error_code ec;
- for (ObjectFile::section_iterator i = o->begin_sections(),
- e = o->end_sections(); i != e;
- i.increment(ec)) {
+ for (section_iterator i = o->begin_sections(),
+ e = o->end_sections(); i != e;
+ i.increment(ec)) {
if (error(ec))
return;
total_data,
total_bss);
fmtbuf.clear();
- fmt << "%7" << (Radix == octal ? "llo" : "llu") << " "
- << "%7llx ";
+ fmt << "%7" << (Radix == octal ? PRIo64 : PRIu64) << " "
+ << "%7" PRIx64 " ";
outs() << format(fmt.str().c_str(),
total,
total);