summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-02 18:30:13 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-02 18:30:13 +0000
commita303c417bbdb53703c2c17398b08486bde78f1f6 (patch)
tree98366d6b93d863cefdc53f16c66c0c5ae7fb2261 /include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
parent12f3ca4cdb95b193af905a00e722a4dcb40b3de3 (diff)
Notes
Diffstat (limited to 'include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h')
-rw-r--r--include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h b/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
new file mode 100644
index 000000000000..879cb4285cd7
--- /dev/null
+++ b/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h
@@ -0,0 +1,79 @@
+//===- DbiModuleDescriptor.h - PDB module information -----------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
+#define LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/DebugInfo/PDB/Native/RawTypes.h"
+#include "llvm/Support/BinaryStreamArray.h"
+#include "llvm/Support/BinaryStreamRef.h"
+#include "llvm/Support/Error.h"
+#include <cstdint>
+#include <vector>
+
+namespace llvm {
+
+namespace pdb {
+
+class DbiModuleDescriptor {
+ friend class DbiStreamBuilder;
+
+public:
+ DbiModuleDescriptor();
+ DbiModuleDescriptor(const DbiModuleDescriptor &Info);
+ ~DbiModuleDescriptor();
+
+ static Error initialize(BinaryStreamRef Stream, DbiModuleDescriptor &Info);
+
+ bool hasECInfo() const;
+ uint16_t getTypeServerIndex() const;
+ uint16_t getModuleStreamIndex() const;
+ uint32_t getSymbolDebugInfoByteSize() const;
+ uint32_t getC11LineInfoByteSize() const;
+ uint32_t getC13LineInfoByteSize() const;
+ uint32_t getNumberOfFiles() const;
+ uint32_t getSourceFileNameIndex() const;
+ uint32_t getPdbFilePathNameIndex() const;
+
+ StringRef getModuleName() const;
+ StringRef getObjFileName() const;
+
+ uint32_t getRecordLength() const;
+
+private:
+ StringRef ModuleName;
+ StringRef ObjFileName;
+ const ModuleInfoHeader *Layout = nullptr;
+};
+
+struct ModuleInfoEx {
+ ModuleInfoEx(const DbiModuleDescriptor &Info) : Info(Info) {}
+ ModuleInfoEx(const ModuleInfoEx &Ex) = default;
+
+ DbiModuleDescriptor Info;
+ std::vector<StringRef> SourceFiles;
+};
+
+} // end namespace pdb
+
+template <> struct VarStreamArrayExtractor<pdb::DbiModuleDescriptor> {
+ typedef void ContextType;
+ static Error extract(BinaryStreamRef Stream, uint32_t &Length,
+ pdb::DbiModuleDescriptor &Info, void *Ctx) {
+ if (auto EC = pdb::DbiModuleDescriptor::initialize(Stream, Info))
+ return EC;
+ Length = Info.getRecordLength();
+ return Error::success();
+ }
+};
+
+} // end namespace llvm
+
+#endif // LLVM_DEBUGINFO_PDB_RAW_DBIMODULEDESCRIPTOR_H