From 94e03abf91d5dafd4a466b76dd85588335937028 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Wed, 20 Jul 2022 09:40:18 -0700 Subject: [PATCH] [IPO] Restore a call to has_value (NFC) 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. Differential Revision: https://reviews.llvm.org/D129453 --- llvm/include/llvm/Transforms/IPO/Attributor.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h index 1eac493..adfd0bc 100644 --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -4966,7 +4966,9 @@ struct AAPointerInfo : public AbstractAttribute { 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; } -- 2.7.4