SkipBitcodeWrapperHeader - Some systems wrap bc files with a special header for padding or other reasons. The format of this header is:
Declared in <llvm/Bitcode/BitcodeReader.h>
bool
SkipBitcodeWrapperHeader(
unsigned char const*& BufPtr,
unsigned char const*& BufEnd,
bool VerifyBufferSize);
struct bc_header { uint32_t Magic; // 0x0B17C0DE uint32_t Version; // Version, currently always 0. uint32_t BitcodeOffset; // Offset to traditional bitcode file. uint32_t BitcodeSize; // Size of traditional bitcode file. ... potentially other gunk ... };
This function is called when we find a file with a matching magic number. In this case, skip down to the subsection of the file that is actually a BC file. If 'VerifyBufferSize' is true, check that the buffer is large enough to contain the whole bitcode file.
True if the wrapper is invalid or the buffer is too small; false on success after advancing BufPtr and BufEnd.
| Name | Description |
|---|---|
| BufPtr | On entry, start of the wrapper; on success, advanced to the bitcode payload. |
| BufEnd | On entry, end of the buffer; on success, set to the end of the bitcode payload. |
| VerifyBufferSize | If true, check that the buffer is large enough to contain the whole bitcode file. |