From: Simon Pilgrim Date: Fri, 7 May 2021 13:48:10 +0000 (+0100) Subject: [CodeGen] Ensure UserValue::getDebugLoc() and UserLabel::getDebugLoc() consistently... X-Git-Tag: llvmorg-14-init~7329 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9d4b4173b56c5a56d32d07be660f872b9746f87;p=platform%2Fupstream%2Fllvm.git [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. --- 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 *); };