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

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 10 08:26:08 PST 2021


PeteSteinfeld created this revision.
PeteSteinfeld added reviewers: klausler, tskeith.
PeteSteinfeld requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98357

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


Index: flang/include/flang/Semantics/symbol.h
===================================================================
--- flang/include/flang/Semantics/symbol.h
+++ flang/include/flang/Semantics/symbol.h
@@ -700,7 +700,7 @@
   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) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98357.329677.patch
Type: text/x-patch
Size: 449 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210310/8fdcbc61/attachment.bin>


More information about the llvm-commits mailing list