annotate include/llvm/LTO/Caching.h @ 125:56c5119fbcd2

fix
author mir3636
date Sun, 03 Dec 2017 20:09:16 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
120
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
1 //===- Caching.h - LLVM Link Time Optimizer Configuration -----------------===//
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
2 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
3 // The LLVM Compiler Infrastructure
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
4 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
5 // This file is distributed under the University of Illinois Open Source
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
6 // License. See LICENSE.TXT for details.
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
7 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
8 //===----------------------------------------------------------------------===//
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
9 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
10 // This file defines the localCache function, which allows clients to add a
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
11 // filesystem cache to ThinLTO.
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
12 //
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
13 //===----------------------------------------------------------------------===//
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
14
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
15 #ifndef LLVM_LTO_CACHING_H
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
16 #define LLVM_LTO_CACHING_H
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
17
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
18 #include "llvm/LTO/LTO.h"
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
19 #include <string>
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
20
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
21 namespace llvm {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
22 namespace lto {
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
23
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
24 /// This type defines the callback to add a pre-existing native object file
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
25 /// (e.g. in a cache).
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
26 ///
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
27 /// Path is generally expected to be a valid path for the file at the point when
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
28 /// the AddBufferFn function is called, but clients should prefer to access MB
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
29 /// directly in order to avoid a potential race condition.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
30 ///
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
31 /// Buffer callbacks must be thread safe.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
32 typedef std::function<void(unsigned Task, std::unique_ptr<MemoryBuffer> MB,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
33 StringRef Path)>
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
34 AddBufferFn;
120
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
35
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
36 /// Create a local file system cache which uses the given cache directory and
121
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
37 /// file callback. This function also creates the cache directory if it does not
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
38 /// already exist.
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
39 Expected<NativeObjectCache> localCache(StringRef CacheDirectoryPath,
803732b1fca8 LLVM 5.0
kono
parents: 120
diff changeset
40 AddBufferFn AddBuffer);
120
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
41
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
42 } // namespace lto
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
43 } // namespace llvm
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
44
1172e4bd9c6f update 4.0.0
mir3636
parents:
diff changeset
45 #endif