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 "llvm/Support/Compression.h"
13#include <cstdint>
14#include <optional>
15#include <string>
16
17namespace llvm {
18namespace dwarfutil {
19
20/// The kind of tombstone value.
21enum class TombstoneKind {
22 BFD, /// 0/[1:1]. Bfd default.
23 MaxPC, /// -1/-2. Assumed to match with
24 /// http://www.dwarfstd.org/ShowIssue.php?issue=200609.1.
25 Universal, /// both: BFD + MaxPC
26 Exec, /// match with address range of executable sections.
27};
28
29/// The kind of accelerator table.
30enum class DwarfUtilAccelKind : uint8_t {
31 None,
32 DWARF // DWARFv5: .debug_names
33};
34
35struct Options {
36 std::string InputFileName;
37 std::string OutputFileName;
38 bool DoGarbageCollection = false;
39 bool DoODRDeduplication = false;
40 bool BuildSeparateDebugFile = false;
41 TombstoneKind Tombstone = TombstoneKind::Universal;
42 bool Verbose = false;
43 int NumThreads = 0;
44 bool Verify = false;
45 bool UseDWARFLinkerParallel = false;
46 DwarfUtilAccelKind AccelTableKind = DwarfUtilAccelKind::None;
47 /// Compression type of the output debug sections. If not specified, the
48 /// output debug sections are compressed the same way as the input ones.
49 std::optional<DebugCompressionType> CompressionType;
50
51 std::string getSeparateDebugFileName() const {
52 return OutputFileName + ".debug";
53 }
54};
55
56} // namespace dwarfutil
57} // namespace llvm
58
59#endif // LLVM_TOOLS_LLVM_DWARFUTIL_OPTIONS_H
60