21 assert(!Str.
empty() &&
"Invalid string length");
24 unsigned NumBits = ((Str.
size() * 64) / 19) + 2;
25 APInt Tmp(NumBits, Str, 10);
28 if (MinBits > 0 && MinBits < NumBits)
29 Tmp = Tmp.
trunc(MinBits);
30 *
this =
APSInt(Tmp,
false);
34 if (ActiveBits > 0 && ActiveBits < NumBits)
35 Tmp = Tmp.
trunc(ActiveBits);
40 ID.
AddInteger((
unsigned) (IsUnsigned ? 1 : 0));
size_t size() const
size - Get the string size.
APSInt()
Default constructor that creates an uninitialized APInt.
void AddInteger(signed I)
unsigned getActiveBits() const
Compute the number of active bits in the value.
unsigned getMinSignedBits() const
Get the minimum bit size for this signed APInt.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
APInt LLVM_ATTRIBUTE_UNUSED_RESULT trunc(unsigned width) const
Truncate to new width.
void Profile(FoldingSetNodeID &ID) const
Profile - Used to insert APSInt objects, or objects that contain APSInt objects, into FoldingSets...
Class for arbitrary precision integers.
void Profile(FoldingSetNodeID &id) const
Used to insert APInt objects, or objects that contain APInt objects, into FoldingSets.
StringRef - Represent a constant reference to a string, i.e.
bool empty() const
empty - Check if the string is empty.