I write and run some llvm regular passes with opt with these simple commands:
clang++ -c mypass.cpp
clang++ -shared -o mypass.so mypass.o
opt -load ./mypass.so -mypass < sample.bc > /dev/null
But I would like to write, register and run machine function pass. I know these passes cannot generally be run from the opt or bugpoint commands. What do I do and how? I didn’t find any example.
I am newbie on llvm.