Skip to content

Commit 3eb7713

Browse files
ObjectContainerBSDArchive.cpp
1 parent cac268d commit 3eb7713

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ size_t ObjectContainerBSDArchive::Archive::ParseObjects() {
8181

8282
std::unique_ptr<llvm::MemoryBuffer> mem_buffer =
8383
llvm::MemoryBuffer::getMemBuffer(
84-
llvm::StringRef((const char *)data.GetDataStart(),
85-
data.GetByteSize()),
86-
llvm::StringRef(),
87-
/*RequiresNullTerminator=*/false);
84+
llvm::StringRef((const char *)data.GetDataStart(),
85+
data.GetByteSize()),
86+
llvm::StringRef(),
87+
/*RequiresNullTerminator=*/false);
8888

8989
auto exp_ar = llvm::object::Archive::create(mem_buffer->getMemBufferRef());
9090
if (!exp_ar) {
@@ -95,7 +95,7 @@ size_t ObjectContainerBSDArchive::Archive::ParseObjects() {
9595

9696
llvm::Error iter_err = llvm::Error::success();
9797
Object obj;
98-
for (const auto &child: llvm_archive->children(iter_err)) {
98+
for (const auto &child : llvm_archive->children(iter_err)) {
9999
obj.Clear();
100100
auto exp_name = child.getName();
101101
if (exp_name) {
@@ -111,7 +111,9 @@ size_t ObjectContainerBSDArchive::Archive::ParseObjects() {
111111
obj.modification_time =
112112
std::chrono::duration_cast<std::chrono::seconds>(
113113
std::chrono::time_point_cast<std::chrono::seconds>(
114-
exp_mtime.get()).time_since_epoch()).count();
114+
exp_mtime.get())
115+
.time_since_epoch())
116+
.count();
115117
} else {
116118
LLDB_LOG_ERROR(l, exp_mtime.takeError(),
117119
"failed to get archive object time: {0}");
@@ -331,21 +333,21 @@ ObjectContainer *ObjectContainerBSDArchive::CreateInstance(
331333
ArchiveType
332334
ObjectContainerBSDArchive::MagicBytesMatch(const DataExtractor &data) {
333335
uint32_t offset = 0;
334-
const char *armag = (const char *)data.PeekData(offset,
335-
sizeof(ar_hdr) + SARMAG);
336+
const char *armag =
337+
(const char *)data.PeekData(offset, sizeof(ar_hdr) + SARMAG);
336338
if (armag == nullptr)
337339
return ArchiveType::Invalid;
338340
ArchiveType result = ArchiveType::Invalid;
339341
if (strncmp(armag, ArchiveMagic, SARMAG) == 0)
340-
result = ArchiveType::Archive;
342+
result = ArchiveType::Archive;
341343
else if (strncmp(armag, ThinArchiveMagic, SARMAG) == 0)
342-
result = ArchiveType::ThinArchive;
344+
result = ArchiveType::ThinArchive;
343345
else
344-
return ArchiveType::Invalid;
346+
return ArchiveType::Invalid;
345347

346348
armag += offsetof(struct ar_hdr, ar_fmag) + SARMAG;
347349
if (strncmp(armag, ARFMAG, 2) == 0)
348-
return result;
350+
return result;
349351
return ArchiveType::Invalid;
350352
}
351353

@@ -443,7 +445,8 @@ size_t ObjectContainerBSDArchive::GetModuleSpecifications(
443445
return 0;
444446

445447
const size_t initial_count = specs.GetSize();
446-
llvm::sys::TimePoint<> file_mod_time = FileSystem::Instance().GetModificationTime(file);
448+
llvm::sys::TimePoint<> file_mod_time =
449+
FileSystem::Instance().GetModificationTime(file);
447450
Archive::shared_ptr archive_sp(
448451
Archive::FindCachedArchive(file, ArchSpec(), file_mod_time, file_offset));
449452
bool set_archive_arch = false;

0 commit comments

Comments
 (0)