[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
Mon Jun 29 10:15:32 PDT 2020


jasonliu marked 2 inline comments as done.
jasonliu added inline comments.


================
Comment at: llvm/lib/MC/MCContext.cpp:346
+  assert((NameEntry.second || !NameEntry.first->second) &&
+         "This name is used somewhere else.");
+  // Mark the name as used for a non-section symbol.
----------------
hubert.reinterpretcast wrote:
> Moot point if we're going with the encoding change, but the collision handling mechanism needs to check that the output name is not also going to collide:
> ```
> void f_$o() { }
> void f$_o() { }
> void f_$o1() { }
> ```
> 
Thanks. Now I like the not-collidable renaming mechanism much more when I know I avoided a while loop to check if the ouput name is going to collide.


================
Comment at: llvm/test/CodeGen/PowerPC/aix-xcoff-symbol-rename.ll:2
+;; This file tests how llc handles symbol contains invalid character on XCOFF
+;; platform.
+;; Since symbol name resolution is the same between 32 bit and 64 bit,
----------------
hubert.reinterpretcast wrote:
> Can't help but notice that none of the renamed entities are referenced via the TOC.
> 
> For example:
> ```
> int f$o();
> int (*bar())() { return f$o; }
> ```
Thanks for pointing it out. Indeed I missed handling TOC entry renaming in this patch. 


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

https://reviews.llvm.org/D82481





More information about the llvm-commits mailing list