25 static const char ConvSpecifiers[] =
"diouxXfFeEgGaAcspn";
31 Str = Str.drop_front(SpecPos + 1);
33 if (Str.consume_front(
"%"))
35 size_t SpecEnd = Str.find_first_of(ConvSpecifiers);
39 ArgIdx += Str.take_front(SpecEnd).count(
'*');
40 if (Str[SpecEnd] ==
's')
42 Str = Str.drop_front(SpecEnd + 1);
65 std::string Str(S.
str() +
'\0');
70 const uint64_t ReadSize = 4;
71 uint64_t ReadNow = std::min(ReadSize, Str.size() -
Offset.tell());
72 uint64_t ReadBytes = 0;
77 ReadBytes = Extractor.getU8(
Offset);
80 ReadBytes = Extractor.getU16(
Offset);
83 ReadBytes = Extractor.getU24(
Offset);
86 ReadBytes = Extractor.getU32(
Offset);
89 cantFail(
Offset.takeError(),
"failed to read bytes from constant array");
93 int Rem = (Str.size() % 8);
94 if (Rem > 0 && Rem <= 4)
Helpers for the AMDGPU printf runtime interface, shared by the lowerings of printf calls on the AMDGP...
LLVM_ABI void update(ArrayRef< uint8_t > Data)
Updates the hash for the byte stream provided.
LLVM_ABI void final(MD5Result &Result)
Finishes off the hash and puts the result in result.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void push_back(const T &Elt)
Represent a constant reference to a string, i.e.
static constexpr size_t npos
std::string str() const
Get the contents as an std::string.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
std::string utohexstr(uint64_t X, bool LowerCase=false, unsigned Width=0)
LLVM_ABI std::string getAMDGPUPrintfFormatMetadata(StringRef Fmt)
Returns the llvm.printf.fmts entry that maps the ID of the constant format string Fmt back to the str...
LLVM_ABI uint64_t getAMDGPUPrintfFormatHash(StringRef Fmt)
Returns the ID that buffered printf stores in place of the constant format string Fmt the low 64 bits...
LLVM_ABI void locateAMDGPUPrintfCStrings(SparseBitVector< 8 > &BV, StringRef Fmt)
Marks the printf arguments that the format string Fmt specifies as strings, i.e.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
LLVM_ABI void packAMDGPUPrintfConstantString(StringRef Str, SmallVectorImpl< uint32_t > &Words)
Splits the constant string argument Str, including its terminating NUL, into the little-endian 32-bit...