[PATCH] Documentation: Explicitly state prohibition of inspecting other functions in a FunctionPass

Stephen Lin swlin at post.harvard.edu
Sat Jul 6 02:44:57 PDT 2013


Hi,

For a BasicBlockPass, the documentation in WritingAnLLVMPass.rst
states that there is an explicit prohibition against inspecting the
state of another basic block other than the one being processed. which
makes sense:

    ``BasicBlockPass``\ es are just like :ref:`FunctionPass's
    <writing-an-llvm-pass-FunctionPass>` , except that they must limit
their scope
    of inspection and modification to a single basic block at a time.  As such,
    they are **not** allowed to do any of the following:

    #. Modify or inspect any basic blocks outside of the current one.
    ...

Logically there should seem to be a similar prohibition on inspecting
the state of another function in a FunctionPass, but the documentation
for that section simply states:

    To be explicit, ``FunctionPass`` subclasses are not allowed to:

    #. Modify a ``Function`` other than the one currently being processed.
    ...

I posted a message to LLVMDev about this and it seems like no one can
think of a good reason for this discrepancy, so unless anyone
disagrees with this assessment, I am going to change the documentation
to explicitly state that inspecting other functions is disallowed.

Please let me know if you have any objections.

Stephen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: function-pass-doc-fix.patch
Type: application/octet-stream
Size: 628 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130706/564cb8d0/attachment.obj>


More information about the llvm-commits mailing list