LLVM: lib/DebugInfo/PDB/Native/InjectedSourceStream.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
10
17
18using namespace llvm;
22
24 std::unique_ptr Stream)
25 : Stream(std::move(Stream)) {}
26
29
30 if (auto EC = Reader.readObject(Header))
31 return EC;
32
33 if (Header->Version !=
36 "Invalid headerblock header version");
37
38 if (auto EC = InjectedSourceTable.load(Reader))
39 return EC;
40
41 for (const auto& Entry : *this) {
44 "Invalid headerbock entry size");
45 if (Entry.second.Version !=
48 "Invalid headerbock entry version");
49
50
51 auto Name = Strings.getStringForID(Entry.second.FileNI);
52 if (!Name)
53 return Name.takeError();
54 auto ObjName = Strings.getStringForID(Entry.second.ObjNI);
55 if (!ObjName)
56 return ObjName.takeError();
57 auto VName = Strings.getStringForID(Entry.second.VFileNI);
58 if (!VName)
59 return VName.takeError();
60 }
61
64}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Provides read only access to a subclass of BinaryStream.
Error readObject(const T *&Dest)
Get a pointer to an object of type T from the underlying stream, as if by memcpy, and store the resul...
uint64_t bytesRemaining() const
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Error reload(const PDBStringTable &Strings)
Definition InjectedSourceStream.cpp:27
InjectedSourceStream(std::unique_ptr< msf::MappedBlockStream > Stream)
Definition InjectedSourceStream.cpp:23
LLVM_ABI Expected< StringRef > getStringForID(uint32_t ID) const
This is an optimization pass for GlobalISel generic memory operations.
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.