[llvm] 625796f - Fix an unused-variable warning in release build, NFC.

Haojian Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 04:04:13 PST 2022


Author: Haojian Wu
Date: 2022-11-09T13:03:39+01:00
New Revision: 625796f408cc733f64aadd76171f13390217c201

URL: https://github.com/llvm/llvm-project/commit/625796f408cc733f64aadd76171f13390217c201
DIFF: https://github.com/llvm/llvm-project/commit/625796f408cc733f64aadd76171f13390217c201.diff

LOG: Fix an unused-variable warning in release build, NFC.

Added: 
    

Modified: 
    llvm/lib/IR/DebugInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index b30b51e27a05..e2f369b2117f 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -844,14 +844,13 @@ void Instruction::mergeDIAssignID(
     ArrayRef<const Instruction *> SourceInstructions) {
   // Replace all uses (and attachments) of all the DIAssignIDs
   // on SourceInstructions with a single merged value.
-  Function *Fn = getFunction();
-  assert(Fn && "Uninserted instruction merged");
+  assert(getFunction() && "Uninserted instruction merged");
   // Collect up the DIAssignID tags.
   SmallVector<DIAssignID *, 4> IDs;
   for (const Instruction *I : SourceInstructions) {
     if (auto *MD = I->getMetadata(LLVMContext::MD_DIAssignID))
       IDs.push_back(cast<DIAssignID>(MD));
-    assert(Fn == I->getFunction() &&
+    assert(getFunction() == I->getFunction() &&
            "Merging with instruction from another function not allowed");
   }
 


        


More information about the llvm-commits mailing list