[PATCH] D129453: [IPO] Restore a call to has_value (NFC)

Kazu Hirata via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 10 13:18:44 PDT 2022


kazu created this revision.
kazu added a reviewer: DaniilSuchkov.
Herald added subscribers: ormris, okura, kuter.
Herald added a project: All.
kazu requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: sstefan1.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch restores a call to has_value to make it clear that we are
checking the presence of an optional value, not the underlying value.

This patch partially reverts d08f34b592ff06ccb1f36da88ec09aa926427a4d <https://reviews.llvm.org/rGd08f34b592ff06ccb1f36da88ec09aa926427a4d>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129453

Files:
  llvm/include/llvm/Transforms/IPO/Attributor.h


Index: llvm/include/llvm/Transforms/IPO/Attributor.h
===================================================================
--- llvm/include/llvm/Transforms/IPO/Attributor.h
+++ llvm/include/llvm/Transforms/IPO/Attributor.h
@@ -4887,7 +4887,9 @@
     bool isWrittenValueYetUndetermined() const { return !Content; }
 
     /// Return true if the value written cannot be determined at all.
-    bool isWrittenValueUnknown() const { return Content && !*Content; }
+    bool isWrittenValueUnknown() const {
+      return Content.has_value() && !*Content;
+    }
 
     /// Return the type associated with the access, if known.
     Type *getType() const { return Ty; }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129453.443523.patch
Type: text/x-patch
Size: 662 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220710/bd9f8602/attachment.bin>


More information about the llvm-commits mailing list