[PATCH] D145463: [Inliner][NFC] Remove redundant nullptr check

Alex MacLean via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 11:25:39 PST 2023


AlexM updated this revision to Diff 503110.
AlexM added a comment.

Added Callee assert


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145463

Files:
  llvm/lib/Transforms/IPO/Inliner.cpp


Index: llvm/lib/Transforms/IPO/Inliner.cpp
===================================================================
--- llvm/lib/Transforms/IPO/Inliner.cpp
+++ llvm/lib/Transforms/IPO/Inliner.cpp
@@ -555,7 +555,8 @@
 
       // If we inlined or deleted the last possible call site to the function,
       // delete the function body now.
-      if (Callee && Callee->use_empty() && Callee->hasLocalLinkage() &&
+      assert(Callee && "Expected to be non-null due to check at start of loop");
+      if (Callee->use_empty() && Callee->hasLocalLinkage() &&
           // TODO: Can remove if in SCC now.
           !SCCFunctions.count(Callee) &&
           // The function may be apparently dead, but if there are indirect


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D145463.503110.patch
Type: text/x-patch
Size: 716 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230307/6561b3aa/attachment.bin>


More information about the llvm-commits mailing list