diff options
Diffstat (limited to 'llvm/lib/Object/Archive.cpp')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index 5aada91ecc0..ba35e49faa6 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/lib/Object/Archive.cpp @@ -110,6 +110,12 @@ uint64_t Archive::Child::getSize() const { return Data.size() - StartOfFile; } +uint64_t Archive::Child::getRawSize() const { + if (Parent->IsThin) + return getHeader()->getSize(); + return Data.size(); +} + Archive::Child Archive::Child::getNext() const { size_t SpaceToSkip = Data.size(); // If it's odd, add 1 to make it even. @@ -125,6 +131,13 @@ Archive::Child Archive::Child::getNext() const { return Child(Parent, NextLoc); } +uint64_t Archive::Child::getChildOffset() const { + const char *a = Parent->Data.getBuffer().data(); + const char *c = Data.data(); + uint64_t offset = c - a; + return offset; +} + ErrorOr<StringRef> Archive::Child::getName() const { StringRef name = getRawName(); // Check if it's a special name. |