|
21 | 21 | using namespace llvm;
|
22 | 22 | using namespace llvm::cas;
|
23 | 23 |
|
| 24 | +#if LLVM_ENABLE_ONDISK_CAS |
| 25 | + |
24 | 26 | static_assert(sizeof(size_t) == sizeof(uint64_t), "64-bit only");
|
25 | 27 | static_assert(sizeof(std::atomic<int64_t>) == sizeof(uint64_t),
|
26 | 28 | "Requires lock-free 64-bit atomics");
|
@@ -1115,14 +1117,6 @@ Expected<OnDiskHashMappedTrie> OnDiskHashMappedTrie::create(
|
1115 | 1117 | return OnDiskHashMappedTrie(std::make_unique<ImplType>(std::move(Impl)));
|
1116 | 1118 | }
|
1117 | 1119 |
|
1118 |
| -OnDiskHashMappedTrie::OnDiskHashMappedTrie(std::unique_ptr<ImplType> Impl) |
1119 |
| - : Impl(std::move(Impl)) {} |
1120 |
| -OnDiskHashMappedTrie::OnDiskHashMappedTrie(OnDiskHashMappedTrie &&RHS) = |
1121 |
| - default; |
1122 |
| -OnDiskHashMappedTrie & |
1123 |
| -OnDiskHashMappedTrie::operator=(OnDiskHashMappedTrie &&RHS) = default; |
1124 |
| -OnDiskHashMappedTrie::~OnDiskHashMappedTrie() = default; |
1125 |
| - |
1126 | 1120 | //===----------------------------------------------------------------------===//
|
1127 | 1121 | // DataAllocator data structures.
|
1128 | 1122 | //===----------------------------------------------------------------------===//
|
@@ -1266,6 +1260,68 @@ const char *OnDiskDataAllocator::beginData(FileOffset Offset) const {
|
1266 | 1260 |
|
1267 | 1261 | OnDiskDataAllocator::OnDiskDataAllocator(std::unique_ptr<ImplType> Impl)
|
1268 | 1262 | : Impl(std::move(Impl)) {}
|
| 1263 | + |
| 1264 | +#else // !LLVM_ENABLE_ONDISK_CAS |
| 1265 | + |
| 1266 | +struct OnDiskHashMappedTrie::ImplType {}; |
| 1267 | + |
| 1268 | +Expected<OnDiskHashMappedTrie> OnDiskHashMappedTrie::create( |
| 1269 | + const Twine &PathTwine, const Twine &TrieNameTwine, size_t NumHashBits, |
| 1270 | + uint64_t DataSize, uint64_t MaxFileSize, |
| 1271 | + Optional<uint64_t> NewFileInitialSize, Optional<size_t> NewTableNumRootBits, |
| 1272 | + Optional<size_t> NewTableNumSubtrieBits) { |
| 1273 | + llvm_unreachable("not supported"); |
| 1274 | +} |
| 1275 | + |
| 1276 | +OnDiskHashMappedTrie::pointer |
| 1277 | +OnDiskHashMappedTrie::insertLazy(const_pointer Hint, ArrayRef<uint8_t> Hash, |
| 1278 | + LazyInsertOnConstructCB OnConstruct, |
| 1279 | + LazyInsertOnLeakCB OnLeak) { |
| 1280 | + llvm_unreachable("not supported"); |
| 1281 | +} |
| 1282 | + |
| 1283 | +OnDiskHashMappedTrie::const_pointer |
| 1284 | +OnDiskHashMappedTrie::recoverFromFileOffset(FileOffset Offset) const { |
| 1285 | + llvm_unreachable("not supported"); |
| 1286 | +} |
| 1287 | + |
| 1288 | +OnDiskHashMappedTrie::const_pointer |
| 1289 | +OnDiskHashMappedTrie::find(ArrayRef<uint8_t> Hash) const { |
| 1290 | + llvm_unreachable("not supported"); |
| 1291 | +} |
| 1292 | + |
| 1293 | +void OnDiskHashMappedTrie::print( |
| 1294 | + raw_ostream &OS, function_ref<void(ArrayRef<char>)> PrintRecordData) const { |
| 1295 | + llvm_unreachable("not supported"); |
| 1296 | +} |
| 1297 | + |
| 1298 | +struct OnDiskDataAllocator::ImplType {}; |
| 1299 | + |
| 1300 | +Expected<OnDiskDataAllocator> |
| 1301 | +OnDiskDataAllocator::create(const Twine &PathTwine, const Twine &TableNameTwine, |
| 1302 | + uint64_t MaxFileSize, |
| 1303 | + Optional<uint64_t> NewFileInitialSize) { |
| 1304 | + llvm_unreachable("not supported"); |
| 1305 | +} |
| 1306 | + |
| 1307 | +OnDiskDataAllocator::pointer OnDiskDataAllocator::allocate(size_t Size) { |
| 1308 | + llvm_unreachable("not supported"); |
| 1309 | +} |
| 1310 | + |
| 1311 | +const char *OnDiskDataAllocator::beginData(FileOffset Offset) const { |
| 1312 | + llvm_unreachable("not supported"); |
| 1313 | +} |
| 1314 | + |
| 1315 | +#endif // LLVM_ENABLE_ONDISK_CAS |
| 1316 | + |
| 1317 | +OnDiskHashMappedTrie::OnDiskHashMappedTrie(std::unique_ptr<ImplType> Impl) |
| 1318 | + : Impl(std::move(Impl)) {} |
| 1319 | +OnDiskHashMappedTrie::OnDiskHashMappedTrie(OnDiskHashMappedTrie &&RHS) = |
| 1320 | + default; |
| 1321 | +OnDiskHashMappedTrie & |
| 1322 | +OnDiskHashMappedTrie::operator=(OnDiskHashMappedTrie &&RHS) = default; |
| 1323 | +OnDiskHashMappedTrie::~OnDiskHashMappedTrie() = default; |
| 1324 | + |
1269 | 1325 | OnDiskDataAllocator::OnDiskDataAllocator(OnDiskDataAllocator &&RHS) = default;
|
1270 | 1326 | OnDiskDataAllocator &
|
1271 | 1327 | OnDiskDataAllocator::operator=(OnDiskDataAllocator &&RHS) = default;
|
|
0 commit comments