29 return make_error<CodeViewError>(
30 cv_error_code::insufficient_buffer,
31 "Not enough bytes for a Cross Module Import Header!");
32 if (
auto EC = Reader.readObject(Item.
Header))
35 return make_error<CodeViewError>(
36 cv_error_code::insufficient_buffer,
37 "Not enough to read specified number of Cross Module References!");
57 auto Result = Mappings.insert(std::make_pair(
Module, Targets));
59 Result.first->getValue().push_back(Targets[0]);
64 for (
const auto &Item : Mappings) {
73 using T =
decltype(&*Mappings.begin());
75 Ids.reserve(Mappings.size());
77 for (
const auto &M : Mappings)
85 for (
const auto &Item : Ids) {
88 Imp.
Count = Item->getValue().size();
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Provides read only access to a subclass of BinaryStream.
uint64_t bytesRemaining() const
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Get a reference to a NumElements element array of objects of type T from the underlying stream as if ...
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Provides write only access to a subclass of WritableBinaryStream.
Error writeArray(ArrayRef< T > Array)
Writes an array of objects of type T to the underlying stream, as if by using memcpy.
Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
A Module instance is used to store all the information related to an LLVM module.
StringRef - Represent a constant reference to a string, i.e.
Error initialize(BinaryStreamReader Reader)
void addImport(StringRef Module, uint32_t ImportId)
uint32_t calculateSerializedSize() const override
Error commit(BinaryStreamWriter &Writer) const override
uint32_t getIdForString(StringRef S) const
uint32_t insert(StringRef S)
detail::packed_endian_specific_integral< uint32_t, llvm::endianness::little, unaligned > ulittle32_t
This is an optimization pass for GlobalISel generic memory operations.
void sort(IteratorTy Start, IteratorTy End)
FixedStreamArray< support::ulittle32_t > Imports
const CrossModuleImport * Header
support::ulittle32_t Count
support::ulittle32_t ModuleNameOffset