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

Function hasValidBitcodeHeader

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

Helper to read the header common to all bitcode files.

Source from the content-addressed store, hash-verified

108
109/// Helper to read the header common to all bitcode files.
110static bool hasValidBitcodeHeader(BitstreamCursor &Stream) {
111 // Sniff for the signature.
112 if (!Stream.canSkipToPos(4) ||
113 Stream.Read(8) != 'B' ||
114 Stream.Read(8) != 'C' ||
115 Stream.Read(4) != 0x0 ||
116 Stream.Read(4) != 0xC ||
117 Stream.Read(4) != 0xE ||
118 Stream.Read(4) != 0xD)
119 return false;
120 return true;
121}
122
123static Expected<BitstreamCursor> initStream(MemoryBufferRef Buffer) {
124 const unsigned char *BufPtr = (const unsigned char *)Buffer.getBufferStart();

Callers 1

initStreamFunction · 0.85

Calls 2

canSkipToPosMethod · 0.80
ReadMethod · 0.45

Tested by

no test coverage detected