aboutsummaryrefslogtreecommitdiff
path: root/lib/Object/Archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Object/Archive.cpp')
-rw-r--r--lib/Object/Archive.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/Object/Archive.cpp b/lib/Object/Archive.cpp
index 8ec115a5566c..49e66f46ab3f 100644
--- a/lib/Object/Archive.cpp
+++ b/lib/Object/Archive.cpp
@@ -1,9 +1,8 @@
//===- Archive.cpp - ar File Format implementation ------------------------===//
//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
@@ -512,7 +511,7 @@ Expected<MemoryBufferRef> Archive::Child::getMemoryBufferRef() const {
StringRef Name = NameOrErr.get();
Expected<StringRef> Buf = getBuffer();
if (!Buf)
- return Buf.takeError();
+ return createFileError(Name, Buf.takeError());
return MemoryBufferRef(*Buf, Name);
}
@@ -779,19 +778,18 @@ Archive::child_iterator Archive::child_begin(Error &Err,
return child_end();
if (SkipInternal)
- return child_iterator(Child(this, FirstRegularData,
- FirstRegularStartOfFile),
- &Err);
+ return child_iterator::itr(
+ Child(this, FirstRegularData, FirstRegularStartOfFile), Err);
const char *Loc = Data.getBufferStart() + strlen(Magic);
Child C(this, Loc, &Err);
if (Err)
return child_end();
- return child_iterator(C, &Err);
+ return child_iterator::itr(C, Err);
}
Archive::child_iterator Archive::child_end() const {
- return child_iterator(Child(nullptr, nullptr, nullptr), nullptr);
+ return child_iterator::end(Child(nullptr, nullptr, nullptr));
}
StringRef Archive::Symbol::getName() const {