This is an archive of the discontinued LLVM Phabricator instance.

[ThinLTO/Summary] Rename anonymous globals as last action in the per-TU -O0 pipeline
ClosedPublic

Authored by davide on Apr 22 2017, 9:37 PM.

Details

Summary

The problem is that there could be passes registered using addExtensionsToPM() introducing unnamed globals.
Asan is an example, but there may be others. Building cppcheck with -thinlto and -fsanitize=address triggers an assertion while we're reading bitcode (in lib/LTO), as the BitcodeReader while reading the summary assumes there are no unnamed globals because the namer has run).
Unfortunately I wasn't able to find an easy way to test this. I added a comment in the hope nobody moves this again, but, if folks have a way to test, I'm all ears.

Fixes https://bugs.llvm.org/show_bug.cgi?id=32004

Diff Detail

Event Timeline

davide created this revision.Apr 22 2017, 9:37 PM
This revision is now accepted and ready to land.Apr 22 2017, 9:57 PM
davide closed this revision.Apr 23 2017, 11:00 PM