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 /// The Resources directory in the .dSYM bundle.
66 Optional
<std::string
> ResourceDir
;
68 /// Symbol map translator.
69 SymbolMapTranslator Translator
;
71 LinkOptions() = default;
74 inline void warn(Twine Warning
, Twine Context
= {}) {
75 WithColor::warning() << Warning
+ "\n";
76 if (!Context
.isTriviallyEmpty())
77 WithColor::note() << Twine("while processing ") + Context
+ "\n";
80 inline bool error(Twine Error
, Twine Context
= {}) {
81 WithColor::error() << Error
+ "\n";
82 if (!Context
.isTriviallyEmpty())
83 WithColor::note() << Twine("while processing ") + Context
+ "\n";
87 } // end namespace dsymutil
88 } // end namespace llvm
90 #endif // LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H