LLVM  6.0.0svn
Caching.h
Go to the documentation of this file.
1 //===- Caching.h - LLVM Link Time Optimizer Configuration -----------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the localCache function, which allows clients to add a
11 // filesystem cache to ThinLTO.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LTO_CACHING_H
16 #define LLVM_LTO_CACHING_H
17 
18 #include "llvm/LTO/LTO.h"
19 #include <string>
20 
21 namespace llvm {
22 namespace lto {
23 
24 /// This type defines the callback to add a pre-existing native object file
25 /// (e.g. in a cache).
26 ///
27 /// Path is generally expected to be a valid path for the file at the point when
28 /// the AddBufferFn function is called, but clients should prefer to access MB
29 /// directly in order to avoid a potential race condition.
30 ///
31 /// Buffer callbacks must be thread safe.
32 typedef std::function<void(unsigned Task, std::unique_ptr<MemoryBuffer> MB,
33  StringRef Path)>
35 
36 /// Create a local file system cache which uses the given cache directory and
37 /// file callback. This function also creates the cache directory if it does not
38 /// already exist.
40  AddBufferFn AddBuffer);
41 
42 } // namespace lto
43 } // namespace llvm
44 
45 #endif
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
Tagged union holding either a T or a Error.
Definition: CachePruning.h:23
Expected< NativeObjectCache > localCache(StringRef CacheDirectoryPath, AddBufferFn AddBuffer)
Create a local file system cache which uses the given cache directory and file callback.
Definition: Caching.cpp:25
std::function< void(unsigned Task, std::unique_ptr< MemoryBuffer > MB, StringRef Path)> AddBufferFn
This type defines the callback to add a pre-existing native object file (e.g.
Definition: Caching.h:34
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49