[llvm] 94e03ab - [IPO] Restore a call to has_value (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 20 09:40:23 PDT 2022
Author: Kazu Hirata
Date: 2022-07-20T09:40:18-07:00
New Revision: 94e03abf91d5dafd4a466b76dd85588335937028
URL: https://github.com/llvm/llvm-project/commit/94e03abf91d5dafd4a466b76dd85588335937028
DIFF: https://github.com/llvm/llvm-project/commit/94e03abf91d5dafd4a466b76dd85588335937028.diff
LOG: [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
Added:
Modified:
llvm/include/llvm/Transforms/IPO/Attributor.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h
index 1eac4932d48d1..adfd0bc0556ca 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; }
More information about the llvm-commits
mailing list