From c9d4b4173b56c5a56d32d07be660f872b9746f87 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 7 May 2021 14:48:10 +0100 Subject: [PATCH] [CodeGen] Ensure UserValue::getDebugLoc() and UserLabel::getDebugLoc() consistently return a const reference NFCI. Avoids a lot of unnecessary tracking increments/decrements of the underlying TrackingMDNodeRef. --- llvm/lib/CodeGen/LiveDebugVariables.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/LiveDebugVariables.cpp b/llvm/lib/CodeGen/LiveDebugVariables.cpp index ce898cd..100dacb 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.cpp +++ b/llvm/lib/CodeGen/LiveDebugVariables.cpp @@ -473,7 +473,7 @@ public: BlockSkipInstsMap &BBSkipInstsMap); /// Return DebugLoc of this UserValue. - DebugLoc getDebugLoc() { return dl;} + const DebugLoc &getDebugLoc() { return dl; } void print(raw_ostream &, const TargetRegisterInfo *); }; @@ -506,7 +506,7 @@ public: BlockSkipInstsMap &BBSkipInstsMap); /// Return DebugLoc of this UserLabel. - DebugLoc getDebugLoc() { return dl; } + const DebugLoc &getDebugLoc() { return dl; } void print(raw_ostream &, const TargetRegisterInfo *); }; -- 2.7.4