Skip to content

Commit 71cf592

Browse files
committed
[IR] Fix -Wunused-but-set-variable
1 parent 145b4a3 commit 71cf592

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/IR/Attributes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,10 +2292,10 @@ AttrBuilder &AttrBuilder::addInitializesAttr(const ConstantRangeList &CRL) {
22922292
}
22932293

22942294
AttrBuilder &AttrBuilder::addFromEquivalentMetadata(const Instruction &I) {
2295-
if (const MDNode *NonNull = I.getMetadata(LLVMContext::MD_nonnull))
2295+
if (I.hasMetadata(LLVMContext::MD_nonnull))
22962296
addAttribute(Attribute::NonNull);
22972297

2298-
if (const MDNode *NoUndef = I.getMetadata(LLVMContext::MD_noundef))
2298+
if (I.hasMetadata(LLVMContext::MD_noundef))
22992299
addAttribute(Attribute::NoUndef);
23002300

23012301
if (const MDNode *Align = I.getMetadata(LLVMContext::MD_align)) {

0 commit comments

Comments
 (0)