[llvm] af02986 - Statistic - Fix MSVC shadow warning against global PrintOnExit static variable. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 04:11:56 PST 2019


Author: Simon Pilgrim
Date: 2019-11-21T12:08:01Z
New Revision: af029860593e595aa496d96b4fa2386e2a3546ad

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

LOG: Statistic - Fix MSVC shadow warning against global PrintOnExit static variable. NFC.

Added: 
    

Modified: 
    llvm/include/llvm/ADT/Statistic.h
    llvm/lib/Support/Statistic.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/Statistic.h b/llvm/include/llvm/ADT/Statistic.h
index b7387ddcf1c7..d7aff6c5939a 100644
--- a/llvm/include/llvm/ADT/Statistic.h
+++ b/llvm/include/llvm/ADT/Statistic.h
@@ -173,7 +173,7 @@ using Statistic = NoopStatistic;
   static llvm::TrackingStatistic VARNAME = {DEBUG_TYPE, #VARNAME, DESC}
 
 /// Enable the collection and printing of statistics.
-void EnableStatistics(bool PrintOnExit = true);
+void EnableStatistics(bool DoPrintOnExit = true);
 
 /// Check if statistics are enabled.
 bool AreStatisticsEnabled();

diff  --git a/llvm/lib/Support/Statistic.cpp b/llvm/lib/Support/Statistic.cpp
index 8cc5020a217e..25f13871e2e4 100644
--- a/llvm/lib/Support/Statistic.cpp
+++ b/llvm/lib/Support/Statistic.cpp
@@ -123,9 +123,9 @@ StatisticInfo::~StatisticInfo() {
     llvm::PrintStatistics();
 }
 
-void llvm::EnableStatistics(bool PrintOnExit) {
+void llvm::EnableStatistics(bool DoPrintOnExit) {
   Enabled = true;
-  ::PrintOnExit = PrintOnExit;
+  PrintOnExit = DoPrintOnExit;
 }
 
 bool llvm::AreStatisticsEnabled() {


        


More information about the llvm-commits mailing list