[llvm] c2250d8 - [CSSPGO] Move cl::opt inside llvm:: after D100528 and D108342

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 23 23:08:54 PST 2022


Author: Fangrui Song
Date: 2022-11-23T23:08:49-08:00
New Revision: c2250d8bc07915f03283a57ddfc77f9e4635ecbb

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

LOG: [CSSPGO] Move cl::opt inside llvm:: after D100528 and D108342

Added: 
    

Modified: 
    llvm/lib/Analysis/ProfileSummaryInfo.cpp
    llvm/lib/ProfileData/ProfileSummaryBuilder.cpp
    llvm/tools/llvm-profgen/ProfileGenerator.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
index 64844f534332f..c0d9bfb53088a 100644
--- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp
+++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
@@ -23,12 +23,14 @@
 using namespace llvm;
 
 // Knobs for profile summary based thresholds.
+namespace llvm {
 extern cl::opt<int> ProfileSummaryCutoffHot;
 extern cl::opt<int> ProfileSummaryCutoffCold;
 extern cl::opt<unsigned> ProfileSummaryHugeWorkingSetSizeThreshold;
 extern cl::opt<unsigned> ProfileSummaryLargeWorkingSetSizeThreshold;
 extern cl::opt<int> ProfileSummaryHotCount;
 extern cl::opt<int> ProfileSummaryColdCount;
+} // namespace llvm
 
 static cl::opt<bool> PartialProfile(
     "partial-profile", cl::Hidden, cl::init(false),

diff  --git a/llvm/lib/ProfileData/ProfileSummaryBuilder.cpp b/llvm/lib/ProfileData/ProfileSummaryBuilder.cpp
index 222764b6f8b79..8e07478fb083b 100644
--- a/llvm/lib/ProfileData/ProfileSummaryBuilder.cpp
+++ b/llvm/lib/ProfileData/ProfileSummaryBuilder.cpp
@@ -18,6 +18,7 @@
 
 using namespace llvm;
 
+namespace llvm {
 cl::opt<bool> UseContextLessSummary(
     "profile-summary-contextless", cl::Hidden,
     cl::desc("Merge context profiles before calculating thresholds."));
@@ -64,6 +65,7 @@ cl::opt<uint64_t> ProfileSummaryColdCount(
     "profile-summary-cold-count", cl::ReallyHidden,
     cl::desc("A fixed cold count that overrides the count derived from"
              " profile-summary-cutoff-cold"));
+} // namespace llvm
 
 // A set of cutoff values. Each value, when divided by ProfileSummary::Scale
 // (which is 1000000) is a desired percentile of total counts.

diff  --git a/llvm/tools/llvm-profgen/ProfileGenerator.cpp b/llvm/tools/llvm-profgen/ProfileGenerator.cpp
index dd8f0691e5701..17af9dd2a2d7c 100644
--- a/llvm/tools/llvm-profgen/ProfileGenerator.cpp
+++ b/llvm/tools/llvm-profgen/ProfileGenerator.cpp
@@ -32,8 +32,8 @@ static cl::opt<SampleProfileFormat> OutputFormat(
         clEnumValN(SPF_GCC, "gcc",
                    "GCC encoding (only meaningful for -sample)")));
 
-cl::opt<bool> UseMD5(
-    "use-md5", cl::init(false), cl::Hidden,
+static cl::opt<bool> UseMD5(
+    "use-md5", cl::Hidden,
     cl::desc("Use md5 to represent function names in the output profile (only "
              "meaningful for -extbinary)"));
 
@@ -90,9 +90,6 @@ static cl::opt<bool> UpdateTotalSamples(
         "Update total samples by accumulating all its body samples."),
     llvm::cl::Optional);
 
-extern cl::opt<int> ProfileSummaryCutoffHot;
-extern cl::opt<bool> UseContextLessSummary;
-
 static cl::opt<bool> GenCSNestedProfile(
     "gen-cs-nested-profile", cl::Hidden, cl::init(true),
     cl::desc("Generate nested function profiles for CSSPGO"));
@@ -101,6 +98,9 @@ using namespace llvm;
 using namespace sampleprof;
 
 namespace llvm {
+extern cl::opt<int> ProfileSummaryCutoffHot;
+extern cl::opt<bool> UseContextLessSummary;
+
 namespace sampleprof {
 
 // Initialize the MaxCompressionSize to -1 which means no size limit


        


More information about the llvm-commits mailing list