diff options
Diffstat (limited to 'include/llvm/DebugInfo/PDB/Raw/ModInfo.h')
| -rw-r--r-- | include/llvm/DebugInfo/PDB/Raw/ModInfo.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/include/llvm/DebugInfo/PDB/Raw/ModInfo.h b/include/llvm/DebugInfo/PDB/Raw/ModInfo.h index b8da0bfabf386..bf5cf53b3313a 100644 --- a/include/llvm/DebugInfo/PDB/Raw/ModInfo.h +++ b/include/llvm/DebugInfo/PDB/Raw/ModInfo.h @@ -11,24 +11,26 @@ #define LLVM_DEBUGINFO_PDB_RAW_MODINFO_H #include "llvm/ADT/StringRef.h" -#include "llvm/DebugInfo/CodeView/StreamArray.h" -#include "llvm/DebugInfo/CodeView/StreamRef.h" +#include "llvm/DebugInfo/MSF/StreamArray.h" +#include "llvm/DebugInfo/MSF/StreamRef.h" +#include "llvm/DebugInfo/PDB/Raw/RawTypes.h" +#include "llvm/Support/Error.h" #include <cstdint> #include <vector> namespace llvm { + namespace pdb { class ModInfo { -private: - struct FileLayout; + friend class DbiStreamBuilder; public: ModInfo(); ModInfo(const ModInfo &Info); ~ModInfo(); - static Error initialize(codeview::StreamRef Stream, ModInfo &Info); + static Error initialize(msf::ReadableStreamRef Stream, ModInfo &Info); bool hasECInfo() const; uint16_t getTypeServerIndex() const; @@ -48,13 +50,12 @@ public: private: StringRef ModuleName; StringRef ObjFileName; - const FileLayout *Layout; + const ModuleInfoHeader *Layout = nullptr; }; struct ModuleInfoEx { ModuleInfoEx(const ModInfo &Info) : Info(Info) {} - ModuleInfoEx(const ModuleInfoEx &Ex) - : Info(Ex.Info), SourceFiles(Ex.SourceFiles) {} + ModuleInfoEx(const ModuleInfoEx &Ex) = default; ModInfo Info; std::vector<StringRef> SourceFiles; @@ -62,9 +63,10 @@ struct ModuleInfoEx { } // end namespace pdb -namespace codeview { +namespace msf { + template <> struct VarStreamArrayExtractor<pdb::ModInfo> { - Error operator()(StreamRef Stream, uint32_t &Length, + Error operator()(ReadableStreamRef Stream, uint32_t &Length, pdb::ModInfo &Info) const { if (auto EC = pdb::ModInfo::initialize(Stream, Info)) return EC; @@ -72,7 +74,8 @@ template <> struct VarStreamArrayExtractor<pdb::ModInfo> { return Error::success(); } }; -} + +} // end namespace msf } // end namespace llvm |
