1326947Sdim//===- AArch64ErrataFix.h ---------------------------------------*- C++ -*-===//
2326947Sdim//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6326947Sdim//
7326947Sdim//===----------------------------------------------------------------------===//
8326947Sdim
9326947Sdim#ifndef LLD_ELF_AARCH64ERRATAFIX_H
10326947Sdim#define LLD_ELF_AARCH64ERRATAFIX_H
11326947Sdim
12326947Sdim#include "lld/Common/LLVM.h"
13326947Sdim#include <map>
14326947Sdim#include <vector>
15326947Sdim
16326947Sdimnamespace lld {
17326947Sdimnamespace elf {
18326947Sdim
19326947Sdimclass Defined;
20326947Sdimclass InputSection;
21326947Sdimstruct InputSectionDescription;
22326947Sdimclass OutputSection;
23326947Sdimclass Patch843419Section;
24326947Sdim
25326947Sdimclass AArch64Err843419Patcher {
26326947Sdimpublic:
27326947Sdim  // return true if Patches have been added to the OutputSections.
28326947Sdim  bool createFixes();
29326947Sdim
30326947Sdimprivate:
31326947Sdim  std::vector<Patch843419Section *>
32353358Sdim  patchInputSectionDescription(InputSectionDescription &isd);
33326947Sdim
34353358Sdim  void insertPatches(InputSectionDescription &isd,
35353358Sdim                     std::vector<Patch843419Section *> &patches);
36326947Sdim
37326947Sdim  void init();
38326947Sdim
39353358Sdim  // A cache of the mapping symbols defined by the InputSection sorted in order
40326947Sdim  // of ascending value with redundant symbols removed. These describe
41326947Sdim  // the ranges of code and data in an executable InputSection.
42353358Sdim  std::map<InputSection *, std::vector<const Defined *>> sectionMap;
43326947Sdim
44353358Sdim  bool initialized = false;
45326947Sdim};
46326947Sdim
47326947Sdim} // namespace elf
48326947Sdim} // namespace lld
49326947Sdim
50326947Sdim#endif
51