[llvm-dev] Looking for an out-of-source "Hello, world" LLVM/Clang pass example

Scott Pakin via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 10 16:54:03 PDT 2019


Florian,

On 7/10/19 2:17 PM, Florian Hahn wrote:
> http://www.cs.cornell.edu/~asampson/blog/llvm.html describes how to
> create an out-of-source pass (see 'Let’s Write a Pass’). I think it
> is for LLVM 3.8 though.

Thanks for pointing that out.  I had actually recently stumbled across
that page (and the GitHub repository it references,
https://github.com/sampsyo/llvm-pass-skeleton) while searching for an
answer to my questions but wasn't sure how up-to-date the information
is:

  * Is add_library the currently recommended CMake macro call for
    building an LLVM pass?
    http://llvm.org/docs/WritingAnLLVMPass.html and
    https://llvm.org/docs/CMake.html both point to add_llvm_library,
    which I couldn't get to work.

  * Is the legacy pass manager still the right way to make a pass
    Clang-callable?  There's a currently active thread on this list,
    "Status of the New Pass Manager", that makes me think I have some
    code-rewriting in my future.

-- Scott


More information about the llvm-dev mailing list