Path: blob/main/contrib/llvm-project/lld/COFF/COFFLinkerContext.h
34870 views
//===- COFFLinkerContext.h --------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLD_COFF_COFFLINKERCONTEXT_H9#define LLD_COFF_COFFLINKERCONTEXT_H1011#include "Chunks.h"12#include "Config.h"13#include "DebugTypes.h"14#include "Driver.h"15#include "InputFiles.h"16#include "SymbolTable.h"17#include "Writer.h"18#include "lld/Common/CommonLinkerContext.h"19#include "lld/Common/Timer.h"2021namespace lld::coff {2223class COFFLinkerContext : public CommonLinkerContext {24public:25COFFLinkerContext();26COFFLinkerContext(const COFFLinkerContext &) = delete;27COFFLinkerContext &operator=(const COFFLinkerContext &) = delete;28~COFFLinkerContext() = default;2930LinkerDriver driver;31SymbolTable symtab;32COFFOptTable optTable;3334std::vector<ObjFile *> objFileInstances;35std::map<std::string, PDBInputFile *> pdbInputFileInstances;36std::vector<ImportFile *> importFileInstances;37std::vector<BitcodeFile *> bitcodeFileInstances;3839MergeChunk *mergeChunkInstances[Log2MaxSectionAlignment + 1] = {};4041/// All sources of type information in the program.42std::vector<TpiSource *> tpiSourceList;4344void addTpiSource(TpiSource *tpi) { tpiSourceList.push_back(tpi); }4546std::map<llvm::codeview::GUID, TpiSource *> typeServerSourceMappings;47std::map<uint32_t, TpiSource *> precompSourceMappings;4849/// List of all output sections. After output sections are finalized, this50/// can be indexed by getOutputSection.51std::vector<OutputSection *> outputSections;5253OutputSection *getOutputSection(const Chunk *c) const {54return c->osidx == 0 ? nullptr : outputSections[c->osidx - 1];55}5657// Fake sections for parsing bitcode files.58FakeSection ltoTextSection;59FakeSection ltoDataSection;60FakeSectionChunk ltoTextSectionChunk;61FakeSectionChunk ltoDataSectionChunk;6263// All timers used in the COFF linker.64Timer rootTimer;65Timer inputFileTimer;66Timer ltoTimer;67Timer gcTimer;68Timer icfTimer;6970// Writer timers.71Timer codeLayoutTimer;72Timer outputCommitTimer;73Timer totalMapTimer;74Timer symbolGatherTimer;75Timer symbolStringsTimer;76Timer writeTimer;7778// PDB timers.79Timer totalPdbLinkTimer;80Timer addObjectsTimer;81Timer typeMergingTimer;82Timer loadGHashTimer;83Timer mergeGHashTimer;84Timer symbolMergingTimer;85Timer publicsLayoutTimer;86Timer tpiStreamLayoutTimer;87Timer diskCommitTimer;8889Configuration config;90};9192} // namespace lld::coff9394#endif959697