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

Mircea Trofin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 24 16:36:13 PST 2020


mtrofin added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1111
+      !getModule().getSourceFileName().empty()) {
+    llvm::MD5 Md5;
+    Md5.update(getModule().getSourceFileName());
----------------
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.


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

https://reviews.llvm.org/D73307





More information about the cfe-commits mailing list