Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / tools / dsymutil / LinkUtils.h
blob2b3ccb29088f308b98e9f892c423cb8aa6884446
1 //===- tools/dsymutil/LinkUtils.h - Dwarf linker utilities ------*- 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 //===----------------------------------------------------------------------===//
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"
17 #include <string>
19 namespace llvm {
20 namespace dsymutil {
22 enum class OutputFileType {
23 Object,
24 Assembly,
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.
34 struct LinkOptions {
35 /// Verbosity
36 bool Verbose = false;
38 /// Skip emitting output
39 bool NoOutput = false;
41 /// Do not unique types according to ODR
42 bool NoODR = false;
44 /// Update
45 bool Update = false;
47 /// Minimize
48 bool Minimize = false;
50 /// Do not check swiftmodule timestamp
51 bool NoTimestamp = false;
53 /// Number of threads.
54 unsigned Threads = 1;
56 // Output file type.
57 OutputFileType FileType = OutputFileType::Object;
59 /// The accelerator table kind
60 AccelTableKind TheAccelTableKind;
62 /// -oso-prepend-path
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";
81 return false;
84 } // end namespace dsymutil
85 } // end namespace llvm
87 #endif // LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H