221
|
1 //===- UnwindInfoSection.h ------------------------------------------------===//
|
|
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 //===----------------------------------------------------------------------===//
|
|
8
|
|
9 #ifndef LLD_MACHO_UNWIND_INFO_H
|
|
10 #define LLD_MACHO_UNWIND_INFO_H
|
|
11
|
|
12 #include "ConcatOutputSection.h"
|
|
13 #include "SyntheticSections.h"
|
236
|
14 #include "llvm/ADT/MapVector.h"
|
221
|
15
|
236
|
16 namespace lld::macho {
|
221
|
17
|
|
18 class UnwindInfoSection : public SyntheticSection {
|
|
19 public:
|
236
|
20 // If all functions are free of unwind info, we can omit the unwind info
|
|
21 // section entirely.
|
|
22 bool isNeeded() const override { return !allEntriesAreOmitted; }
|
|
23 void addSymbol(const Defined *);
|
|
24 virtual void prepare() = 0;
|
221
|
25
|
|
26 protected:
|
223
|
27 UnwindInfoSection();
|
221
|
28
|
236
|
29 llvm::MapVector<std::pair<const InputSection *, uint64_t /*Defined::value*/>,
|
|
30 const Defined *>
|
|
31 symbols;
|
223
|
32 bool allEntriesAreOmitted = true;
|
221
|
33 };
|
|
34
|
|
35 UnwindInfoSection *makeUnwindInfoSection();
|
|
36
|
236
|
37 } // namespace lld::macho
|
221
|
38
|
|
39 #endif
|