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

Andrzej Warzynski via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 14 07:02:26 PDT 2019


Scott,

This is still very early stages, but you can be my guinea pig:

https://github.com/banach-space/llvm-tutor

It's a tutorial that I've been preparing recently and am hoping to
present somewhere at some point :-) I believe that it already covers 1),
2) and 3). I haven't had the time to work on 4). It's based on LLVM-8
and includes a working CI set-up, so that you can be confident that it
works. If it doesn't, ping me - I'm keen on improving it.

-- Andrzej

On 11/07/2019 00:54, Scott Pakin via llvm-dev wrote:
> 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
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the llvm-dev mailing list