[clang-tools-extra] [flang] [compiler-rt] [clang] [llvm] [libc] [libcxx] [Docs] Fix running-a-pass-with-opt in doc (PR #79273)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 24 07:23:22 PST 2024


https://github.com/LukeLIN-web updated https://github.com/llvm/llvm-project/pull/79273

>From 5bec4cb8a832ace256c69993f12ceae9fddedf85 Mon Sep 17 00:00:00 2001
From: Luke <1263810658 at qq.com>
Date: Wed, 24 Jan 2024 14:07:31 +0300
Subject: [PATCH] fix CMakeLists.txt in doc

---
 llvm/docs/WritingAnLLVMNewPMPass.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/llvm/docs/WritingAnLLVMNewPMPass.rst b/llvm/docs/WritingAnLLVMNewPMPass.rst
index 799863c7864ecc..fb95c24691a6f1 100644
--- a/llvm/docs/WritingAnLLVMNewPMPass.rst
+++ b/llvm/docs/WritingAnLLVMNewPMPass.rst
@@ -129,6 +129,10 @@ manager will ensure that the pass will be run on every function in a module.
 The ``PreservedAnalyses`` return value says that all analyses (e.g. dominator
 tree) are still valid after this pass since we didn't modify any functions.
 
+We need to put  ``HelloWorld.cpp`` to ``add_llvm_component_library`` in the
+``llvm/lib/Transforms/Utils/CMakeLists.txt`` file. This will ensure that the
+pass is built and linked into ``opt``.
+
 That's it for the pass itself. Now in order to "register" the pass, we need
 to add it to a couple places. Add the following to
 ``llvm/lib/Passes/PassRegistry.def`` in the ``FUNCTION_PASS`` section



More information about the cfe-commits mailing list