# bytecode reader

**URL:** <https://discourse.llvm.org/t/bytecode-reader/10780>\
**Category:** LLVM Dev List Archives\
**Created:** [June 23, 2008, 11:05pm UTC](https://discourse.llvm.org/t/bytecode-reader/10780 "2008-06-23T23:05:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Le\_Anh\_Quang](https://avatars.discourse-cdn.com/v4/letter/l/90ced4/32.png) [@Le\_Anh\_Quang](https://discourse.llvm.org/u/Le_Anh_Quang)\
**Post date:** [June 23, 2008, 11:05pm UTC](https://discourse.llvm.org/t/bytecode-reader/10780/1 "2008-06-23T23:05:45Z")

</div>

Hi,  
I currently write a tool to parse the LLVM bytecode file (.bc file). So I  
have some very basic questions:  
- First, about the Abbreviation ID ( "0"=END\_BLOCK, "1"=ENTER\_SUBBLOCK...):  
how to read these ID from the file stream ? I mean, I don't know, how many  
bit length they are. It doesn't exist on the document.  
- Second, how is the order to read the bytecode ?  
For example 4 bytes after the LLVM IR magic nr.: 21 0C 00 00  
It describes the MODULE\_BLOCK with its parameters, actually. But I don't  
know how  
to extract them from those bytes.

I hope that somebody can help me answer these questions.

Thanks and Regards,  
Quang
