[flang-commits] [flang] 085d794 - [flang] Make the symbol count used for collating symbols static

Peter Steinfeld via flang-commits flang-commits at lists.llvm.org
Fri Mar 12 11:05:43 PST 2021


Author: Peter Steinfeld
Date: 2021-03-12T10:56:39-08:00
New Revision: 085d794c5f54512bf76e8bc9f83b9fd5f5e97130

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

LOG: [flang] Make the symbol count used for collating symbols static

I changed the declaration of symbolCount_ in the type Symbols to be
static to avoid possible problems in the future when we might have
multiple objects of type Symbols.  Thanks to Peter for pointing out the
need for this change.

Differential Revision: https://reviews.llvm.org/D98357

Added: 
    

Modified: 
    flang/include/flang/Semantics/symbol.h

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Semantics/symbol.h b/flang/include/flang/Semantics/symbol.h
index 571d4ccacfec..fb53c61c7d23 100644
--- a/flang/include/flang/Semantics/symbol.h
+++ b/flang/include/flang/Semantics/symbol.h
@@ -700,7 +700,7 @@ template <std::size_t BLOCK_SIZE> class Symbols {
   std::list<blockType *> blocks_;
   std::size_t nextIndex_{0};
   blockType *currBlock_{nullptr};
-  std::size_t symbolCount_ = 0;
+  static inline std::size_t symbolCount_ = 0;
 
   Symbol &Get() {
     if (nextIndex_ == 0) {


        


More information about the flang-commits mailing list