[lld] 7028799 - [lld-macho][nfc] Rename isec -> referentIsec to avoid shadowing

Jez Ng via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 7 09:36:47 PST 2022


Author: Jez Ng
Date: 2022-03-07T12:36:28-05:00
New Revision: 7028799ca3dcc91bee61cd086235296cabb33670

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

LOG: [lld-macho][nfc] Rename isec -> referentIsec to avoid shadowing

I found the shadowing a bit confusing

Added: 
    

Modified: 
    lld/MachO/ICF.cpp

Removed: 
    


################################################################################
diff  --git a/lld/MachO/ICF.cpp b/lld/MachO/ICF.cpp
index 70317d422fe40..885cb827c7940 100644
--- a/lld/MachO/ICF.cpp
+++ b/lld/MachO/ICF.cpp
@@ -282,8 +282,9 @@ void ICF::run() {
             hash += dylibSym->stubsHelperIndex;
           else if (auto *defined = dyn_cast<Defined>(sym)) {
             if (defined->isec) {
-              if (auto isec = dyn_cast<ConcatInputSection>(defined->isec))
-                hash += defined->value + isec->icfEqClass[icfPass % 2];
+              if (auto referentIsec =
+                      dyn_cast<ConcatInputSection>(defined->isec))
+                hash += defined->value + referentIsec->icfEqClass[icfPass % 2];
               else
                 hash += defined->isec->kind() +
                         defined->isec->getOffset(defined->value);


        


More information about the llvm-commits mailing list