[Docs] Clarify that FunctionPasses can't add/remove declarations
authorArthur Eubanks <aeubanks@google.com>
Wed, 21 Oct 2020 15:55:50 +0000 (08:55 -0700)
committerArthur Eubanks <aeubanks@google.com>
Thu, 22 Oct 2020 16:03:42 +0000 (09:03 -0700)
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

llvm/docs/WritingAnLLVMPass.rst

index 7a24659..5d8a9d6 100644 (file)
@@ -474,7 +474,8 @@ external functions.
 To be explicit, ``FunctionPass`` subclasses are not allowed to:
 
 #. Inspect or modify a ``Function`` other than the one currently being processed.
-#. Add or remove ``Function``\ s from the current ``Module``.
+#. Add or remove ``Function``\ s from the current ``Module``, including
+   declarations.
 #. Add or remove global variables from the current ``Module``.
 #. Maintain state across invocations of :ref:`runOnFunction
    <writing-an-llvm-pass-runOnFunction>` (including global data).