1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/tools/dsymutil/LinkUtils.h
Jonas Devlieghere 9ad77aa4ad [dsymutil] Add support for outputting assembly
When implementing the DWARF accelerator tables in dsymutil I ran into an
assertion in the assembler. Debugging these kind of issues is a lot
easier when looking at the assembly instead of debugging the assembler
itself. Since it's only a matter of creating an AsmStreamer instead of a
MCObjectStreamer it made sense to turn this into a (hidden) dsymutil
feature.

Differential revision: https://reviews.llvm.org/D49079

llvm-svn: 336561
2018-07-09 16:58:48 +00:00

73 lines
1.6 KiB
C++

//===- 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 {
enum class OutputFileType {
Object,
Assembly,
};
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;
// Output file type.
OutputFileType FileType = OutputFileType::Object;
/// -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