[llvm-readobj] Fix ambiguous call of printNumber in ELFDumper.cpp (NFC)

/Users/jiefu/llvm-project/llvm/tools/llvm-readobj/ELFDumper.cpp:7175:5: error: call to member function 'printNumber' is ambiguous
  W.printNumber("TotalBuckets", NBucket);
  ~~^~~~~~~~~~~
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:201:16: note: candidate function
  virtual void printNumber(StringRef Label, uint64_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:205:16: note: candidate function
  virtual void printNumber(StringRef Label, uint32_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:209:16: note: candidate function
  virtual void printNumber(StringRef Label, uint16_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:213:16: note: candidate function
  virtual void printNumber(StringRef Label, uint8_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:217:16: note: candidate function
  virtual void printNumber(StringRef Label, int64_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:221:16: note: candidate function
  virtual void printNumber(StringRef Label, int32_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:225:16: note: candidate function
  virtual void printNumber(StringRef Label, int16_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:229:16: note: candidate function
  virtual void printNumber(StringRef Label, int8_t Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:237:16: note: candidate function
  virtual void printNumber(StringRef Label, float Value) {
               ^
/Users/jiefu/llvm-project/llvm/include/llvm/Support/ScopedPrinter.h:241:16: note: candidate function
  virtual void printNumber(StringRef Label, double Value) {
               ^
This commit is contained in:
Jie Fu 2023-03-21 10:33:48 +08:00
parent 8894fe7a6f
commit 064e2497e2

View File

@ -7172,14 +7172,14 @@ void LLVMELFDumper<ELFT>::printHashHistogramStats(size_t NBucket,
StringRef BucketName = IsGnu ? "Bucket" : "Chain";
StringRef ListName = IsGnu ? "Buckets" : "Chains";
DictScope Outer(W, HistName);
W.printNumber("TotalBuckets", NBucket);
W.printNumber("TotalBuckets", static_cast<uint64_t>(NBucket));
ListScope Buckets(W, ListName);
size_t CumulativeNonZero = 0;
for (size_t I = 0; I < MaxChain; ++I) {
CumulativeNonZero += Count[I] * I;
DictScope Bucket(W, BucketName);
W.printNumber("Length", I);
W.printNumber("Count", Count[I]);
W.printNumber("Length", static_cast<uint64_t>(I));
W.printNumber("Count", static_cast<uint64_t>(Count[I]));
W.printNumber("Percentage", (float)(Count[I] * 100.0) / NBucket);
W.printNumber("Coverage", (float)(CumulativeNonZero * 100.0) / TotalSyms);
}