[PATCH] D87078: [UnifyFunctionExitNodes] Remove unused getters, NFC

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 09:17:55 PDT 2020


bjope accepted this revision.
bjope added a comment.
This revision is now accepted and ready to land.

Just hoping that those unused functions aren't used by some OOT project. But considering that the API is totally untested (and the unwind part isn't even visible any longer) I think this cleanup is motivated.

LGTM - but please fixup the stale comments first!



================
Comment at: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:10
 // This pass is used to ensure that functions have at most one return and one
 // unwind instruction in them.  Additionally, it keeps track of which node is
 // the new exit node of the CFG.  If there are no return or unwind instructions
----------------
bjope wrote:
> Stale comments, starting at "Additionally...".
Looks like this pass doesn't care about unwind? So this should probably say unreachable instead?


================
Comment at: llvm/include/llvm/Transforms/Utils/UnifyFunctionExitNodes.h:10-13
 // unwind instruction in them.  Additionally, it keeps track of which node is
 // the new exit node of the CFG.  If there are no return or unwind instructions
 // in the function, the getReturnBlock/getUnwindBlock methods will return a null
 // pointer.
----------------
Stale comments, starting at "Additionally...".


================
Comment at: llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:10
 // This pass is used to ensure that functions have at most one return
 // instruction in them.  Additionally, it keeps track of which node is the new
 // exit node of the CFG.  If there are no exit nodes in the CFG, the getExitNode
----------------
bjope wrote:
> Stale comments, starting at "Additionally...".
Maybe we could say "... at most one return instruction, and at most one unreachable instruction in them."


================
Comment at: llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp:10-12
 // instruction in them.  Additionally, it keeps track of which node is the new
 // exit node of the CFG.  If there are no exit nodes in the CFG, the getExitNode
 // method will return a null pointer.
----------------
Stale comments, starting at "Additionally...".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87078/new/

https://reviews.llvm.org/D87078



More information about the llvm-commits mailing list