[Clang] Change AnonStructIds in MangleContext to per-function based
Clang is generating different mangled names for the same lambda function in slightly changed builds (like with non-related source/Macro change). This is due to the fact that clang uses a cross-translation-unit sequential string "$_<n>" in lambda's mangled name. Here, "n" is the AnonStructIds field in MangleContext. Different mangled names for a unchanged function is undesirable: it makes perf comparison harder, and can cause some unnecessary profile mismatch in SampleFDO. This patch makes mangled name for lambda functions more stable by changing AnonStructIds to a per-function based seq number if the DeclContext is a function. Differential Revision: https://reviews.llvm.org/D136397
Loading
Please sign in to comment