[PATCH] D14623: [ThinLTO] Comdat importing fixes and related cleanup

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 08:39:55 PST 2015


tejohnson added inline comments.

================
Comment at: lib/Linker/LinkModules.cpp:558
@@ +557,3 @@
+  void stripDeclsFromComdats();
+  void convertInvalidAliasesToDeclarations();
+
----------------
rafael wrote:
> We cannot convert aliases to declarations.
Why? Note that after the conversion it isn't an alias, just a declaration to an externally defined symbol. This is needed to import anything that references an alias (especially now with your change in r254170).

I.e. if we import function foo() and it calls f() which is actually an alias to function f2(). If we don't import f2 (or with r254170 if f2() is not linkonce), then f() cannot be an alias in the destination (importing) module. So we convert the imported f() alias into a declaration. The linker will resolve this to the f() alias in the importing module eventually. It shouldn't be any different than having a module reference an alias defined elsewhere originally.

Also, note this is already done (in copyGlobalAliasProto), I am just moving it to a post-pass here.


http://reviews.llvm.org/D14623





More information about the llvm-commits mailing list