Skip to content

hryx/llvm-bitcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This is a Zig library for reading and writing LLVM bitcode, a binary serialization format for LLVM IR.

Status: experimental and incomplete. Please see issues for remaining work and bugs.

This project has 3 components:

  1. bitstream, a low-level interface to LLVM's abstract container and encoding format known as bitstream.
  2. bitcode, which handles parsing and rendering LLVM IR bitcode files, based on the bitstream format.
  3. bcanalyzer, a command-line tool for printing information about LLVM IR bitcode files.

Usage

Install a recent version of Zig and Clang.

Build and use the bcanalyzer CLI tool to read a bitcode file:

clang -emit-llvm -c my_file.c
zig build
./zig-out/bin/bcanalyzer --dump my_file.bc

If successfully parsed, the structure is printed as JSON, so you can pipe it to jq.

See zig build --help for more options, as usual.

About

Experimental LLVM bitcode reader/writer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages