From 6fa6a32e4e2fdbb77c82fd7f64a7232cdcac994e Mon Sep 17 00:00:00 2001
From: Chris Lattner
This document first describes the LLVM bitstream format, then describes the -record structure used by LLVM IR files. +
LLVM IR files may be optionally embedded into a wrapper structure that makes it easy to embed extra data +along with LLVM IR files.
+ +This document first describes the LLVM bitstream format, describes the +wrapper format, then describes the record structure used by LLVM IR files.
@@ -545,6 +551,36 @@ corresponding blocks. It is not safe to skip them. + + + +Bitcode files for LLVM IR may optionally be wrapped in a simple wrapper +structure. This structure contains a simple header that indicates the offset +and size of the embedded BC file. This allows additional information to be +stored alongside the BC file. The structure of this file header is: +
+ ++
+[Magic32, + Version32, + Offset32, + Size32, + CPUType32] ++ +
Each of the fields are 32-bit fields stored in little endian form (as with +the rest of the bitcode file fields). The Magic number is always +0x0B17C0DE and the version is currently always 0. The Offset +field is the offset in bytes to the start of the bitcode stream in the file, and +the Size field is a size in bytes of the stream. CPUType is a target-specific +value that can be used to encode the CPU of the target. +