26 BlockScope.
back().PrevAbbrevs.swap(CurAbbrevs);
32 CurAbbrevs.insert(CurAbbrevs.end(),
Info->Abbrevs.begin(),
45 if (NumWordsP) *NumWordsP = NumWords;
101 for (
unsigned i = 0; i != NumElts; ++i)
134 assert(i+2 == e &&
"array op not second to last?");
148 for (; NumElts; --NumElts)
185 for (
unsigned i = 0; i != NumElts; ++i)
196 if (CodeOp.isLiteral())
197 Code = CodeOp.getLiteralValue();
228 "Array element type has to be an encoding of a type");
235 for (; NumElts; --NumElts)
239 for (; NumElts; --NumElts)
243 for (; NumElts; --NumElts)
256 size_t NewEnd = CurBitPos+((NumElts+3)&~3)*8;
277 for (; NumElts; --NumElts)
286 auto Abbv = std::make_shared<BitCodeAbbrev>();
287 unsigned NumOpInfo =
ReadVBR(5);
288 for (
unsigned i = 0; i != NumOpInfo; ++i) {
289 bool IsLiteral =
Read(1);
311 "Fixed or VBR abbrev record with size > MaxChunkData");
318 if (Abbv->getNumOperandInfos() == 0)
320 CurAbbrevs.push_back(std::move(Abbv));
336 switch (Entry.
Kind) {
341 return std::move(NewBlockInfo);
349 if (!CurBlockInfo)
return None;
354 CurBlockInfo->
Abbrevs.push_back(std::move(CurAbbrevs.back()));
355 CurAbbrevs.pop_back();
368 if (!CurBlockInfo)
return None;
369 if (!ReadBlockInfoNames)
372 for (
unsigned i = 0, e = Record.size(); i != e; ++i)
373 Name += (
char)Record[i];
378 if (!CurBlockInfo)
return None;
379 if (!ReadBlockInfoNames)
382 for (
unsigned i = 1, e = Record.size(); i != e; ++i)
383 Name += (
char)Record[i];
384 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.
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
amdgpu Simplify well known AMD library false Value Value const Twine & Name
uint64_t ReadVBR64(unsigned NumBits)
void skipToEnd()
Skip to the end of the file.
uint32_t ReadVBR(unsigned NumBits)
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()
enum llvm::BitstreamEntry::@149 Kind
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.
If this flag is used, abbrev entries are returned just like normal records.
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.