Skip to content

Commit 064e249

Browse files
committed
[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) { ^
1 parent 8894fe7 commit 064e249

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/tools/llvm-readobj/ELFDumper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7172,14 +7172,14 @@ void LLVMELFDumper<ELFT>::printHashHistogramStats(size_t NBucket,
71727172
StringRef BucketName = IsGnu ? "Bucket" : "Chain";
71737173
StringRef ListName = IsGnu ? "Buckets" : "Chains";
71747174
DictScope Outer(W, HistName);
7175-
W.printNumber("TotalBuckets", NBucket);
7175+
W.printNumber("TotalBuckets", static_cast<uint64_t>(NBucket));
71767176
ListScope Buckets(W, ListName);
71777177
size_t CumulativeNonZero = 0;
71787178
for (size_t I = 0; I < MaxChain; ++I) {
71797179
CumulativeNonZero += Count[I] * I;
71807180
DictScope Bucket(W, BucketName);
7181-
W.printNumber("Length", I);
7182-
W.printNumber("Count", Count[I]);
7181+
W.printNumber("Length", static_cast<uint64_t>(I));
7182+
W.printNumber("Count", static_cast<uint64_t>(Count[I]));
71837183
W.printNumber("Percentage", (float)(Count[I] * 100.0) / NBucket);
71847184
W.printNumber("Coverage", (float)(CumulativeNonZero * 100.0) / TotalSyms);
71857185
}

0 commit comments

Comments
 (0)