[PATCH] D24622: LTO: Simplify caching interface.

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 23 08:51:35 PDT 2016


> On Sep 23, 2016, at 7:54 AM, Teresa Johnson <tejohnson at google.com> wrote:
> 
> 
> 
> On Thu, Sep 22, 2016 at 11:48 PM, Peter Collingbourne <peter at pcc.me.uk <mailto:peter at pcc.me.uk>> wrote:
> What do you think about the below interface changes? It seems like they would address most of the concerns you're raising here.
> 
> typedef std::function<AddStreamFn(unsigned Task, StringRef Key)>  NativeObjectCache;
> 
> NativeObjectCache localCache(std::string CacheDirectoryPath, AddFileFn AddFile);
> 
> Error LTO::run(AddStreamFn AddStream, NativeObjectCache Cache) 
> 
> And remove Cache field from config.
> 
> 
> Can't speak for Mehdi, but I do like this change - it makes it much clearer that the AddFile is correlated with the local cache implementation, and doesn't require passing it in to LTO::run when e.g. we are doing regular LTO and no caching. It also seems like it would facilitate supporting an in-memory cache as Mehdi asked, since the NativeObjectCache isn't requring the AddFileFn.

Agree with Teresa. 
LGTM.

Thanks!

— 
Mehdi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160923/3731df55/attachment.html>


More information about the llvm-commits mailing list