[llvm-dev] llvm pass
Philip Pfaffe via llvm-dev
llvm-dev at lists.llvm.org
Mon May 27 03:33:41 PDT 2019
> 1) Is building a custom LLVM pass out-of-source not recommended?
The official document only contains instructions about in-source build (
Out-of-tree passes are perfectly fine, but not well documented. All you
need to do is find_package() the llvm you want to build against and include
its AddLLVM module. Then effectively all the details discussed in the
how-to you linked work exactly the same.
> 2) opt (ver >= 4) with custom pass libraries does not work as before. When
> I have a simple custom LLVM pass called “helloworld", loading the library
> works well with 3.9 but opt-4.0 cannot not find the pass:
Did you build your plugin against LLVM >= 4?
> 3) I tried to invoke custom LLVM passes from clang rather than opt. I
> followed instructions from several articles like
> and registered the pass to clang’s workflow with legacy pass manger. But
> it raises segmentation fault errors.
> What is a recommended way to register custom passes to clang directly?
The articles are correct in how to do pass registration. In particular,
[this](https://www.cs.cornell.edu/~asampson/blog/clangpass.html) is how you
do it. Hard to guess where you bugs are without having seen the code.
Again, is the clang version the same as the LLVM version you build your
> Thanks in advance.
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev