| 1 | //===- PDB.h ----------------------------------------------------*- C++ -*-===// |
|---|---|
| 2 | // |
| 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #ifndef LLD_COFF_PDB_H |
| 10 | #define LLD_COFF_PDB_H |
| 11 | |
| 12 | #include "llvm/ADT/ArrayRef.h" |
| 13 | #include "llvm/ADT/StringRef.h" |
| 14 | #include <optional> |
| 15 | |
| 16 | namespace llvm::codeview { |
| 17 | union DebugInfo; |
| 18 | } |
| 19 | |
| 20 | namespace lld { |
| 21 | class Timer; |
| 22 | |
| 23 | namespace coff { |
| 24 | class SectionChunk; |
| 25 | class COFFLinkerContext; |
| 26 | |
| 27 | void createPDB(COFFLinkerContext &ctx, llvm::ArrayRef<uint8_t> sectionTable, |
| 28 | llvm::codeview::DebugInfo *buildId); |
| 29 | |
| 30 | std::optional<std::pair<llvm::StringRef, uint32_t>> |
| 31 | getFileLineCodeView(const SectionChunk *c, uint32_t addr); |
| 32 | |
| 33 | // For statistics |
| 34 | struct PDBStats { |
| 35 | uint64_t globalSymbols = 0; |
| 36 | uint64_t moduleSymbols = 0; |
| 37 | uint64_t publicSymbols = 0; |
| 38 | uint64_t nbTypeRecords = 0; |
| 39 | uint64_t nbTypeRecordsBytes = 0; |
| 40 | uint64_t nbTPIrecords = 0; |
| 41 | uint64_t nbIPIrecords = 0; |
| 42 | uint64_t strTabSize = 0; |
| 43 | std::string largeInputTypeRecs; |
| 44 | }; |
| 45 | |
| 46 | } // namespace coff |
| 47 | } // namespace lld |
| 48 | |
| 49 | #endif |
| 50 |