[PATCH] D24086: Misleading comments of SplitBlockAndInsertIfThenElse in BasicBlockUtils.h

Zhe Yu Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 09:00:43 PDT 2016


jery created this revision.
jery added reviewers: eugenis, lattner.
jery added a subscriber: llvm-commits.

The comments of SplitBlockAndInsertIfThenElse say the SplitBefore instruction will stay in the old block.
But according to the implementation(split the block at SplitBefore by using splitBasicBlock), the SplitBefore will be moved to the new block.

This patch fixes the comments.

https://reviews.llvm.org/D24086

Files:
  include/llvm/Transforms/Utils/BasicBlockUtils.h

Index: include/llvm/Transforms/Utils/BasicBlockUtils.h
===================================================================
--- include/llvm/Transforms/Utils/BasicBlockUtils.h
+++ include/llvm/Transforms/Utils/BasicBlockUtils.h
@@ -229,9 +229,9 @@
 ReturnInst *FoldReturnIntoUncondBranch(ReturnInst *RI, BasicBlock *BB,
                                        BasicBlock *Pred);
 
-/// Split the containing block at the specified instruction - everything before
-/// and including SplitBefore stays in the old basic block, and everything after
-/// SplitBefore is moved to a new block. The two blocks are connected by a
+/// Split the containing block at the specified instruction - everything BEFORE
+/// SplitBefore stays in the old basic block, and the rest of the instructions
+/// in the BB are moved to a new block. The two blocks are connected by a
 /// conditional branch (with value of Cmp being the condition).
 /// Before:
 ///   Head


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24086.69860.patch
Type: text/x-patch
Size: 945 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160831/00f732a0/attachment.bin>


More information about the llvm-commits mailing list