blob: 7f43d11146e7016bf8548b367aaac51175e9d026 [file] [log] [blame]
Jonas Devliegherec0fb4b62018-06-27 16:13:40 +00001//===- tools/dsymutil/LinkUtils.h - Dwarf linker utilities ------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H
11#define LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H
12
13#include "llvm/ADT/Twine.h"
14#include "llvm/Support/WithColor.h"
15#include <string>
16
17namespace llvm {
18namespace dsymutil {
19
20struct LinkOptions {
21 /// Verbosity
22 bool Verbose = false;
23
24 /// Skip emitting output
25 bool NoOutput = false;
26
27 /// Do not unique types according to ODR
28 bool NoODR = false;
29
30 /// Update
31 bool Update = false;
32
33 /// Minimize
34 bool Minimize = false;
35
36 /// Do not check swiftmodule timestamp
37 bool NoTimestamp = false;
38
39 /// Number of threads.
40 unsigned Threads = 1;
41
42 /// -oso-prepend-path
43 std::string PrependPath;
44
45 LinkOptions() = default;
46};
47
48inline void warn(Twine Warning, Twine Context = {}) {
49 WithColor::warning() << Warning + "\n";
50 if (!Context.isTriviallyEmpty())
51 WithColor::note() << Twine("while processing ") + Context + "\n";
52}
53
54inline bool error(Twine Error, Twine Context = {}) {
55 WithColor::error() << Error + "\n";
56 if (!Context.isTriviallyEmpty())
57 WithColor::note() << Twine("while processing ") + Context + "\n";
58 return false;
59}
60
61} // end namespace dsymutil
62} // end namespace llvm
63
64#endif // LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H