Skip to content

[nfc] Small fixups (coding style) post- PR #129626 #129935

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

Merged
merged 1 commit into from
Mar 6, 2025
Merged

Conversation

mtrofin
Copy link
Member

@mtrofin mtrofin commented Mar 5, 2025

No description provided.

@llvmbot llvmbot added the PGO Profile Guided Optimizations label Mar 5, 2025
@llvmbot
Copy link
Member

llvmbot commented Mar 5, 2025

@llvm/pr-subscribers-pgo

Author: Mircea Trofin (mtrofin)

Changes

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

3 Files Affected:

  • (modified) llvm/include/llvm/ProfileData/PGOCtxProfReader.h (+4-4)
  • (modified) llvm/include/llvm/ProfileData/PGOCtxProfWriter.h (+1-1)
  • (modified) llvm/lib/ProfileData/PGOCtxProfReader.cpp (+3-4)
diff --git a/llvm/include/llvm/ProfileData/PGOCtxProfReader.h b/llvm/include/llvm/ProfileData/PGOCtxProfReader.h
index dbd8288caaff5..33f03120a835a 100644
--- a/llvm/include/llvm/ProfileData/PGOCtxProfReader.h
+++ b/llvm/include/llvm/ProfileData/PGOCtxProfReader.h
@@ -186,8 +186,8 @@ class PGOCtxProfileReader final {
   BitstreamCursor Cursor;
   Expected<BitstreamEntry> advance();
   Error readMetadata();
-  Error wrongValue(const Twine &);
-  Error unsupported(const Twine &);
+  Error wrongValue(const Twine &Msg);
+  Error unsupported(const Twine &Msg);
 
   Expected<std::pair<std::optional<uint32_t>, PGOCtxProfContext>>
   readProfile(PGOCtxProfileBlockIDs Kind);
@@ -195,7 +195,7 @@ class PGOCtxProfileReader final {
   bool canEnterBlockWithID(PGOCtxProfileBlockIDs ID);
   Error enterBlockWithID(PGOCtxProfileBlockIDs ID);
 
-  Error loadContexts(CtxProfContextualProfiles &);
+  Error loadContexts(CtxProfContextualProfiles &P);
 
 public:
   PGOCtxProfileReader(StringRef Buffer)
@@ -205,6 +205,6 @@ class PGOCtxProfileReader final {
   Expected<PGOCtxProfile> loadProfiles();
 };
 
-void convertCtxProfToYaml(raw_ostream &OS, const PGOCtxProfile &);
+void convertCtxProfToYaml(raw_ostream &OS, const PGOCtxProfile &Profile);
 } // namespace llvm
 #endif
diff --git a/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h b/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h
index 8923fe57c180c..0ff11c998f02a 100644
--- a/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h
+++ b/llvm/include/llvm/ProfileData/PGOCtxProfWriter.h
@@ -62,7 +62,7 @@ enum PGOCtxProfileBlockIDs {
 /// like value profiling - which would appear as additional records. For
 /// example, value profiling would produce a new record with a new record ID,
 /// containing the profiled values (much like the counters)
-class PGOCtxProfileWriter : public ctx_profile::ProfileWriter {
+class PGOCtxProfileWriter final : public ctx_profile::ProfileWriter {
   enum class EmptyContextCriteria { None, EntryIsZero, AllAreZero };
 
   BitstreamWriter Writer;
diff --git a/llvm/lib/ProfileData/PGOCtxProfReader.cpp b/llvm/lib/ProfileData/PGOCtxProfReader.cpp
index bb912635879d2..63a6b013baba6 100644
--- a/llvm/lib/ProfileData/PGOCtxProfReader.cpp
+++ b/llvm/lib/ProfileData/PGOCtxProfReader.cpp
@@ -277,15 +277,14 @@ void toYaml(yaml::Output &Out, const PGOCtxProfContext &Ctx) {
 
 } // namespace
 
-void llvm::convertCtxProfToYaml(raw_ostream &OS,
-                                const PGOCtxProfile &Profiles) {
+void llvm::convertCtxProfToYaml(raw_ostream &OS, const PGOCtxProfile &Profile) {
   yaml::Output Out(OS);
   void *SaveInfo = nullptr;
   bool UseDefault = false;
   Out.beginMapping();
-  if (!Profiles.Contexts.empty()) {
+  if (!Profile.Contexts.empty()) {
     Out.preflightKey("Contexts", false, false, UseDefault, SaveInfo);
-    toYaml(Out, Profiles.Contexts);
+    toYaml(Out, Profile.Contexts);
     Out.postflightKey(nullptr);
   }
   Out.endMapping();

Copy link
Contributor

@snehasish snehasish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mtrofin mtrofin merged commit 5f70ed5 into llvm:main Mar 6, 2025
13 checks passed
@mtrofin mtrofin deleted the fixups branch March 6, 2025 18:58
jph-13 pushed a commit to jph-13/llvm-project that referenced this pull request Mar 21, 2025
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