aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2025-03-31 20:23:34 -0700
committerFangrui Song <i@maskray.me>2025-03-31 20:23:34 -0700
commit71cf59219162be67392b435dfcb9b280e1ff8681 (patch)
tree5c881485fcc657803981dbbaefb3d3246805ff42 /llvm/lib/IR/Attributes.cpp
parent145b4a39504b88a695f1f85f4d9da991bb9a2656 (diff)
downloadllvm-71cf59219162be67392b435dfcb9b280e1ff8681.zip
llvm-71cf59219162be67392b435dfcb9b280e1ff8681.tar.gz
llvm-71cf59219162be67392b435dfcb9b280e1ff8681.tar.bz2
[IR] Fix -Wunused-but-set-variable
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 8cb8b0d..33ac8bf 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -2292,10 +2292,10 @@ AttrBuilder &AttrBuilder::addInitializesAttr(const ConstantRangeList &CRL) {
}
AttrBuilder &AttrBuilder::addFromEquivalentMetadata(const Instruction &I) {
- if (const MDNode *NonNull = I.getMetadata(LLVMContext::MD_nonnull))
+ if (I.hasMetadata(LLVMContext::MD_nonnull))
addAttribute(Attribute::NonNull);
- if (const MDNode *NoUndef = I.getMetadata(LLVMContext::MD_noundef))
+ if (I.hasMetadata(LLVMContext::MD_noundef))
addAttribute(Attribute::NoUndef);
if (const MDNode *Align = I.getMetadata(LLVMContext::MD_align)) {