Skip to content

Commit 710676c

Browse files
committed
[Docs] Clarify that FunctionPasses can't add/remove declarations
In preparation for potential future concurrency, a FunctionPass shouldn't modify anything at the module level that other FunctionPasses can also modify. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D89890
1 parent efe62b6 commit 710676c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/docs/WritingAnLLVMPass.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,8 @@ external functions.
474474
To be explicit, ``FunctionPass`` subclasses are not allowed to:
475475

476476
#. Inspect or modify a ``Function`` other than the one currently being processed.
477-
#. Add or remove ``Function``\ s from the current ``Module``.
477+
#. Add or remove ``Function``\ s from the current ``Module``, including
478+
declarations.
478479
#. Add or remove global variables from the current ``Module``.
479480
#. Maintain state across invocations of :ref:`runOnFunction
480481
<writing-an-llvm-pass-runOnFunction>` (including global data).

0 commit comments

Comments
 (0)