[llvm] 44adc24 - [memprof] Use ArrayRef instead of std::vector<LinearFrameId> (NFC) (#116279)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 14 15:05:53 PST 2024


Author: Kazu Hirata
Date: 2024-11-14T15:05:50-08:00
New Revision: 44adc245d8e7e16b730fb247f3b8b47428e2864b

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

LOG: [memprof] Use ArrayRef instead of std::vector<LinearFrameId> (NFC) (#116279)

LLVM Programmer's Manual prefers ArrayRef over actual sequential
container types for read accesses.

Added: 
    

Modified: 
    llvm/include/llvm/ProfileData/MemProf.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ProfileData/MemProf.h b/llvm/include/llvm/ProfileData/MemProf.h
index ff05bb7da2f799..bfd91407769bb3 100644
--- a/llvm/include/llvm/ProfileData/MemProf.h
+++ b/llvm/include/llvm/ProfileData/MemProf.h
@@ -1134,7 +1134,7 @@ class CallStackRadixTreeBuilder {
              const llvm::DenseMap<FrameId, LinearFrameId> &MemProfFrameIndexes,
              llvm::DenseMap<FrameId, FrameStat> &FrameHistogram);
 
-  const std::vector<LinearFrameId> &getRadixArray() const { return RadixArray; }
+  ArrayRef<LinearFrameId> getRadixArray() const { return RadixArray; }
 
   llvm::DenseMap<CallStackId, LinearCallStackId> takeCallStackPos() {
     return std::move(CallStackPos);


        


More information about the llvm-commits mailing list