24 std::vector<NewArchiveMember> NewArchiveMembers;
43 Child,
Config.getCommonConfig().DeterministicArchives);
47 Member->Buf = std::make_unique<SmallVectorMemoryBuffer>(
48 std::move(Buffer), ChildNameOrErr.
get());
49 Member->MemberName = Member->Buf->getBufferIdentifier();
50 NewArchiveMembers.push_back(std::move(*Member));
55 return std::move(NewArchiveMembers);
89 std::copy(Member.Buf->getBufferStart(), Member.Buf->getBufferEnd(),
90 (*FB)->getBufferStart());
91 if (
Error E = (*FB)->commit())
101 if (!NewArchiveMembersOrErr)
102 return NewArchiveMembersOrErr.
takeError();
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
const T & front() const
front - Get the first element.
bool empty() const
empty - Check if the array is empty.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Error takeError()
Take ownership of the stored error.
reference get()
Returns a reference to the stored T value.
static Expected< std::unique_ptr< FileOutputBuffer > > create(StringRef FilePath, size_t Size, unsigned Flags=0)
Factory method to create an OutputBuffer object which manages a read/write buffer of the specified si...
@ F_executable
Set the 'x' bit on the resulting file.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
iterator_range< child_iterator > children(Error &Err, bool SkipInternal=true) const
bool hasSymbolTable() const
StringRef getFileName() const
A raw_ostream that writes to an SmallVector or SmallString.
static Error deepWriteArchive(StringRef ArcName, ArrayRef< NewArchiveMember > NewMembers, SymtabWritingMode WriteSymtab, object::Archive::Kind Kind, bool Deterministic, bool Thin)
Error executeObjcopyOnBinary(const MultiFormatConfig &Config, object::Binary &In, raw_ostream &Out)
Applies the transformations described by Config to In and writes the result into Out.
Error executeObjcopyOnArchive(const MultiFormatConfig &Config, const object::Archive &Ar)
Applies the transformations described by Config to each member in archive Ar.
Expected< std::vector< NewArchiveMember > > createNewArchiveMembers(const MultiFormatConfig &Config, const Archive &Ar)
Applies the transformations described by Config to each member in archive Ar.
This is an optimization pass for GlobalISel generic memory operations.
Error createFileError(const Twine &F, Error E)
Concatenate a source file path and/or name with an Error.
Error writeArchive(StringRef ArcName, ArrayRef< NewArchiveMember > NewMembers, SymtabWritingMode WriteSymtab, object::Archive::Kind Kind, bool Deterministic, bool Thin, std::unique_ptr< MemoryBuffer > OldArchiveBuf=nullptr, std::optional< bool > IsEC=std::nullopt, function_ref< void(Error)> Warn=warnToStderr)
static Expected< NewArchiveMember > getOldMember(const object::Archive::Child &OldMember, bool Deterministic)
bool DeterministicArchives