diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2021-07-29 20:15:26 +0000 |
commit | 344a3780b2e33f6ca763666c380202b18aab72a3 (patch) | |
tree | f0b203ee6eb71d7fdd792373e3c81eb18d6934dd /llvm/lib/Support/APInt.cpp | |
parent | b60736ec1405bb0a8dd40989f67ef4c93da068ab (diff) |
vendor/llvm-project/llvmorg-13-init-16847-g88e66fa60ae5vendor/llvm-project/llvmorg-12.0.1-rc2-0-ge7dac564cd0evendor/llvm-project/llvmorg-12.0.1-0-gfed41342a82f
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r-- | llvm/lib/Support/APInt.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
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<APInt>::getHashValue(const APInt &Key) { + return static_cast<unsigned>(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<char> &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; |