[PATCH] D20290: [ThinLTO] Refactor ODR resolution and internalization (NFC)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 08:57:39 PDT 2016


tejohnson added a comment.

Per IRC discussion, I am going to move the functions back into ThinLTOCodeGenerator.cpp for this patch. It will be followed by an NFC commit to move the functions to the new locations.


================
Comment at: lib/LTO/LTO.cpp:90
@@ +89,3 @@
+      if (GlobalValue::isLocalLinkage(S->linkage()))
+        S->setLinkage(GlobalValue::ExternalLinkage);
+    } else {
----------------
joker.eph wrote:
> tejohnson wrote:
> > joker.eph wrote:
> > > tejohnson wrote:
> > > > joker.eph wrote:
> > > > > This does not sound correct to me.
> > > > This is needed so that it is not internalized again in thinLTOInternalizeModule (which runs after promotion).
> > > I see...
> > > The issue is that this function is called *internalize* and is doing *promotion*.
> > Good point - how about if I change the name of this and the caller to something like "thinLTOHandleExported(GUID|InIndex)" ?
> changing the name would be OK to me, whatever you figure is best. 
> `HandleExported` does not sound very explicit to me, what about something like `resolveLinkage` or `InternalizeAndPromote`?
"resolveLinkage" is too general, especially since there is separate handling for linkonce/weak linkages. I like "InternalizeAndPromote". Will make that change.


http://reviews.llvm.org/D20290





More information about the llvm-commits mailing list