@@ -259,10 +259,11 @@ class OnDiskGraphDB {
259259 // / already a record for this object the operation is a no-op. \param ID the
260260 // / object ID to associate the data & references with. \param Refs references
261261 // / \param Data data buffer.
262- Error store (ObjectID ID, ArrayRef<ObjectID> Refs, ArrayRef<char > Data);
262+ LLVM_ABI_FOR_TEST Error store (ObjectID ID, ArrayRef<ObjectID> Refs,
263+ ArrayRef<char > Data);
263264
264265 // / \returns \p nullopt if the object associated with \p Ref does not exist.
265- Expected<std::optional<ObjectHandle>> load (ObjectID Ref);
266+ LLVM_ABI_FOR_TEST Expected<std::optional<ObjectHandle>> load (ObjectID Ref);
266267
267268 // / \returns the hash bytes digest for the object reference.
268269 ArrayRef<uint8_t > getDigest (ObjectID Ref) const {
@@ -271,12 +272,13 @@ class OnDiskGraphDB {
271272
272273 // / Form a reference for the provided hash. The reference can be used as part
273274 // / of a CAS object even if it's not associated with an object yet.
274- Expected<ObjectID> getReference (ArrayRef<uint8_t > Hash);
275+ LLVM_ABI_FOR_TEST Expected<ObjectID> getReference (ArrayRef<uint8_t > Hash);
275276
276277 // / Get an existing reference to the object \p Digest.
277278 // /
278279 // / Returns \p nullopt if the object is not stored in this CAS.
279- std::optional<ObjectID> getExistingReference (ArrayRef<uint8_t > Digest);
280+ LLVM_ABI_FOR_TEST std::optional<ObjectID>
281+ getExistingReference (ArrayRef<uint8_t > Digest);
280282
281283 // / Check whether the object associated with \p Ref is stored in the CAS.
282284 // / Note that this function will fault-in according to the policy.
@@ -289,7 +291,7 @@ class OnDiskGraphDB {
289291 }
290292
291293 // / \returns the data part of the provided object handle.
292- ArrayRef<char > getObjectData (ObjectHandle Node) const ;
294+ LLVM_ABI_FOR_TEST ArrayRef<char > getObjectData (ObjectHandle Node) const ;
293295
294296 object_refs_range getObjectRefs (ObjectHandle Node) const {
295297 InternalRefArrayRef Refs = getInternalRefs (Node);
@@ -300,7 +302,7 @@ class OnDiskGraphDB {
300302 // /
301303 // / NOTE: There's a possibility that the returned size is not including a
302304 // / large object if the process crashed right at the point of inserting it.
303- size_t getStorageSize () const ;
305+ LLVM_ABI_FOR_TEST size_t getStorageSize () const ;
304306
305307 // / \returns The precentage of space utilization of hard space limits.
306308 // /
@@ -335,13 +337,13 @@ class OnDiskGraphDB {
335337 // / \param Policy If \p UpstreamDB is provided, controls how nodes are copied
336338 // / to primary store. This is recorded at creation time and subsequent opens
337339 // / need to pass the same policy otherwise the \p open will fail.
338- static Expected<std::unique_ptr<OnDiskGraphDB>>
340+ LLVM_ABI_FOR_TEST static Expected<std::unique_ptr<OnDiskGraphDB>>
339341 open (StringRef Path, StringRef HashName, unsigned HashByteSize,
340342 std::unique_ptr<OnDiskGraphDB> UpstreamDB = nullptr ,
341343 std::shared_ptr<OnDiskCASLogger> Logger = nullptr ,
342344 FaultInPolicy Policy = FaultInPolicy::FullTree);
343345
344- ~OnDiskGraphDB ();
346+ LLVM_ABI_FOR_TEST ~OnDiskGraphDB ();
345347
346348private:
347349 struct IndexProxy ;
@@ -354,7 +356,9 @@ class OnDiskGraphDB {
354356 OnlyInUpstreamDB,
355357 };
356358
357- ObjectPresence getObjectPresence (ObjectID Ref, bool CheckUpstream) const ;
359+ // / Check if object exists and if it is on upstream only.
360+ LLVM_ABI_FOR_TEST ObjectPresence
361+ getObjectPresence (ObjectID Ref, bool CheckUpstream) const ;
358362
359363 bool containsObject (ObjectID Ref, bool CheckUpstream) const {
360364 switch (getObjectPresence (Ref, CheckUpstream)) {
@@ -393,7 +397,9 @@ class OnDiskGraphDB {
393397 void getStandalonePath (StringRef FileSuffix, const IndexProxy &I,
394398 SmallVectorImpl<char > &Path) const ;
395399
396- ArrayRef<uint8_t > getDigest (InternalRef Ref) const ;
400+ LLVM_ABI_FOR_TEST ArrayRef<uint8_t >
401+ getDigest (InternalRef Ref) const ;
402+
397403 ArrayRef<uint8_t > getDigest (const IndexProxy &I) const ;
398404
399405 IndexProxy getIndexProxyFromRef (InternalRef Ref) const ;
@@ -403,7 +409,8 @@ class OnDiskGraphDB {
403409 IndexProxy
404410 getIndexProxyFromPointer (OnDiskHashMappedTrie::const_pointer P) const ;
405411
406- InternalRefArrayRef getInternalRefs (ObjectHandle Node) const ;
412+ LLVM_ABI_FOR_TEST InternalRefArrayRef
413+ getInternalRefs (ObjectHandle Node) const ;
407414
408415 void recordStandaloneSizeIncrease (size_t SizeIncrease);
409416
0 commit comments