1//===- COFFContext.cpp ----------------------------------------------------===//
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-exception
5//
6//===----------------------------------------------------------------------===//
7//
8// Description
9//
10//===----------------------------------------------------------------------===//
11
12#include "COFFLinkerContext.h"
13#include "Symbols.h"
14#include "llvm/BinaryFormat/COFF.h"
15
16namespace lld::coff {
17COFFLinkerContext::COFFLinkerContext()
18 : driver(*this), symtab(*this),
19 ltoTextSection(llvm::COFF::IMAGE_SCN_MEM_EXECUTE),
20 ltoDataSection(llvm::COFF::IMAGE_SCN_CNT_INITIALIZED_DATA),
21 ltoTextSectionChunk(&ltoTextSection.section),
22 ltoDataSectionChunk(&ltoDataSection.section),
23 rootTimer("Total Linking Time"),
24 inputFileTimer("Input File Reading", rootTimer),
25 ltoTimer("LTO", rootTimer), gcTimer("GC", rootTimer),
26 icfTimer("ICF", rootTimer), codeLayoutTimer("Code Layout", rootTimer),
27 outputCommitTimer("Commit Output File", rootTimer),
28 totalMapTimer("MAP Emission (Cumulative)", rootTimer),
29 symbolGatherTimer("Gather Symbols", totalMapTimer),
30 symbolStringsTimer("Build Symbol Strings", totalMapTimer),
31 writeTimer("Write to File", totalMapTimer),
32 totalPdbLinkTimer("PDB Emission (Cumulative)", rootTimer),
33 addObjectsTimer("Add Objects", totalPdbLinkTimer),
34 typeMergingTimer("Type Merging", addObjectsTimer),
35 loadGHashTimer("Global Type Hashing", addObjectsTimer),
36 mergeGHashTimer("GHash Type Merging", addObjectsTimer),
37 symbolMergingTimer("Symbol Merging", addObjectsTimer),
38 publicsLayoutTimer("Publics Stream Layout", totalPdbLinkTimer),
39 tpiStreamLayoutTimer("TPI Stream Layout", totalPdbLinkTimer),
40 diskCommitTimer("Commit to Disk", totalPdbLinkTimer) {}
41} // namespace lld::coff
42

Provided by KDAB

Privacy Policy
Update your C++ knowledge – Modern C++11/14/17 Training
Find out more

source code of lld/COFF/COFFLinkerContext.cpp