Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codon plugin example

This repo implements an example plugin for Codon called MyValidate, which works on the following code:

def foo(x):
    return x*3 + x

def validate(x, y):
    print('validate called!')
    assert y == x*4

a = foo(10)
b = foo(1.5)
c = foo('a')

The plugin includes a Codon IR pass that inserts calls to validate() after calls to foo().

To build the plugin:

export LLVM_DIR=/path/to/lib/cmake/llvm
mkdir build
cd build
cmake ..
make

To use:

codon run -release -plugin /path/to/example-codon-plugin test.py

About

Example plugin for Codon

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages