[PATCH] D19102: Always traverse GlobalVariable initializer when computing the export list

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 11:38:48 PDT 2016


tejohnson added a comment.

> We are always importing the initializer for a GlobalVariable.


I don't think this is true anymore, or at least I can't find where we are doing this. We used to always import variable defs in the Linker, but now that is being passed a list of globals to import.

Now we are skipping variables with a comment:

  auto *Summary = dyn_cast_or_null<FunctionSummary>(GlobInfo->summary());
  if (!Summary)
    /// Ignore global variable, focus on functions
    continue;

and computeImportForFunction does not walk refs() looking for possible imports. Am I missing something?

I think if we want to add handling like this for the future when variable defs are imported, a better place would be in computeImportForFunction where we would presumably walk the refs() and make those decisions (similar to how the ExportList is updated for callees in the loop over the call edges in that function.


http://reviews.llvm.org/D19102





More information about the llvm-commits mailing list