22 assert(!Str.empty() &&
"Invalid string length");
25 unsigned NumBits = ((Str.size() * 64) / 19) + 2;
26 APInt Tmp(NumBits, Str, 10);
29 if (MinBits < NumBits)
30 Tmp = Tmp.
trunc(std::max<unsigned>(1, MinBits));
31 *
this =
APSInt(Tmp,
false);
35 if (ActiveBits < NumBits)
36 Tmp = Tmp.
trunc(std::max<unsigned>(1, ActiveBits));
41 ID.AddInteger((
unsigned) (IsUnsigned ? 1 : 0));
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file implements the APSInt class, which is a simple class that represents an arbitrary sized int...
This file defines a hash set that can be used to remove duplication of nodes in a graph.
unsigned getActiveBits() const
Compute the number of active bits in the value.
LLVM_ABI APInt trunc(unsigned width) const
Truncate to new width.
APInt(unsigned numBits, uint64_t val, bool isSigned=false, bool implicitTrunc=false)
Create a new APInt of numBits width, initialized as val.
unsigned getSignificantBits() const
Get the minimum bit size for this signed APInt.
LLVM_ABI void Profile(FoldingSetNodeID &id) const
Used to insert APInt objects, or objects that contain APInt objects, into FoldingSets.
LLVM_ABI void Profile(FoldingSetNodeID &ID) const
Used to insert APSInt objects, or objects that contain APSInt objects, into FoldingSets.
APSInt()=default
Default constructor that creates an uninitialized APInt.
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.