OSDN Git Service

[docs][NewPM] Add docs for writing NPM passes
authorArthur Eubanks <aeubanks@google.com>
Tue, 1 Sep 2020 01:36:11 +0000 (18:36 -0700)
committerArthur Eubanks <aeubanks@google.com>
Mon, 14 Sep 2020 20:26:03 +0000 (13:26 -0700)
commitc2590de30df23ef0db39b496cdec62a83a61fbfa
tree1f156d1e3a58e68956ae809133a0e28a1d6054d1
parent2ad38f7a46b59a5b6653239245d29590d7977b29
[docs][NewPM] Add docs for writing NPM passes

As to not conflict with the legacy PM example passes under
llvm/lib/Transforms/Hello, this is under HelloNew. This makes the
CMakeLists.txt and general directory structure less confusing for people
following the example.

Much of the doc structure was taken from WritinAnLLVMPass.rst.

This adds a HelloWorld pass which simply prints out each function name.

More will follow after this, e.g. passes over different units of IR, analyses.
https://llvm.org/docs/WritingAnLLVMPass.html contains a lot more.

Reviewed By: ychen, asbirlea

Differential Revision: https://reviews.llvm.org/D86979
15 files changed:
llvm/docs/UserGuides.rst
llvm/docs/WritingAnLLVMNewPMPass.rst [new file with mode: 0644]
llvm/docs/WritingAnLLVMPass.rst
llvm/include/llvm/Transforms/HelloNew/HelloWorld.h [new file with mode: 0644]
llvm/lib/Passes/LLVMBuild.txt
llvm/lib/Passes/PassBuilder.cpp
llvm/lib/Passes/PassRegistry.def
llvm/lib/Transforms/CMakeLists.txt
llvm/lib/Transforms/HelloNew/CMakeLists.txt [new file with mode: 0644]
llvm/lib/Transforms/HelloNew/HelloWorld.cpp [new file with mode: 0644]
llvm/lib/Transforms/HelloNew/LLVMBuild.txt [new file with mode: 0644]
llvm/lib/Transforms/LLVMBuild.txt
llvm/test/Transforms/HelloNew/helloworld.ll [new file with mode: 0644]
llvm/utils/gn/secondary/llvm/lib/Passes/BUILD.gn
llvm/utils/gn/secondary/llvm/lib/Transforms/HelloNew/BUILD.gn [new file with mode: 0644]