1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/tools/dsymutil/LinkUtils.h
Jonas Devlieghere f589dab5bf [dsymutil] Move abstractions into separate files (NFC)
This patch splits off some abstractions used by dsymutil's dwarf linker
and moves them into separate header and implementation files. This
almost halves the number of LOC in DwarfLinker.cpp and makes it a lot
easier to understand what functionality lives where.

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

llvm-svn: 335749
2018-06-27 16:13:40 +00:00

65 lines
1.5 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 {
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;
/// -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