30 return make_error<CodeViewError>(
31 cv_error_code::insufficient_buffer,
32 "Not enough bytes for a Cross Module Import Header!");
33 if (
auto EC = Reader.readObject(Item.
Header))
36 return make_error<CodeViewError>(
37 cv_error_code::insufficient_buffer,
38 "Not enough to read specified number of Cross Module References!");
58 auto Result = Mappings.insert(std::make_pair(
Module, Targets));
60 Result.first->getValue().push_back(Targets[0]);
65 for (
const auto &Item : Mappings) {
74 using T =
decltype(&*Mappings.begin());
76 Ids.reserve(Mappings.size());
78 for (
const auto &M : Mappings)
86 for (
const auto &Item : Ids) {
89 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