| 5930 | } |
| 5931 | |
| 5932 | static 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. |
| 5973 | Expected<BitcodeLTOInfo> BitcodeModule::getLTOInfo() { |
no test coverage detected