[flang-commits] [clang] [clang-tools-extra] [flang] [lldb] [llvm] [mlir] [polly] Add static to command line option (cl::opt) (PR #126243)

David Blaikie via flang-commits flang-commits at lists.llvm.org
Fri Feb 7 10:54:03 PST 2025


dwblaikie wrote:

> > > I don't quite follow the motivation for this, can you expand on this in the description please? Right now this seems unnecessary for the changes I can see in MLIR for example.
> > 
> > 
> > The linked bug seems to explain it, I think? It seems to be the usual "if something isn't/doesn't need to be declared in a header, then it should be file-local static, so as to not conflict with other local names in other files"?
> 
> Right, though I think @joker-eph comment is that for lot of the MLIR changes, these option variables are function local and they need not be changed to static. This issue is only applicable to file scoped variables.

ah, fair enough - yeah, not sure what the right thihng to do with the locals is. At least in some cases I glanced at, the categories were static local, so arguably the opts could be too - but because it's not clear which way, and doesn't have the same problems as globals - best to leave them as-is.

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


More information about the flang-commits mailing list