[llvm] 710676c - [Docs] Clarify that FunctionPasses can't add/remove declarations

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 22 09:04:04 PDT 2020


Author: Arthur Eubanks
Date: 2020-10-22T09:03:42-07:00
New Revision: 710676cf3a3c6f6ddf2f18e24cac017d20dac1ff

URL: https://github.com/llvm/llvm-project/commit/710676cf3a3c6f6ddf2f18e24cac017d20dac1ff
DIFF: https://github.com/llvm/llvm-project/commit/710676cf3a3c6f6ddf2f18e24cac017d20dac1ff.diff

LOG: [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

Added: 
    

Modified: 
    llvm/docs/WritingAnLLVMPass.rst

Removed: 
    


################################################################################
diff  --git a/llvm/docs/WritingAnLLVMPass.rst b/llvm/docs/WritingAnLLVMPass.rst
index 7a24659e6294..5d8a9d645fa7 100644
--- a/llvm/docs/WritingAnLLVMPass.rst
+++ b/llvm/docs/WritingAnLLVMPass.rst
@@ -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).


        


More information about the llvm-commits mailing list