[PATCH] D78243: New pass to make internal linkage symbol names unique

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 13:32:28 PDT 2020


rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.

lgtm, plus improvement to test.



================
Comment at: llvm/test/Transforms/UniqueInternalLinkageNames/unique_symbol_names.ll:2
+; RUN: opt -S -unique-internal-linkage-names < %s | FileCheck %s
+
+ at glob = internal global i32 0
----------------
I suspect `Module::getSourceFilename` in this example returns "", so you are adding a hash of the empty string. I think it would be better to add `source_filename = "foo.cpp"` here, and then explicitly check for the hex bits in the names. That ensures that everyone gets the same results everywhere, and will detect changes in the hashing.


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

https://reviews.llvm.org/D78243





More information about the llvm-commits mailing list