[llvm] 2c7af6d - Pass stripNonLineTableDebugInfo remapDebugLoc lambda DebugLoc arg by const reference not value.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 04:38:41 PDT 2020


Author: Simon Pilgrim
Date: 2020-07-01T12:37:47+01:00
New Revision: 2c7af6dffc0645dad561378550701e1e29b5d7e4

URL: https://github.com/llvm/llvm-project/commit/2c7af6dffc0645dad561378550701e1e29b5d7e4
DIFF: https://github.com/llvm/llvm-project/commit/2c7af6dffc0645dad561378550701e1e29b5d7e4.diff

LOG: Pass stripNonLineTableDebugInfo remapDebugLoc lambda DebugLoc arg by const reference not value.

Noticed by clang-tidy performance-unnecessary-value-param warning.

Added: 
    

Modified: 
    llvm/lib/IR/DebugInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 254b6fe563e3..190b220dc9aa 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -647,7 +647,7 @@ bool llvm::stripNonLineTableDebugInfo(Module &M) {
     }
     for (auto &BB : F) {
       for (auto &I : BB) {
-        auto remapDebugLoc = [&](DebugLoc DL) -> DebugLoc {
+        auto remapDebugLoc = [&](const DebugLoc &DL) -> DebugLoc {
           auto *Scope = DL.getScope();
           MDNode *InlinedAt = DL.getInlinedAt();
           Scope = remap(Scope);


        


More information about the llvm-commits mailing list