Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

kazutakahirata
Copy link
Contributor

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

LLVM Programmer's Manual prefers ArrayRef over actual sequential
container types for read accesses.
@llvmbot llvmbot added the PGO Profile Guided Optimizations label Nov 14, 2024
@llvmbot
Copy link

llvmbot commented Nov 14, 2024

@llvm/pr-subscribers-pgo

Author: Kazu Hirata (kazutakahirata)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/116279.diff

1 Files Affected:

  • (modified) llvm/include/llvm/ProfileData/MemProf.h (+1-1)
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);

@kazutakahirata kazutakahirata merged commit 44adc24 into llvm:main Nov 14, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PGO Profile Guided Optimizations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants