This is an archive of the discontinued LLVM Phabricator instance.

IR: Tweak the API around adding modules to the summary index.
ClosedPublic

Authored by pcc on Jun 12 2017, 4:41 PM.

Details

Summary

The current name (addModulePath) and return value
(ModulePathStringTableTy::iterator) is a little confusing. This
API adds a module, not just a path. And the iterator is basically
just an implementation detail of the summary index. Address
both of those issues by renaming to addModule and introducing a
ModuleSummaryIndex::Module type that the function returns.

Event Timeline

pcc created this revision.Jun 12 2017, 4:41 PM
tejohnson accepted this revision.Jun 13 2017, 1:42 PM

LGTM

llvm/include/llvm/IR/ModuleSummaryIndex.h
694

I have a preference towards naming this something other than Module, since that name is so frequently used for the IR Module. Consider changing to something like ModuleInfo or something like that? (And if you do so, the change to hasExportedFunctions parameter can be reverted)

This revision is now accepted and ready to land.Jun 13 2017, 1:42 PM
This revision was automatically updated to reflect the committed changes.
pcc marked an inline comment as done.Jun 14 2017, 3:37 PM
pcc added inline comments.
llvm/include/llvm/IR/ModuleSummaryIndex.h
694

Renamed to ModuleInfo.