[llvm] 0d51b6a - [DebugInstrRef] Add some missing const qualifiers (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 08:19:32 PST 2022


Author: Nikita Popov
Date: 2022-01-18T17:19:23+01:00
New Revision: 0d51b6ab1587a5d5d649cc5c1a9bc9e7e6d8de2c

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

LOG: [DebugInstrRef] Add some missing const qualifiers (NFC)

Added: 
    

Modified: 
    llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
index 5d72428f1aec..849f2895b4a5 100644
--- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
+++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
@@ -251,9 +251,10 @@ class TransferTracker {
   /// creates DBG_VALUEs and puts them in #Transfers, then prepares the other
   /// object fields to track variable locations as we step through the block.
   /// FIXME: could just examine mloctracker instead of passing in \p mlocs?
-  void loadInlocs(MachineBasicBlock &MBB, ValueIDNum *MLocs,
-                  SmallVectorImpl<std::pair<DebugVariable, DbgValue>> &VLocs,
-                  unsigned NumLocs) {
+  void
+  loadInlocs(MachineBasicBlock &MBB, ValueIDNum *MLocs,
+             const SmallVectorImpl<std::pair<DebugVariable, DbgValue>> &VLocs,
+             unsigned NumLocs) {
     ActiveMLocs.clear();
     ActiveVLocs.clear();
     VarLocs.clear();
@@ -303,7 +304,7 @@ class TransferTracker {
     }
 
     // Now map variables to their picked LocIdxes.
-    for (auto Var : VLocs) {
+    for (const auto &Var : VLocs) {
       if (Var.second.Kind == DbgValue::Const) {
         PendingDbgValues.push_back(
             emitMOLoc(*Var.second.MO, Var.first, Var.second.Properties));
@@ -418,7 +419,8 @@ class TransferTracker {
     return Reg != SP && Reg != FP;
   }
 
-  bool recoverAsEntryValue(const DebugVariable &Var, DbgValueProperties &Prop,
+  bool recoverAsEntryValue(const DebugVariable &Var,
+                           const DbgValueProperties &Prop,
                            const ValueIDNum &Num) {
     // Is this variable location a candidate to be an entry value. First,
     // should we be trying this at all?


        


More information about the llvm-commits mailing list