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 | |
16 | namespace lld::coff { |
17 | COFFLinkerContext::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(<oTextSection.section), |
22 | ltoDataSectionChunk(<oDataSection.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 | |