blob: e3cfa421da9134d81a628ee4b87fdf409ca4b746 [file] [log] [blame]
Chris Wailes2f380c12022-11-09 13:04:22 -08001//===- 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 Wailesc25c0452024-05-02 11:11:34 -070012#include <cstdint>
13#include <string>
Chris Wailes2f380c12022-11-09 13:04:22 -080014
15namespace llvm {
16namespace dwarfutil {
17
18/// The kind of tombstone value.
19enum 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
Charisee635618d2023-06-01 20:46:00 +000027/// The kind of accelerator table.
28enum class DwarfUtilAccelKind : uint8_t {
29 None,
30 DWARF // DWARFv5: .debug_names
31};
32
Chris Wailes2f380c12022-11-09 13:04:22 -080033struct 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 Wailesc25c0452024-05-02 11:11:34 -070043 bool UseDWARFLinkerParallel = false;
Charisee635618d2023-06-01 20:46:00 +000044 DwarfUtilAccelKind AccelTableKind = DwarfUtilAccelKind::None;
Chris Wailes2f380c12022-11-09 13:04:22 -080045
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