[PATCH] D82481: [XCOFF][AIX] Give symbol an internal name when desired symbol name contains invalid character(s)

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 12:36:01 PDT 2020


jasonliu marked an inline comment as done.
jasonliu added inline comments.


================
Comment at: llvm/lib/MC/MCContext.cpp:313
+  SmallString<128> InvalidName(OriginalName);
+  // Replace the invalid character with '_'.
+  for (size_t I = 0; I < InvalidName.size(); ++I) {
----------------
hubert.reinterpretcast wrote:
> Although this encoding generates runs of underscores, it does make it less intrusive in terms of being able to use `c++filt` on the result. Note that collisions increase with non-Latin scripts (which could be reduced if we append the hex values of all the underscores, including the original ones, to the end of the string).
> ```
> namespace ImplVerTags {
> 
> typedef struct
> 一世
> {} A;
> typedef struct
> 二世
> {} B;
> 
> }
> 
> template <typename> void *implStaticDataUnsafe = nullptr;
> 
> template void *implStaticDataUnsafe<ImplVerTags::A>;
> template void *implStaticDataUnsafe<ImplVerTags::B>;
> ```
Just want to make sure I understand your suggestion:
so if I have a "f`!o" as symbol name, I would get back `_Renamed..6021f__o back`?
Do we want to consider just adding those hex values up? Like getting back `_Renamed..81f__o` for that?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82481/new/

https://reviews.llvm.org/D82481





More information about the llvm-commits mailing list