LLVM 24.0.0git
PluginCAS.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8///
9/// \file
10/// Implements \c ObjectStore and \c ActionCache on top of a dynamically loaded
11/// plugin that provides the C API in \c "llvm-c/CAS/PluginAPI_functions.h".
12///
13/// The asynchronous entry points of the plugin API are not called yet; they
14/// will be wired up once \c ObjectStore and \c ActionCache grow asynchronous
15/// interfaces.
16///
17//===----------------------------------------------------------------------===//
18
19#include "PluginAPI.h"
20#include "llvm/ADT/ScopeExit.h"
24#include "llvm/Support/Error.h"
25
26using namespace llvm;
27using namespace llvm::cas;
28
29namespace {
30
31class PluginCASContext : public CASContext {
32public:
33 void printIDImpl(raw_ostream &OS, const CASID &ID) const final;
34
35 StringRef getHashSchemaIdentifier() const final { return SchemaName; }
36
37 static Expected<std::shared_ptr<PluginCASContext>>
38 create(StringRef PluginPath, StringRef OnDiskPath,
39 ArrayRef<std::pair<std::string, std::string>> PluginArgs);
40
41 ~PluginCASContext() { Functions.cas_dispose(c_cas); }
42
43 llcas_functions_t Functions{};
44 llcas_cas_t c_cas = nullptr;
45 std::string SchemaName;
46
47 static Error errorAndDispose(char *c_err, const llcas_functions_t &Funcs) {
49 Funcs.string_dispose(c_err);
50 return E;
51 }
52
53 Error errorAndDispose(char *c_err) const {
54 return errorAndDispose(c_err, Functions);
55 }
56};
57
58} // anonymous namespace
59
60void PluginCASContext::printIDImpl(raw_ostream &OS, const CASID &ID) const {
61 ArrayRef<uint8_t> Hash = ID.getHash();
62 char *c_printed_id = nullptr;
63 char *c_err = nullptr;
64 if (Functions.digest_print(c_cas, llcas_digest_t{Hash.data(), Hash.size()},
65 &c_printed_id, &c_err))
66 report_fatal_error(errorAndDispose(c_err));
67 OS << c_printed_id;
68 Functions.string_dispose(c_printed_id);
69}
70
71Expected<std::shared_ptr<PluginCASContext>> PluginCASContext::create(
72 StringRef PluginPath, StringRef OnDiskPath,
73 ArrayRef<std::pair<std::string, std::string>> PluginArgs) {
74 auto reportError = [PluginPath](const Twine &Description) -> Error {
75 std::error_code EC = inconvertibleErrorCode();
76 return createStringError(EC, "error loading '" + PluginPath +
77 "': " + Description);
78 };
79
80 SmallString<256> PathBuf = PluginPath;
81 std::string ErrMsg;
82 sys::DynamicLibrary Lib =
84 if (!Lib.isValid())
85 return reportError(ErrMsg);
86
87 llcas_functions_t Functions{};
88
89#define CASPLUGINAPI_FUNCTION(name, required) \
90 if (!(Functions.name = (decltype(llcas_functions_t::name)) \
91 Lib.getAddressOfSymbol("llcas_" #name))) { \
92 if (required) \
93 return reportError("failed symbol 'llcas_" #name "' lookup"); \
94 }
95#include "PluginAPI_functions.def"
96#undef CASPLUGINAPI_FUNCTION
97
98 llcas_cas_options_t c_opts = Functions.cas_options_create();
99 scope_exit DisposeOptions([&]() { Functions.cas_options_dispose(c_opts); });
100
103 SmallString<256> OnDiskPathBuf = OnDiskPath;
104 Functions.cas_options_set_ondisk_path(c_opts, OnDiskPathBuf.c_str());
105 for (const auto &Pair : PluginArgs) {
106 char *c_err = nullptr;
107 if (Functions.cas_options_set_option(c_opts, Pair.first.c_str(),
108 Pair.second.c_str(), &c_err))
109 return errorAndDispose(c_err, Functions);
110 }
111
112 char *c_err = nullptr;
113 llcas_cas_t c_cas = Functions.cas_create(c_opts, &c_err);
114 if (!c_cas)
115 return errorAndDispose(c_err, Functions);
116
117 char *c_schema = Functions.cas_get_hash_schema_name(c_cas);
118 std::string SchemaName = c_schema;
119 Functions.string_dispose(c_schema);
120
121 auto Ctx = std::make_shared<PluginCASContext>();
122 Ctx->Functions = Functions;
123 Ctx->c_cas = c_cas;
124 Ctx->SchemaName = std::move(SchemaName);
125 return Ctx;
126}
127
128//===----------------------------------------------------------------------===//
129// ObjectStore API
130//===----------------------------------------------------------------------===//
131
132namespace {
133
134class PluginObjectStore : public ObjectStore {
135public:
136 Expected<CASID> parseID(StringRef ID) final;
137 Expected<ObjectRef> store(ArrayRef<ObjectRef> Refs,
138 ArrayRef<char> Data) final;
139 Expected<ObjectRef> storeFromFile(StringRef Path) final;
140 Error exportDataToFile(ObjectHandle Node, StringRef Path) const final;
141 CASID getID(ObjectRef Ref) const final;
142 std::optional<ObjectRef> getReference(const CASID &ID) const final;
143 Expected<bool> isMaterialized(ObjectRef Ref) const final;
144 Expected<std::optional<ObjectHandle>> loadIfExists(ObjectRef Ref) final;
145 uint64_t getDataSize(ObjectHandle Node) const final;
146 Error forEachRef(ObjectHandle Node,
147 function_ref<Error(ObjectRef)> Callback) const final;
148 ObjectRef readRef(ObjectHandle Node, size_t I) const final;
149 size_t getNumRefs(ObjectHandle Node) const final;
150 ArrayRef<char> getData(ObjectHandle Node,
151 bool RequiresNullTerminator = false) const final;
152 Error validateObject(const CASID &ID) final {
153 // Not supported yet. Always return success.
154 return Error::success();
155 }
156
157 Error validate(bool CheckHash) const final;
158
159 Error setSizeLimit(std::optional<uint64_t> SizeLimit) final;
160 Expected<std::optional<uint64_t>> getStorageSize() const final;
161 Error pruneStorageData() final;
162
163 PluginObjectStore(std::shared_ptr<PluginCASContext>);
164
165 /// Exposes \c makeObjectRef to the file-local helpers below.
166 ObjectRef makeRef(uint64_t InternalRef) const {
167 return makeObjectRef(InternalRef);
168 }
169
170 std::shared_ptr<PluginCASContext> Ctx;
171};
172
173} // anonymous namespace
174
175Expected<CASID> PluginObjectStore::parseID(StringRef ID) {
176 // Use big enough stack so that we don't have to allocate in the heap.
177 SmallString<148> IDBuf(ID);
178 SmallVector<uint8_t, 68> BytesBuf(68);
179
180 auto parseDigest = [&]() -> Expected<unsigned> {
181 char *c_err = nullptr;
182 unsigned NumBytes = Ctx->Functions.digest_parse(
183 Ctx->c_cas, IDBuf.c_str(), BytesBuf.data(), BytesBuf.size(), &c_err);
184 if (NumBytes == 0)
185 return Ctx->errorAndDispose(c_err);
186 return NumBytes;
187 };
188
189 Expected<unsigned> NumBytes = parseDigest();
190 if (!NumBytes)
191 return NumBytes.takeError();
192
193 if (*NumBytes > BytesBuf.size()) {
194 BytesBuf.resize(*NumBytes);
195 NumBytes = parseDigest();
196 if (!NumBytes)
197 return NumBytes.takeError();
198 assert(*NumBytes == BytesBuf.size());
199 } else {
200 BytesBuf.truncate(*NumBytes);
201 }
202
203 return CASID::create(Ctx.get(), toStringRef(BytesBuf));
204}
205
206Expected<ObjectRef> PluginObjectStore::store(ArrayRef<ObjectRef> Refs,
207 ArrayRef<char> Data) {
209 c_ids.reserve(Refs.size());
210 for (ObjectRef Ref : Refs) {
211 c_ids.push_back(llcas_objectid_t{Ref.getInternalRef(*this)});
212 }
213
214 llcas_objectid_t c_stored_id;
215 char *c_err = nullptr;
216 if (Ctx->Functions.cas_store_object(
217 Ctx->c_cas, llcas_data_t{Data.data(), Data.size()}, c_ids.data(),
218 c_ids.size(), &c_stored_id, &c_err))
219 return Ctx->errorAndDispose(c_err);
220
221 return makeObjectRef(c_stored_id.opaque);
222}
223
224Expected<ObjectRef> PluginObjectStore::storeFromFile(StringRef Path) {
225 if (!Ctx->Functions.cas_store_from_filepath)
226 return ObjectStore::storeFromFile(Path);
227
228 llcas_objectid_t c_stored_id;
229 char *c_err = nullptr;
230 std::string PathStr = Path.str();
231 if (Ctx->Functions.cas_store_from_filepath(Ctx->c_cas, PathStr.c_str(),
232 &c_stored_id, &c_err))
233 return Ctx->errorAndDispose(c_err);
234
235 return makeObjectRef(c_stored_id.opaque);
236}
237
238Error PluginObjectStore::exportDataToFile(ObjectHandle Node,
239 StringRef Path) const {
240 if (!Ctx->Functions.loaded_object_export_data_to_filepath)
241 return ObjectStore::exportDataToFile(Node, Path);
242
243 char *c_err = nullptr;
244 std::string PathStr = Path.str();
245 if (Ctx->Functions.loaded_object_export_data_to_filepath(
246 Ctx->c_cas, llcas_loaded_object_t{Node.getInternalRef(*this)},
247 PathStr.c_str(), &c_err))
248 return Ctx->errorAndDispose(c_err);
249
250 return Error::success();
251}
252
254 return StringRef((const char *)c_digest.data, c_digest.size);
255}
256
257CASID PluginObjectStore::getID(ObjectRef Ref) const {
258 llcas_objectid_t c_id{Ref.getInternalRef(*this)};
259 llcas_digest_t c_digest =
260 Ctx->Functions.objectid_get_digest(Ctx->c_cas, c_id);
261 return CASID::create(Ctx.get(), toStringRef(c_digest));
262}
263
264std::optional<ObjectRef>
265PluginObjectStore::getReference(const CASID &ID) const {
266 ArrayRef<uint8_t> Hash = ID.getHash();
267 llcas_objectid_t c_id;
268 char *c_err = nullptr;
269 if (Ctx->Functions.cas_get_objectid(
270 Ctx->c_cas, llcas_digest_t{Hash.data(), Hash.size()}, &c_id, &c_err))
271 report_fatal_error(Ctx->errorAndDispose(c_err));
272
273 return makeObjectRef(c_id.opaque);
274}
275
276Expected<bool> PluginObjectStore::isMaterialized(ObjectRef Ref) const {
277 llcas_objectid_t c_id{Ref.getInternalRef(*this)};
278 char *c_err = nullptr;
279 llcas_lookup_result_t c_result = Ctx->Functions.cas_contains_object(
280 Ctx->c_cas, c_id, /*globally=*/false, &c_err);
281 switch (c_result) {
283 return true;
285 return false;
287 return Ctx->errorAndDispose(c_err);
288 }
289 llvm_unreachable("unknown llcas_lookup_result_t value");
290}
291
292Expected<std::optional<ObjectHandle>>
293PluginObjectStore::loadIfExists(ObjectRef Ref) {
294 llcas_objectid_t c_id{Ref.getInternalRef(*this)};
295 llcas_loaded_object_t c_obj;
296 char *c_err = nullptr;
297 llcas_lookup_result_t c_result =
298 Ctx->Functions.cas_load_object(Ctx->c_cas, c_id, &c_obj, &c_err);
299 switch (c_result) {
301 return makeObjectHandle(c_obj.opaque);
303 return std::nullopt;
305 return Ctx->errorAndDispose(c_err);
306 }
307 llvm_unreachable("unknown llcas_lookup_result_t value");
308}
309
310namespace {
311
312class ObjectRefsWrapper {
313public:
314 ObjectRefsWrapper(const ObjectHandle &Node, const PluginObjectStore &Store)
315 : Store(Store), Ctx(*Store.Ctx) {
316 llcas_loaded_object_t c_obj{Node.getInternalRef(Store)};
317 this->c_refs = Ctx.Functions.loaded_object_get_refs(Ctx.c_cas, c_obj);
318 }
319
320 size_t size() const {
321 return Ctx.Functions.object_refs_get_count(Ctx.c_cas, c_refs);
322 }
323
324 ObjectRef operator[](size_t I) const {
325 llcas_objectid_t c_id =
326 Ctx.Functions.object_refs_get_id(Ctx.c_cas, c_refs, I);
327 return Store.makeRef(c_id.opaque);
328 }
329
330private:
331 const PluginObjectStore &Store;
332 PluginCASContext &Ctx;
333 llcas_object_refs_t c_refs;
334};
335
336} // namespace
337
338// FIXME: Replace forEachRef/readRef/getNumRefs APIs with an iterator interface.
339Error PluginObjectStore::forEachRef(
340 ObjectHandle Node, function_ref<Error(ObjectRef)> Callback) const {
341 ObjectRefsWrapper Refs(Node, *this);
342 for (unsigned I = 0, E = Refs.size(); I != E; ++I) {
343 if (Error E = Callback(Refs[I]))
344 return E;
345 }
346 return Error::success();
347}
348
349ObjectRef PluginObjectStore::readRef(ObjectHandle Node, size_t I) const {
350 ObjectRefsWrapper Refs(Node, *this);
351 return Refs[I];
352}
353
354size_t PluginObjectStore::getNumRefs(ObjectHandle Node) const {
355 ObjectRefsWrapper Refs(Node, *this);
356 return Refs.size();
357}
358
359// FIXME: Remove getDataSize(ObjectHandle) from API requirement,
360// \c getData(ObjectHandle) should be enough.
361uint64_t PluginObjectStore::getDataSize(ObjectHandle Node) const {
362 ArrayRef<char> Data = getData(Node);
363 return Data.size();
364}
365
366ArrayRef<char> PluginObjectStore::getData(ObjectHandle Node,
367 bool RequiresNullTerminator) const {
368 // FIXME: Remove RequiresNullTerminator from ObjectStore API requirement?
369 // It is a requirement for the plugin API.
370 llcas_data_t c_data = Ctx->Functions.loaded_object_get_data(
371 Ctx->c_cas, llcas_loaded_object_t{Node.getInternalRef(*this)});
372 return ArrayRef((const char *)c_data.data, c_data.size);
373}
374
375Error PluginObjectStore::setSizeLimit(std::optional<uint64_t> SizeLimit) {
376 if (Ctx->Functions.cas_set_ondisk_size_limit) {
377 char *c_err = nullptr;
378 if (Ctx->Functions.cas_set_ondisk_size_limit(Ctx->c_cas,
379 SizeLimit.value_or(0), &c_err))
380 return Ctx->errorAndDispose(c_err);
381 }
382 return Error::success();
383}
384
385Expected<std::optional<uint64_t>> PluginObjectStore::getStorageSize() const {
386 if (!Ctx->Functions.cas_get_ondisk_size)
387 return std::nullopt;
388 char *c_err = nullptr;
389 int64_t ret = Ctx->Functions.cas_get_ondisk_size(Ctx->c_cas, &c_err);
390 switch (ret) {
391 case -1:
392 return std::nullopt;
393 case -2:
394 return Ctx->errorAndDispose(c_err);
395 default:
396 return ret;
397 }
398}
399
400Error PluginObjectStore::pruneStorageData() {
401 if (Ctx->Functions.cas_prune_ondisk_data) {
402 char *c_err = nullptr;
403 if (Ctx->Functions.cas_prune_ondisk_data(Ctx->c_cas, &c_err))
404 return Ctx->errorAndDispose(c_err);
405 }
406 return Error::success();
407}
408
409Error PluginObjectStore::validate(bool CheckHash) const {
410 if (Ctx->Functions.cas_validate) {
411 char *c_err = nullptr;
412 if (Ctx->Functions.cas_validate(Ctx->c_cas, CheckHash, &c_err))
413 return Ctx->errorAndDispose(c_err);
414 return Error::success();
415 }
416 return createStringError("plugin cas doesn't support validation");
417}
418
419PluginObjectStore::PluginObjectStore(std::shared_ptr<PluginCASContext> CASCtx)
420 : ObjectStore(*CASCtx), Ctx(std::move(CASCtx)) {}
421
422//===----------------------------------------------------------------------===//
423// ActionCache API
424//===----------------------------------------------------------------------===//
425
426namespace {
427
428class PluginActionCache : public ActionCache {
429public:
430 Expected<std::optional<CASID>> getImpl(ArrayRef<uint8_t> ResolvedKey,
431 bool CanBeDistributed) const final;
432
433 Error putImpl(ArrayRef<uint8_t> ResolvedKey, const CASID &Result,
434 bool CanBeDistributed) final;
435
436 PluginActionCache(std::shared_ptr<PluginCASContext>);
437
438 Error validate() const final;
439
440private:
441 std::shared_ptr<PluginCASContext> Ctx;
442};
443
444} // anonymous namespace
445
446Expected<std::optional<CASID>>
447PluginActionCache::getImpl(ArrayRef<uint8_t> ResolvedKey,
448 bool CanBeDistributed) const {
449 llcas_objectid_t c_value;
450 char *c_err = nullptr;
451 llcas_lookup_result_t c_result = Ctx->Functions.actioncache_get_for_digest(
452 Ctx->c_cas, llcas_digest_t{ResolvedKey.data(), ResolvedKey.size()},
453 &c_value, CanBeDistributed, &c_err);
454 switch (c_result) {
456 llcas_digest_t c_digest =
457 Ctx->Functions.objectid_get_digest(Ctx->c_cas, c_value);
458 return CASID::create(Ctx.get(), toStringRef(c_digest));
459 }
461 return std::nullopt;
463 return Ctx->errorAndDispose(c_err);
464 }
465 llvm_unreachable("unknown llcas_lookup_result_t value");
466}
467
468Error PluginActionCache::putImpl(ArrayRef<uint8_t> ResolvedKey,
469 const CASID &Result, bool CanBeDistributed) {
470 ArrayRef<uint8_t> Hash = Result.getHash();
471 llcas_objectid_t c_value;
472 char *c_err = nullptr;
473 if (Ctx->Functions.cas_get_objectid(Ctx->c_cas,
474 llcas_digest_t{Hash.data(), Hash.size()},
475 &c_value, &c_err))
476 return Ctx->errorAndDispose(c_err);
477
478 if (Ctx->Functions.actioncache_put_for_digest(
479 Ctx->c_cas, llcas_digest_t{ResolvedKey.data(), ResolvedKey.size()},
480 c_value, CanBeDistributed, &c_err))
481 return Ctx->errorAndDispose(c_err);
482
483 return Error::success();
484}
485
486PluginActionCache::PluginActionCache(std::shared_ptr<PluginCASContext> CASCtx)
487 : ActionCache(*CASCtx), Ctx(std::move(CASCtx)) {}
488
489Error PluginActionCache::validate() const {
490 if (Ctx->Functions.actioncache_validate) {
491 char *c_err = nullptr;
492 if (Ctx->Functions.actioncache_validate(Ctx->c_cas, &c_err))
493 return Ctx->errorAndDispose(c_err);
494 return Error::success();
495 }
496 return createStringError("plugin action cache doesn't support validation");
497}
498
499//===----------------------------------------------------------------------===//
500// createPluginCASDatabases API
501//===----------------------------------------------------------------------===//
502
503Expected<std::pair<std::shared_ptr<ObjectStore>, std::shared_ptr<ActionCache>>>
505 StringRef PluginPath, StringRef OnDiskPath,
506 ArrayRef<std::pair<std::string, std::string>> PluginArgs) {
507 std::shared_ptr<PluginCASContext> Ctx;
508 if (Error E = PluginCASContext::create(PluginPath, OnDiskPath, PluginArgs)
509 .moveInto(Ctx))
510 return std::move(E);
511 auto CAS = std::make_shared<PluginObjectStore>(Ctx);
512 auto AC = std::make_shared<PluginActionCache>(std::move(Ctx));
513 return std::make_pair(std::move(CAS), std::move(AC));
514}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
aarch64 promote const
This file contains the declaration of the ActionCache class, which is the base class for ActionCache ...
static Error reportError(StringRef Message)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static cl::opt< unsigned > SizeLimit("eif-limit", cl::init(6), cl::Hidden, cl::desc("Size limit in Hexagon early if-conversion"))
#define I(x, y, z)
Definition MD5.cpp:57
This file contains the declaration of the ObjectStore class.
Defines llcas_functions_t, the table of function pointers that is populated by looking up the llcas_*...
struct llcas_cas_options_s * llcas_cas_options_t
#define LLCAS_VERSION_MAJOR
struct llcas_cas_s * llcas_cas_t
#define LLCAS_VERSION_MINOR
llcas_lookup_result_t
Return values for a load operation.
@ LLCAS_LOOKUP_RESULT_NOTFOUND
The object was not found.
@ LLCAS_LOOKUP_RESULT_SUCCESS
The object was found.
@ LLCAS_LOOKUP_RESULT_ERROR
An error occurred.
This file defines the scope_exit class, which executes user-defined cleanup logic at scope exit.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
size_t size() const
Get the array size.
Definition ArrayRef.h:141
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
static ErrorSuccess success()
Create a success value.
Definition Error.h:336
Error takeError()
Take ownership of the stored error.
Definition Error.h:612
const char * c_str()
void reserve(size_type N)
void push_back(const T &Elt)
pointer data()
Return a pointer to the vector's buffer, even if empty().
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
A cache from a key (that describes an action) to the result of performing that action.
Definition ActionCache.h:49
Context for CAS identifiers.
Definition CASID.h:28
Unique identifier for a CAS object.
Definition CASID.h:58
static CASID create(const CASContext *Context, StringRef Hash)
Create CASID from CASContext and raw hash bytes.
Definition CASID.h:117
virtual Error exportDataToFile(ObjectHandle Node, StringRef Path) const
Exports the data of an object to a file path.
virtual Expected< ObjectRef > storeFromFile(StringRef Path)
Stores the data of a file into ObjectStore.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
static LLVM_ABI DynamicLibrary getPermanentLibrary(const char *filename, std::string *errMsg=nullptr)
This function permanently loads the dynamic library at the given path using the library load operatio...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void validate(const Triple &TT, const FeatureBitset &FeatureBits)
LLVM_ABI Expected< std::pair< std::shared_ptr< ObjectStore >, std::shared_ptr< ActionCache > > > createPluginCASDatabases(StringRef PluginPath, StringRef OnDiskPath, ArrayRef< std::pair< std::string, std::string > > PluginArgs)
Create ObjectStore and ActionCache instances backed by a plugin that implements the C API in "llvm-c/...
uint64_t getDataSize(const FuncRecordTy *Record)
Return the coverage map data size for the function.
llvm::unique_function< void(llvm::Expected< T >)> Callback
A Callback<T> is a void function that accepts Expected<T>.
Definition Transport.h:139
NodeAddr< NodeBase * > Node
Definition RDFGraph.h:381
This is an optimization pass for GlobalISel generic memory operations.
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Definition STLExtras.h:1669
scope_exit(Callable) -> scope_exit< Callable >
@ Store
The extracted value is stored (ExtractElement only).
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Definition Error.cpp:94
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Definition Error.h:1321
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
Definition Error.cpp:163
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
@ Ref
The access may reference the value stored in memory.
Definition ModRef.h:32
ArrayRef(const T &OneElt) -> ArrayRef< T >
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1917
StringRef toStringRef(bool B)
Construct a string ref from a boolean.
const void * data
Digest hash bytes.
const uint8_t * data
void(* string_dispose)(char *)
Definition PluginAPI.h:25
size_t(* object_refs_get_count)(llcas_cas_t, llcas_object_refs_t)
Definition PluginAPI.h:91
bool(* digest_print)(llcas_cas_t, llcas_digest_t, char **printed_id, char **error)
Definition PluginAPI.h:59
bool(* cas_options_set_option)(llcas_cas_options_t, const char *name, const char *value, char **error)
Definition PluginAPI.h:40
llcas_cas_options_t(* cas_options_create)(void)
Definition PluginAPI.h:31
llcas_object_refs_t(* loaded_object_get_refs)(llcas_cas_t, llcas_loaded_object_t)
Definition PluginAPI.h:88
void(* cas_options_set_ondisk_path)(llcas_cas_options_t, const char *path)
Definition PluginAPI.h:38
void(* cas_options_set_client_version)(llcas_cas_options_t, unsigned major, unsigned minor)
Definition PluginAPI.h:35
llcas_cas_t(* cas_create)(llcas_cas_options_t, char **error)
Definition PluginAPI.h:43
char *(* cas_get_hash_schema_name)(llcas_cas_t)
Definition PluginAPI.h:62
void(* cas_options_dispose)(llcas_cas_options_t)
Definition PluginAPI.h:33
llcas_objectid_t(* object_refs_get_id)(llcas_cas_t, llcas_object_refs_t, size_t index)
Definition PluginAPI.h:93