[llvm] f218573 - [llvm][CAS] Remove unused functions (#168856)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 24 01:09:34 PST 2025


Author: David Spickett
Date: 2025-11-24T09:09:30Z
New Revision: f21857313dfab543e66ef43b1aed43b685794a7c

URL: https://github.com/llvm/llvm-project/commit/f21857313dfab543e66ef43b1aed43b685794a7c
DIFF: https://github.com/llvm/llvm-project/commit/f21857313dfab543e66ef43b1aed43b685794a7c.diff

LOG: [llvm][CAS] Remove unused functions (#168856)

Building with GCC I got:
```
<...>/OnDiskGraphDB.cpp:624:18: warning: ‘static {anonymous}::DataRecordHandle {anonymous}::DataRecordHandle::construct(char*, const {anonymous}::DataRecordHandle::Input&)’ defined but not used [-Wunused-function]
  624 | DataRecordHandle DataRecordHandle::construct(char *Mem, const Input &I) {
      |                  ^~~~~~~~~~~~~~~~
<...>/OnDiskGraphDB.cpp:456:1: warning: ‘static {anonymous}::DataRecordHandle {anonymous}::DataRecordHandle::create(llvm::function_ref<char*(long unsigned int)>, const {anonymous}::DataRecordHandle::Input&)’ defined but not used [-Wunused-function]
  456 | DataRecordHandle::create(function_ref<char *(size_t Size)> Alloc,
      | ^~~~~~~~~~~~~~~~
```

These implement parts of a class that is defined in an anonymous
namespace. All llvm tests passed with them removed.

Added: 
    

Modified: 
    llvm/lib/CAS/OnDiskGraphDB.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CAS/OnDiskGraphDB.cpp b/llvm/lib/CAS/OnDiskGraphDB.cpp
index 2aede017133b0..84f27c4938050 100644
--- a/llvm/lib/CAS/OnDiskGraphDB.cpp
+++ b/llvm/lib/CAS/OnDiskGraphDB.cpp
@@ -452,13 +452,6 @@ Expected<DataRecordHandle> DataRecordHandle::createWithError(
     return Mem.takeError();
 }
 
-DataRecordHandle
-DataRecordHandle::create(function_ref<char *(size_t Size)> Alloc,
-                         const Input &I) {
-  Layout L(I);
-  return constructImpl(Alloc(L.getTotalSize()), I, L);
-}
-
 ObjectHandle ObjectHandle::fromFileOffset(FileOffset Offset) {
   // Store the file offset as it is.
   assert(!(Offset.get() & 0x1));
@@ -621,10 +614,6 @@ bool TrieRecord::compare_exchange_strong(Data &Existing, Data New) {
   return false;
 }
 
-DataRecordHandle DataRecordHandle::construct(char *Mem, const Input &I) {
-  return constructImpl(Mem, I, Layout(I));
-}
-
 Expected<DataRecordHandle>
 DataRecordHandle::getFromDataPool(const OnDiskDataAllocator &Pool,
                                   FileOffset Offset) {


        


More information about the llvm-commits mailing list