[flang-commits] [flang] [flang] Change `uniqueCGIdent` separator from `.` to `_` (PR #71338)

via flang-commits flang-commits at lists.llvm.org
Tue Nov 7 00:52:07 PST 2023


jeanPerier wrote:

> Since QQ is reserved, we can use `_` with QQ, assuming all use cases have QQ or some other way of preventing clashes.

The second case I mentioned above ([derived type runtime description data](https://github.com/llvm/llvm-project/blob/58679ea576f9e48e20e43dcd99fd75c98fb7e6ba/flang/test/Lower/derived-type-descriptor.f90#L14)) is read only data, but is not mangled with QQ currently because it is created by semantics as compiler created symbol in user scopes and is transparent in lowering. The '.' currently ensures they cannot collide with user symbols.

Regarding '$', are we sure that all assembly languages are OK with it? For instance, googling for some ISA, the IBM AIX Version 7.2 defines that "Symbols may consist of numeric digits, underscores, periods, uppercase or lowercase letters, or any
combination of these." (page 28 of https://www.ibm.com/docs/en/ssw_aix_72/assembler/assembler_pdf.pdf). I am not an expert, so I am not sure this matters, but before changing '.' to '$', it should be ensured it is valid on every llvm targets, or this should be target specific mangling/renaming.

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


More information about the flang-commits mailing list