[PATCH] D73307: Unique Names for Functions with Internal Linkage

Sriraman Tallam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 18 17:24:07 PDT 2020


tmsriram added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1111
+      !getModule().getSourceFileName().empty()) {
+    llvm::MD5 Md5;
+    Md5.update(getModule().getSourceFileName());
----------------
mtrofin wrote:
> Just a thought: md5 is a non-bijective transformation, afaik. How about using base64 encoding, with the caveat that we replace + with $ and / with _ (so it results in a valid name), and discard padding =
> 
> The value being, one can copy/paste that identifier, do the trivial conversion back to base64 ($->+, _->/) and get the module name. Useful when debugging, for example.
I dont think getting the module name back from the hash is super useful given that we can always inspect this symbol in gdb for source info.  


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

https://reviews.llvm.org/D73307





More information about the cfe-commits mailing list