1 //===- ModInfoBuilder.h - PDB module information ----------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_PDB_RAW_MODINFOBUILDER_H
11 #define LLVM_DEBUGINFO_PDB_RAW_MODINFOBUILDER_H
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
15 #include "llvm/DebugInfo/PDB/Native/RawTypes.h"
16 #include "llvm/Support/Error.h"
22 class BinaryStreamWriter;
30 class ModInfoBuilder {
31 friend class DbiStreamBuilder;
34 ModInfoBuilder(StringRef ModuleName, uint32_t ModIndex, msf::MSFBuilder &Msf);
36 ModInfoBuilder(const ModInfoBuilder &) = delete;
37 ModInfoBuilder &operator=(const ModInfoBuilder &) = delete;
39 void setObjFileName(StringRef Name);
40 void addSymbol(codeview::CVSymbol Symbol);
42 uint16_t getStreamIndex() const;
43 StringRef getModuleName() const { return ModuleName; }
44 StringRef getObjFileName() const { return ObjFileName; }
46 ArrayRef<std::string> source_files() const {
47 return makeArrayRef(SourceFiles);
50 uint32_t calculateSerializedLength() const;
53 Error finalizeMsfLayout();
55 Error commit(BinaryStreamWriter &ModiWriter, const msf::MSFLayout &MsfLayout,
56 WritableBinaryStreamRef MsfBuffer);
59 void addSourceFile(StringRef Path);
62 uint32_t SymbolByteSize = 0;
63 std::string ModuleName;
64 std::string ObjFileName;
65 std::vector<std::string> SourceFiles;
66 std::vector<codeview::CVSymbol> Symbols;
67 ModuleInfoHeader Layout;
70 } // end namespace pdb
72 } // end namespace llvm
74 #endif // LLVM_DEBUGINFO_PDB_RAW_MODINFOBUILDER_H