Chris Wailes | 2f380c1 | 2022-11-09 13:04:22 -0800 | [diff] [blame] | 1 | //===- Options.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 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #ifndef LLVM_TOOLS_LLVM_DWARFUTIL_OPTIONS_H |
| 10 | #define LLVM_TOOLS_LLVM_DWARFUTIL_OPTIONS_H |
| 11 | |
Chris Wailes | c25c045 | 2024-05-02 11:11:34 -0700 | [diff] [blame] | 12 | #include <cstdint> |
| 13 | #include <string> |
Chris Wailes | 2f380c1 | 2022-11-09 13:04:22 -0800 | [diff] [blame] | 14 | |
| 15 | namespace llvm { |
| 16 | namespace dwarfutil { |
| 17 | |
| 18 | /// The kind of tombstone value. |
| 19 | enum class TombstoneKind { |
| 20 | BFD, /// 0/[1:1]. Bfd default. |
| 21 | MaxPC, /// -1/-2. Assumed to match with |
| 22 | /// http://www.dwarfstd.org/ShowIssue.php?issue=200609.1. |
| 23 | Universal, /// both: BFD + MaxPC |
| 24 | Exec, /// match with address range of executable sections. |
| 25 | }; |
| 26 | |
Charisee | 635618d | 2023-06-01 20:46:00 +0000 | [diff] [blame] | 27 | /// The kind of accelerator table. |
| 28 | enum class DwarfUtilAccelKind : uint8_t { |
| 29 | None, |
| 30 | DWARF // DWARFv5: .debug_names |
| 31 | }; |
| 32 | |
Chris Wailes | 2f380c1 | 2022-11-09 13:04:22 -0800 | [diff] [blame] | 33 | struct Options { |
| 34 | std::string InputFileName; |
| 35 | std::string OutputFileName; |
| 36 | bool DoGarbageCollection = false; |
| 37 | bool DoODRDeduplication = false; |
| 38 | bool BuildSeparateDebugFile = false; |
| 39 | TombstoneKind Tombstone = TombstoneKind::Universal; |
| 40 | bool Verbose = false; |
| 41 | int NumThreads = 0; |
| 42 | bool Verify = false; |
Chris Wailes | c25c045 | 2024-05-02 11:11:34 -0700 | [diff] [blame] | 43 | bool UseDWARFLinkerParallel = false; |
Charisee | 635618d | 2023-06-01 20:46:00 +0000 | [diff] [blame] | 44 | DwarfUtilAccelKind AccelTableKind = DwarfUtilAccelKind::None; |
Chris Wailes | 2f380c1 | 2022-11-09 13:04:22 -0800 | [diff] [blame] | 45 | |
| 46 | std::string getSeparateDebugFileName() const { |
| 47 | return OutputFileName + ".debug"; |
| 48 | } |
| 49 | }; |
| 50 | |
| 51 | } // namespace dwarfutil |
| 52 | } // namespace llvm |
| 53 | |
| 54 | #endif // LLVM_TOOLS_LLVM_DWARFUTIL_OPTIONS_H |