Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

fil-c LLVM Instrumentation Pass

This directory contains the standalone FilPizlonatorPass, an LLVM instrumentation pass extracted from fil-c's forked LLVM and built as a loadable plugin against standard (unmodified) LLVM.

What it does

The pass instruments LLVM IR with InvisiCap capability checks, enabling fine-grained memory safety enforcement for the fil-c compilation pipeline.

Key points

  • Standard LLVM compatibility: This plugin is built against vanilla LLVM (not fil-c's forked LLVM).
  • Loadable plugin: It is produced as a MODULE (shared library) that can be loaded into LLVM-based tools such as opt or clang.
  • Runtime instrumentation: The inserted checks enforce memory safety at the IR level without requiring source-level modifications.

Requirements

  • LLVM 16 or newer (with development headers and llvm-config / LLVMConfig.cmake)

Building

cd filc-llvm-pass
cmake -B build -S .
cmake --build build

Usage

After building, the plugin can be loaded into opt or clang.

With opt:

opt -load-pass-plugin=build/FilPizlonatorPass.so -passes=filpizlonator -disable-output < /dev/null

With clang:

clang -fpass-plugin=build/FilPizlonatorPass.so -c your_program.c

Verification

To verify the plugin loads and registers correctly:

opt -load-pass-plugin=build/FilPizlonatorPass.so -passes=filpizlonator -disable-output < /dev/null

If the command exits without errors, the plugin is correctly registered.