[flang-commits] [flang] [flang] Add __COUNTER__ preprocessor macro (PR #136827)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Thu May 8 06:06:58 PDT 2025


================
@@ -121,6 +121,8 @@ class Preprocessor {
   std::list<std::string> names_;
   std::unordered_map<CharBlock, Definition> definitions_;
   std::stack<CanDeadElseAppear> ifStack_;
+
+  unsigned CounterValue = 0;
----------------
eugeneepshteyn wrote:

We typically use `unsigned int` in this code. Also, the variable names should start with lower case and member variables should end with `_`.  Also, this code uses `{}` initialization.
```suggestion
  unsigned int counter_val_{0};
```

https://github.com/llvm/llvm-project/pull/136827


More information about the flang-commits mailing list