xref: /freebsd/contrib/llvm-project/llvm/tools/llvm-dwarfutil/Options.h (revision 7a6dacaca14b62ca4b74406814becb87a3fefac0)
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 
12 #include <cstdint>
13 #include <string>
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 
27 /// The kind of accelerator table.
28 enum class DwarfUtilAccelKind : uint8_t {
29   None,
30   DWARF // DWARFv5: .debug_names
31 };
32 
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;
43   bool UseDWARFLinkerParallel = false;
44   DwarfUtilAccelKind AccelTableKind = DwarfUtilAccelKind::None;
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
55