MCPcopy Create free account
hub / github.com/GANGE666/xVMP / getEnableSplitLTOUnitFlag

Function getEnableSplitLTOUnitFlag

src/lib/Bitcode/Reader/BitcodeReader.cpp:5932–5970  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5930}
5931
5932static Expected<bool> getEnableSplitLTOUnitFlag(BitstreamCursor &Stream,
5933 unsigned ID) {
5934 if (Stream.EnterSubBlock(ID))
5935 return error("Invalid record");
5936 SmallVector<uint64_t, 64> Record;
5937
5938 while (true) {
5939 BitstreamEntry Entry = Stream.advanceSkippingSubblocks();
5940
5941 switch (Entry.Kind) {
5942 case BitstreamEntry::SubBlock: // Handled for us already.
5943 case BitstreamEntry::Error:
5944 return error("Malformed block");
5945 case BitstreamEntry::EndBlock:
5946 // If no flags record found, conservatively return true to mimic
5947 // behavior before this flag was added.
5948 return true;
5949 case BitstreamEntry::Record:
5950 // The interesting case.
5951 break;
5952 }
5953
5954 // Look for the FS_FLAGS record.
5955 Record.clear();
5956 auto BitCode = Stream.readRecord(Entry.ID, Record);
5957 switch (BitCode) {
5958 default: // Default behavior: ignore.
5959 break;
5960 case bitc::FS_FLAGS: { // [flags]
5961 uint64_t Flags = Record[0];
5962 // Scan flags.
5963 assert(Flags <= 0x1f && "Unexpected bits in flag");
5964
5965 return Flags & 0x8;
5966 }
5967 }
5968 }
5969 llvm_unreachable("Exit infinite loop");
5970}
5971
5972// Check if the given bitcode buffer contains a global value summary block.
5973Expected<BitcodeLTOInfo> BitcodeModule::getLTOInfo() {

Callers 1

getLTOInfoMethod · 0.85

Calls 6

EnterSubBlockMethod · 0.80
errorFunction · 0.70
assertFunction · 0.50
clearMethod · 0.45
readRecordMethod · 0.45

Tested by

no test coverage detected