[PATCH] D24617: [LTO] Prevent asm undefined references to be dropped from the output

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 15 12:58:24 PDT 2016


tejohnson added a comment.

In https://reviews.llvm.org/D24617#543921, @mehdi_amini wrote:

> Also it is not clear to me why we track this globally instead of per-file? What is an ASM reference a local symbol for instance?


Yeah at least for ThinLTO perhaps we should call IRObjectFile::CollectAsmUndefinedRefs in the thinBackend to collect this for each module? That would address the issue Davide mentioned about that being called from clang (distributed backends case). For regular LTO it is essentially global since we merge the module.


================
Comment at: lib/LTO/LTO.cpp:310
@@ +309,3 @@
+
+  // This is an undefined reference to a symbol in asm. We put that in
+  // compiler.used, so that we can preserve it from being dropped from
----------------
Shouldn't this be: an undefined reference "of" a symbol "used" in asm? 


https://reviews.llvm.org/D24617





More information about the llvm-commits mailing list