2018-06-28 00:13:40 +08:00
|
|
|
//===- tools/dsymutil/LinkUtils.h - Dwarf linker utilities ------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H
|
|
|
|
#define LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H
|
|
|
|
|
|
|
|
#include "llvm/ADT/Twine.h"
|
|
|
|
#include "llvm/Support/WithColor.h"
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace dsymutil {
|
|
|
|
|
2018-07-10 00:58:48 +08:00
|
|
|
enum class OutputFileType {
|
|
|
|
Object,
|
|
|
|
Assembly,
|
|
|
|
};
|
|
|
|
|
2018-07-26 07:01:38 +08:00
|
|
|
/// The kind of accelerator tables we should emit.
|
|
|
|
enum class AccelTableKind {
|
|
|
|
Apple, ///< .apple_names, .apple_namespaces, .apple_types, .apple_objc.
|
|
|
|
Dwarf, ///< DWARF v5 .debug_names.
|
|
|
|
Default, ///< Dwarf for DWARF5 or later, Apple otherwise.
|
|
|
|
};
|
|
|
|
|
2018-06-28 00:13:40 +08:00
|
|
|
struct LinkOptions {
|
|
|
|
/// Verbosity
|
|
|
|
bool Verbose = false;
|
|
|
|
|
|
|
|
/// Skip emitting output
|
|
|
|
bool NoOutput = false;
|
|
|
|
|
|
|
|
/// Do not unique types according to ODR
|
|
|
|
bool NoODR = false;
|
|
|
|
|
|
|
|
/// Update
|
|
|
|
bool Update = false;
|
|
|
|
|
|
|
|
/// Minimize
|
|
|
|
bool Minimize = false;
|
|
|
|
|
|
|
|
/// Do not check swiftmodule timestamp
|
|
|
|
bool NoTimestamp = false;
|
|
|
|
|
|
|
|
/// Number of threads.
|
|
|
|
unsigned Threads = 1;
|
|
|
|
|
2018-07-10 00:58:48 +08:00
|
|
|
// Output file type.
|
|
|
|
OutputFileType FileType = OutputFileType::Object;
|
|
|
|
|
2018-07-26 07:01:38 +08:00
|
|
|
/// The accelerator table kind
|
|
|
|
AccelTableKind TheAccelTableKind;
|
|
|
|
|
2018-06-28 00:13:40 +08:00
|
|
|
/// -oso-prepend-path
|
|
|
|
std::string PrependPath;
|
|
|
|
|
|
|
|
LinkOptions() = default;
|
|
|
|
};
|
|
|
|
|
|
|
|
inline void warn(Twine Warning, Twine Context = {}) {
|
|
|
|
WithColor::warning() << Warning + "\n";
|
|
|
|
if (!Context.isTriviallyEmpty())
|
|
|
|
WithColor::note() << Twine("while processing ") + Context + "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
inline bool error(Twine Error, Twine Context = {}) {
|
|
|
|
WithColor::error() << Error + "\n";
|
|
|
|
if (!Context.isTriviallyEmpty())
|
|
|
|
WithColor::note() << Twine("while processing ") + Context + "\n";
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // end namespace dsymutil
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif // LLVM_TOOLS_DSYMUTIL_LINKOPTIONS_H
|