[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / lld / ELF / ARMErrataFix.h
blob847b6ae527ff2b49943957351440cd0ef127a827
1 //===- ARMErrataFix.h -------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLD_ELF_ARMA8ERRATAFIX_H
10 #define LLD_ELF_ARMA8ERRATAFIX_H
12 #include "lld/Common/LLVM.h"
13 #include "llvm/ADT/DenseMap.h"
14 #include <vector>
16 namespace lld::elf {
17 struct Ctx;
18 class Defined;
19 class InputSection;
20 class InputSectionDescription;
21 class Patch657417Section;
23 class ARMErr657417Patcher {
24 public:
25 ARMErr657417Patcher(Ctx &ctx) : ctx(ctx) {}
26 // Return true if Patches have been added to the OutputSections.
27 bool createFixes();
29 private:
30 std::vector<Patch657417Section *>
31 patchInputSectionDescription(InputSectionDescription &isd);
33 void insertPatches(InputSectionDescription &isd,
34 std::vector<Patch657417Section *> &patches);
36 void init();
38 Ctx &ctx;
39 // A cache of the mapping symbols defined by the InputSection sorted in order
40 // of ascending value with redundant symbols removed. These describe
41 // the ranges of code and data in an executable InputSection.
42 llvm::DenseMap<InputSection *, std::vector<const Defined *>> sectionMap;
44 bool initialized = false;
47 } // namespace lld::elf
49 #endif