aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2021-05-04 14:31:29 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2021-05-04 14:31:50 +0100
commitb04148f77713c92ee57b33b7b858ad18ce8d78e3 (patch)
tree5a4a443388fa65b568bcbb781054f6ca0e7ac242 /llvm/lib/Transforms/Utils/Local.cpp
parent64911eec75bb0c54e40665a2c3f744f046c66a59 (diff)
downloadllvm-b04148f77713c92ee57b33b7b858ad18ce8d78e3.zip
llvm-b04148f77713c92ee57b33b7b858ad18ce8d78e3.tar.gz
llvm-b04148f77713c92ee57b33b7b858ad18ce8d78e3.tar.bz2
Local.cpp - Avoid DebugLoc copies - use const reference from getDebugLoc. NFCI.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index ed75337..ecabe21 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1423,7 +1423,7 @@ static bool valueCoversEntireFragment(Type *ValTy, DbgVariableIntrinsic *DII) {
/// case this DebugLoc leaks into any adjacent instructions.
static DebugLoc getDebugValueLoc(DbgVariableIntrinsic *DII, Instruction *Src) {
// Original dbg.declare must have a location.
- DebugLoc DeclareLoc = DII->getDebugLoc();
+ const DebugLoc &DeclareLoc = DII->getDebugLoc();
MDNode *Scope = DeclareLoc.getScope();
DILocation *InlinedAt = DeclareLoc.getInlinedAt();
// Produce an unknown location with the correct scope / inlinedAt fields.
@@ -1672,7 +1672,7 @@ bool llvm::replaceDbgDeclare(Value *Address, Value *NewAddress,
int Offset) {
auto DbgAddrs = FindDbgAddrUses(Address);
for (DbgVariableIntrinsic *DII : DbgAddrs) {
- DebugLoc Loc = DII->getDebugLoc();
+ const DebugLoc &Loc = DII->getDebugLoc();
auto *DIVar = DII->getVariable();
auto *DIExpr = DII->getExpression();
assert(DIVar && "Missing variable");
@@ -1687,7 +1687,7 @@ bool llvm::replaceDbgDeclare(Value *Address, Value *NewAddress,
static void replaceOneDbgValueForAlloca(DbgValueInst *DVI, Value *NewAddress,
DIBuilder &Builder, int Offset) {
- DebugLoc Loc = DVI->getDebugLoc();
+ const DebugLoc &Loc = DVI->getDebugLoc();
auto *DIVar = DVI->getVariable();
auto *DIExpr = DVI->getExpression();
assert(DIVar && "Missing variable");