25 BlockScope.
back().PrevAbbrevs.swap(CurAbbrevs);
31 CurAbbrevs.insert(CurAbbrevs.end(),
Info->Abbrevs.begin(),
44 if (NumWordsP) *NumWordsP = NumWords;
100 for (
unsigned i = 0; i != NumElts; ++i)
133 assert(i+2 == e &&
"array op not second to last?");
147 for (; NumElts; --NumElts)
184 for (
unsigned i = 0; i != NumElts; ++i)
195 if (CodeOp.isLiteral())
196 Code = CodeOp.getLiteralValue();
227 "Array element type has to be an encoding of a type");
234 for (; NumElts; --NumElts)
238 for (; NumElts; --NumElts)
242 for (; NumElts; --NumElts)
255 size_t NewEnd = CurBitPos+((NumElts+3)&~3)*8;
276 for (; NumElts; --NumElts)
285 auto Abbv = std::make_shared<BitCodeAbbrev>();
286 unsigned NumOpInfo =
ReadVBR(5);
287 for (
unsigned i = 0; i != NumOpInfo; ++i) {
288 bool IsLiteral =
Read(1);
310 "Fixed or VBR abbrev record with size > MaxChunkData");
317 if (Abbv->getNumOperandInfos() == 0)
319 CurAbbrevs.push_back(std::move(Abbv));
335 switch (Entry.
Kind) {
340 return std::move(NewBlockInfo);
348 if (!CurBlockInfo)
return None;
353 CurBlockInfo->
Abbrevs.push_back(std::move(CurAbbrevs.back()));
354 CurAbbrevs.pop_back();
367 if (!CurBlockInfo)
return None;
368 if (!ReadBlockInfoNames)
371 for (
unsigned i = 0, e = Record.size(); i != e; ++i)
372 Name += (
char)Record[i];
377 if (!CurBlockInfo)
return None;
378 if (!ReadBlockInfoNames)
381 for (
unsigned i = 1, e = Record.size(); i != e; ++i)
382 Name += (
char)Record[i];
383 CurBlockInfo->
RecordNames.push_back(std::make_pair((
unsigned)Record[0],
Encoding getEncoding() const
This contains information emitted to BLOCKINFO_BLOCK blocks.
const BitCodeAbbrev * getAbbrev(unsigned AbbrevID)
Return the abbreviation for the specified AbbrevId.
BLOCKINFO_BLOCK is used to define metadata about blocks, for example, standard abbrevs that should be...
BlockInfo & getOrCreateBlockInfo(unsigned BlockID)
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
uint64_t GetCurrentBitNo() const
Return the bit # of the bit we are reading.
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
void push_back(const T &Elt)
BitCodeAbbrev - This class represents an abbreviation record.
static const size_t MaxChunkSize
const uint8_t * getPointerToBit(uint64_t BitNo, uint64_t NumBytes)
Get a pointer into the bitstream at the specified bit offset.
std::vector< std::pair< unsigned, std::string > > RecordNames
word_t Read(unsigned NumBits)
uint64_t getLiteralValue() const
bool canSkipToPos(size_t pos) const
uint64_t ReadVBR64(unsigned NumBits)
void skipToEnd()
Skip to the end of the file.
uint32_t ReadVBR(unsigned NumBits)
enum llvm::BitstreamEntry::@154 Kind
const BitCodeAbbrevOp & getOperandInfo(unsigned N) const
BitstreamEntry advanceSkippingSubblocks(unsigned Flags=0)
This is a convenience function for clients that don't expect any subblocks.
Analysis containing CSE Info
void SkipToFourByteBoundary()
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This represents a position within a bitcode file, implemented on top of a SimpleBitstreamCursor.
BitCodeAbbrevOp - This describes one or more operands in an abbreviation.
static void skipAbbreviatedField(BitstreamCursor &Cursor, const BitCodeAbbrevOp &Op)
const BlockInfo * getBlockInfo(unsigned BlockID) const
If there is block info for the specified ID, return it, otherwise return null.
void JumpToBit(uint64_t BitNo)
Reset the stream to the specified bit number.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::vector< std::shared_ptr< BitCodeAbbrev > > Abbrevs
When advancing through a bitstream cursor, each advance can discover a few different kinds of entries...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
unsigned readRecord(unsigned AbbrevID, SmallVectorImpl< uint64_t > &Vals, StringRef *Blob=nullptr)
This class maintains the abbreviations read from a block info block.
DEFINE_ABBREV - Defines an abbrev for the current block.
static uint64_t readAbbreviatedField(BitstreamCursor &Cursor, const BitCodeAbbrevOp &Op)
unsigned skipRecord(unsigned AbbrevID)
Read the current record and discard it, returning the code for the record.
Optional< BitstreamBlockInfo > ReadBlockInfoBlock(bool ReadBlockInfoNames=false)
Read and return a block info block from the bitstream.
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
unsigned getNumOperandInfos() const
uint64_t getEncodingData() const
bool EnterSubBlock(unsigned BlockID, unsigned *NumWordsP=nullptr)
Having read the ENTER_SUBBLOCK abbrevid, enter the block, and return true if the block has an error...
static char DecodeChar6(unsigned V)
bool hasEncodingData() const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
StringRef - Represent a constant reference to a string, i.e.
If this flag is used, abbrev entries are returned just like normal records.