[llvm] d896ea7 - [llvm-debuginfo-analyzer] Return by reference instead of value.

Carlos Alberto Enciso via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 16 22:32:43 PST 2022


Author: Carlos Alberto Enciso
Date: 2022-11-17T06:30:56Z
New Revision: d896ea75c59105053a201ada43fb8b54fdb7eb54

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

LOG: [llvm-debuginfo-analyzer] Return by reference instead of value.

The following functions are used in the unittest, to access
invalid data detected by the Reader during the debug information
analysis:

- getDebugTags
- getWarningOffsets
- getInvalidLocations
- getInvalidCoverages
- getInvalidRanges
- getLinesZero

Just return a reference to the container with the information.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D138092

Added: 
    

Modified: 
    llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h
index fa21fd2e863d4..8204163f34de6 100644
--- a/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h
+++ b/llvm/include/llvm/DebugInfo/LogicalView/Core/LVScope.h
@@ -555,16 +555,16 @@ class LVScopeCompileUnit final : public LVScope {
   // Record line zero.
   void addLineZero(LVLine *Line);
 
-  const LVTagOffsetsMap getDebugTags() const { return DebugTags; }
-  const LVOffsetElementMap getWarningOffsets() const { return WarningOffsets; }
-  const LVOffsetLocationsMap getInvalidLocations() const {
+  const LVTagOffsetsMap &getDebugTags() const { return DebugTags; }
+  const LVOffsetElementMap &getWarningOffsets() const { return WarningOffsets; }
+  const LVOffsetLocationsMap &getInvalidLocations() const {
     return InvalidLocations;
   }
-  const LVOffsetSymbolMap getInvalidCoverages() const {
+  const LVOffsetSymbolMap &getInvalidCoverages() const {
     return InvalidCoverages;
   }
-  const LVOffsetLocationsMap getInvalidRanges() const { return InvalidRanges; }
-  const LVOffsetLinesMap getLinesZero() const { return LinesZero; }
+  const LVOffsetLocationsMap &getInvalidRanges() const { return InvalidRanges; }
+  const LVOffsetLinesMap &getLinesZero() const { return LinesZero; }
 
   // Process ranges, locations and calculate coverage.
   void processRangeLocationCoverage(


        


More information about the llvm-commits mailing list