From 344a3780b2e33f6ca763666c380202b18aab72a3 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Thu, 29 Jul 2021 22:15:26 +0200 Subject: Vendor import of llvm-project main 88e66fa60ae5, the last commit before the upstream release/13.x branch was created. --- llvm/lib/Support/APInt.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'llvm/lib/Support/APInt.cpp') diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp index 12ceb2df112e..a8a950f09747 100644 --- a/llvm/lib/Support/APInt.cpp +++ b/llvm/lib/Support/APInt.cpp @@ -550,6 +550,10 @@ hash_code llvm::hash_value(const APInt &Arg) { hash_combine_range(Arg.U.pVal, Arg.U.pVal + Arg.getNumWords())); } +unsigned DenseMapInfo::getHashValue(const APInt &Key) { + return static_cast(hash_value(Key)); +} + bool APInt::isSplat(unsigned SplatSizeInBits) const { assert(getBitWidth() % SplatSizeInBits == 0 && "SplatSizeInBits must divide width!"); @@ -2277,14 +2281,6 @@ void APInt::toString(SmallVectorImpl &Str, unsigned Radix, std::reverse(Str.begin()+StartDig, Str.end()); } -/// Returns the APInt as a std::string. Note that this is an inefficient method. -/// It is better to pass in a SmallVector/SmallString to the methods above. -std::string APInt::toString(unsigned Radix = 10, bool Signed = true) const { - SmallString<40> S; - toString(S, Radix, Signed, /* formatAsCLiteral = */false); - return std::string(S.str()); -} - #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) LLVM_DUMP_METHOD void APInt::dump() const { SmallString<40> S, U; -- cgit v1.2.3