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

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 17:22:58 PST 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rG795aebf38831: [Inliner][NFC] Remove redundant nullptr check (authored by AlexM, committed by mtrofin).

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.503195.patch
Type: text/x-patch
Size: 716 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230308/481fb842/attachment.bin>


More information about the llvm-commits mailing list