31 return make_error<CodeViewError>(
33 "Not enough bytes for a Cross Module Import Header!");
34 if (
auto EC = Reader.readObject(Item.
Header))
37 return make_error<CodeViewError>(
39 "Not enough to read specified number of Cross Module References!");
57 Strings.insert(Module);
59 auto Result = Mappings.insert(std::make_pair(Module, Targets));
61 Result.first->getValue().push_back(Targets[0]);
66 for (
const auto &Item : Mappings) {
75 using T = decltype(&*Mappings.begin());
77 Ids.reserve(Mappings.size());
79 for (
const auto &M : Mappings)
83 return Strings.getIdForString(L1->getKey()) <
84 Strings.getIdForString(L2->getKey());
87 for (
const auto &Item : Ids) {
90 Imp.
Count = Item->getValue().size();
Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
support::ulittle32_t Count
uint32_t calculateSerializedSize() const override
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
const CrossModuleImport * Header
Error writeArray(ArrayRef< T > Array)
Writes an array of objects of type T to the underlying stream, as if by using memcpy.
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
Provides write only access to a subclass of WritableBinaryStream.
support::ulittle32_t ModuleNameOffset
void addImport(StringRef Module, uint32_t ImportId)
void sort(IteratorTy Start, IteratorTy End)
static ErrorSuccess success()
Create a success value.
Error commit(BinaryStreamWriter &Writer) const override
FixedStreamArray< support::ulittle32_t > Imports
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Error initialize(BinaryStreamReader Reader)
uint32_t bytesRemaining() const
Lightweight error class with error context and mandatory checking.
Provides read only access to a subclass of BinaryStream.
StringRef - Represent a constant reference to a string, i.e.
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 ...