Skip to content

Commit e5263c6

Browse files
Rebase change to latest
1 parent 3f26afc commit e5263c6

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

llvm/include/llvm/CAS/BuiltinObjectHasher.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ template <class HasherT> class BuiltinObjectHasher {
6767
}
6868

6969
void updateSize(uint64_t Size) {
70-
Size = support::endian::byte_swap(Size, support::endianness::little);
70+
Size = support::endian::byte_swap(Size, endianness::little);
7171
Hasher.update(
7272
ArrayRef(reinterpret_cast<const uint8_t *>(&Size), sizeof(Size)));
7373
}

llvm/lib/CAS/TreeSchema.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ TreeProxy::Builder::build(ArrayRef<NamedTreeEntry> Entries) {
195195
Sorted.erase(std::unique(Sorted.begin(), Sorted.end()), Sorted.end());
196196

197197
raw_svector_ostream OS(Data);
198-
support::endian::Writer Writer(OS, support::endianness::little);
198+
support::endian::Writer Writer(OS, endianness::little);
199199
// Encode the entires in the Data. The layout of the tree schema object is:
200200
// * Name offset table: The offset of in the data blob for where to find the
201201
// string. It has N + 1 entries and you can find the name of n-th entry at

llvm/lib/CAS/UnifiedOnDiskCache.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static Error getAllDBDirs(StringRef Path,
134134
if (DirI->type() != sys::fs::file_type::directory_file)
135135
continue;
136136
StringRef SubDir = sys::path::filename(DirI->path());
137-
if (!SubDir.startswith(DBDirPrefix))
137+
if (!SubDir.starts_with(DBDirPrefix))
138138
continue;
139139
uint64_t Order;
140140
if (SubDir.substr(DBDirPrefix.size()).getAsInteger(10, Order))
@@ -156,7 +156,7 @@ static Error getAllDBDirs(StringRef Path,
156156
/// \returns Given a sub-directory named 'v<version>.<x>', it outputs the
157157
/// 'v<version>.<x+1>' name.
158158
static void getNextDBDirName(StringRef DBDir, llvm::raw_ostream &OS) {
159-
assert(DBDir.startswith(DBDirPrefix));
159+
assert(DBDir.starts_with(DBDirPrefix));
160160
uint64_t Count;
161161
bool Failed = DBDir.substr(DBDirPrefix.size()).getAsInteger(10, Count);
162162
assert(!Failed);

llvm/tools/libCASPluginTest/libCASPluginTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct CASWrapper {
112112
/// Used for testing the \c globally parameter of action cache APIs. Simulates
113113
/// "uploading"/"downloading" objects from/to the primary on-disk path.
114114
std::unique_ptr<UnifiedOnDiskCache> UpstreamDB;
115-
ThreadPool Pool{llvm::hardware_concurrency()};
115+
StdThreadPool Pool{llvm::hardware_concurrency()};
116116

117117
std::mutex Lock{};
118118

llvm/unittests/ADT/TrieRawHashMapTest.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "llvm/ADT/TrieRawHashMap.h"
1010
#include "llvm/ADT/Twine.h"
11+
#include "llvm/ADT/bit.h"
1112
#include "llvm/Support/Endian.h"
1213
#include "llvm/Support/SHA1.h"
1314
#include "gtest/gtest.h"
@@ -72,7 +73,8 @@ class SimpleTrieHashMapTest : public TrieRawHashMapTestHelper,
7273

7374
// Use the number itself as hash to test the pathological case.
7475
static HashType hash(uint64_t Num) {
75-
uint64_t HashN = llvm::support::endian::byte_swap(Num, llvm::support::big);
76+
uint64_t HashN =
77+
llvm::support::endian::byte_swap(Num, llvm::endianness::big);
7678
HashType Hash;
7779
memcpy(&Hash[0], &HashN, sizeof(HashType));
7880
return Hash;

llvm/unittests/CAS/ObjectStoreTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ static void testBlobsParallel(ObjectStore &Read1, ObjectStore &Read2,
330330
EXPECT_EQ(Node->getData(), Blobs[I]);
331331
};
332332

333-
ThreadPool Threads;
333+
StdThreadPool Threads;
334334
for (unsigned I = 0; I < BlobCount; ++I) {
335335
Threads.async(Consumer, I, &Read1);
336336
Threads.async(Consumer, I, &Read2);
@@ -432,15 +432,15 @@ TEST(OnDiskCASTest, DiskSize) {
432432
std::error_code EC;
433433
for (sys::fs::directory_iterator I(Temp.path(), EC), E; I != E && !EC;
434434
I.increment(EC)) {
435-
if (StringRef(I->path()).endswith(".index")) {
435+
if (StringRef(I->path()).ends_with(".index")) {
436436
FoundIndex = true;
437437
ASSERT_TRUE(I->status());
438438
if (Mapped)
439439
EXPECT_EQ(I->status()->getSize(), MaxSize);
440440
else
441441
EXPECT_LT(I->status()->getSize(), MaxSize);
442442
}
443-
if (StringRef(I->path()).endswith(".data")) {
443+
if (StringRef(I->path()).ends_with(".data")) {
444444
FoundData = true;
445445
ASSERT_TRUE(I->status());
446446
if (Mapped)

0 commit comments

Comments
 (0)