1 //===- tools/dsymutil/LinkUtils.h - Dwarf linker utilities ------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H
10 #define LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H
12 #include "SymbolMap.h"
14 #include "llvm/ADT/Twine.h"
15 #include "llvm/Support/WithColor.h"
22 enum class OutputFileType
{
27 /// The kind of accelerator tables we should emit.
28 enum class AccelTableKind
{
29 Apple
, ///< .apple_names, .apple_namespaces, .apple_types, .apple_objc.
30 Dwarf
, ///< DWARF v5 .debug_names.
31 Default
, ///< Dwarf for DWARF5 or later, Apple otherwise.
38 /// Skip emitting output
39 bool NoOutput
= false;
41 /// Do not unique types according to ODR
48 bool Minimize
= false;
50 /// Do not check swiftmodule timestamp
51 bool NoTimestamp
= false;
53 /// Number of threads.
57 OutputFileType FileType
= OutputFileType::Object
;
59 /// The accelerator table kind
60 AccelTableKind TheAccelTableKind
;
63 std::string PrependPath
;
65 /// Symbol map translator.
66 SymbolMapTranslator Translator
;
68 LinkOptions() = default;
71 inline void warn(Twine Warning
, Twine Context
= {}) {
72 WithColor::warning() << Warning
+ "\n";
73 if (!Context
.isTriviallyEmpty())
74 WithColor::note() << Twine("while processing ") + Context
+ "\n";
77 inline bool error(Twine Error
, Twine Context
= {}) {
78 WithColor::error() << Error
+ "\n";
79 if (!Context
.isTriviallyEmpty())
80 WithColor::note() << Twine("while processing ") + Context
+ "\n";
84 } // end namespace dsymutil
85 } // end namespace llvm
87 #endif // LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H