]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lld/ELF/AArch64ErrataFix.h
Merge lld trunk r338150, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lld / ELF / AArch64ErrataFix.h
1 //===- AArch64ErrataFix.h ---------------------------------------*- C++ -*-===//
2 //
3 //                             The LLVM Linker
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLD_ELF_AARCH64ERRATAFIX_H
11 #define LLD_ELF_AARCH64ERRATAFIX_H
12
13 #include "lld/Common/LLVM.h"
14 #include <map>
15 #include <vector>
16
17 namespace lld {
18 namespace elf {
19
20 class Defined;
21 class InputSection;
22 struct InputSectionDescription;
23 class OutputSection;
24 class Patch843419Section;
25
26 class AArch64Err843419Patcher {
27 public:
28   // return true if Patches have been added to the OutputSections.
29   bool createFixes();
30
31 private:
32   std::vector<Patch843419Section *>
33   patchInputSectionDescription(InputSectionDescription &ISD);
34
35   void insertPatches(InputSectionDescription &ISD,
36                      std::vector<Patch843419Section *> &Patches);
37
38   void init();
39
40   // A cache of the mapping symbols defined by the InputSecion sorted in order
41   // of ascending value with redundant symbols removed. These describe
42   // the ranges of code and data in an executable InputSection.
43   std::map<InputSection *, std::vector<const Defined *>> SectionMap;
44
45   bool Initialized = false;
46 };
47
48 } // namespace elf
49 } // namespace lld
50
51 #endif