aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Debugify.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-06-08 22:37:59 -0700
committerGitHub <noreply@github.com>2025-06-08 22:37:59 -0700
commit03f616eb3acf1ae5a219ea247d9efe3cbfd41b59 (patch)
tree670aaa04274fe487c6ad25ec7076b9168fd8fd8b /llvm/lib/Transforms/Utils/Debugify.cpp
parent3dabeed837c20b0664f7772247a08d4fddab8737 (diff)
downloadllvm-03f616eb3acf1ae5a219ea247d9efe3cbfd41b59.zip
llvm-03f616eb3acf1ae5a219ea247d9efe3cbfd41b59.tar.gz
llvm-03f616eb3acf1ae5a219ea247d9efe3cbfd41b59.tar.bz2
[llvm] Compare std::optional<T> to values directly (NFC) (#143340)
This patch transforms: X && *X == Y to: X == Y where X is of std::optional<T>, and Y is of T or similar.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Debugify.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Debugify.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp
index 3e323cc..729813a 100644
--- a/llvm/lib/Transforms/Utils/Debugify.cpp
+++ b/llvm/lib/Transforms/Utils/Debugify.cpp
@@ -705,7 +705,7 @@ bool diagnoseMisSizedDbgValue(Module &M, DbgValTy *DbgVal) {
bool HasBadSize = false;
if (Ty->isIntegerTy()) {
auto Signedness = DbgVal->getVariable()->getSignedness();
- if (Signedness && *Signedness == DIBasicType::Signedness::Signed)
+ if (Signedness == DIBasicType::Signedness::Signed)
HasBadSize = ValueOperandSize < *DbgVarSize;
} else {
HasBadSize = ValueOperandSize != *DbgVarSize;