diff options
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; |