[llvm] c209d56 - [RemoveDIs] Fold variable into assert, it's only used once. NFC

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 07:55:35 PST 2023


Author: Benjamin Kramer
Date: 2023-12-12T16:54:24+01:00
New Revision: c209d56e0fd3e8db358515dec5e85fdac2d8295d

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

LOG: [RemoveDIs] Fold variable into assert, it's only used once. NFC

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/Local.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 19b787c10e8f6e..a758fb30698231 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -2135,9 +2135,8 @@ bool llvm::replaceDbgDeclare(Value *Address, Value *NewAddress,
   findDbgDeclares(DbgDeclares, Address, &DPValues);
 
   auto ReplaceOne = [&](auto *DII) {
-    auto *DIVar = DII->getVariable();
+    assert(DII->getVariable() && "Missing variable");
     auto *DIExpr = DII->getExpression();
-    assert(DIVar && "Missing variable");
     DIExpr = DIExpression::prepend(DIExpr, DIExprFlags, Offset);
     DII->setExpression(DIExpr);
     DII->replaceVariableLocationOp(Address, NewAddress);


        


More information about the llvm-commits mailing list