[LLVMdev] Accessing a custom defined llvm pass

Adam Taylor aktaylor08 at gmail.com
Mon Feb 23 19:26:16 PST 2015


Hello all,

I have written one pass to collect information about specific calls in an
llvm IR file and am not trying to reference the results from the first pass
in a second pass.

What is the correct way to reference an additional custom pass in LLVM?  At
the moment the project is set up under the lib/Transforms directory in
source and has the current layout:

Thresholds/
    include/
        Thresholds.h
    Pass1.cpp
    Pass2.cpp
    Makefile

Both of the pass classes are defined in the header file.  In pass two I
have declared that it requires Pass1 using: AU.addRequired<Pass1>() and get
the result using
getAnalysis<Pass1>().getParamPtrs();

The module compiles correctly, but when trying to load it using opt I get
an error:

Error opening 'Thresholds.dylib': dlopen(Thresholds.dylib, 9): Symbol not
found: __ZN12_GLOBAL__N_115ParamCallFinder2ID

What is the correct way to reference another custom written pass in LLVM?
Is is possible to do it in this manner or am I completly wrong in my
approach?


Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150223/067e2f41/attachment.html>


More information about the llvm-dev mailing list