16#ifndef LLVM_CLANG_SCALABLESTATICANALYSIS_TOOL_UTILS_H
17#define LLVM_CLANG_SCALABLESTATICANALYSIS_TOOL_UTILS_H
20#include "llvm/ADT/ArrayRef.h"
21#include "llvm/ADT/StringRef.h"
22#include "llvm/Support/CommandLine.h"
23#include "llvm/Support/Error.h"
24#include "llvm/Support/FormatVariadic.h"
25#include "llvm/Support/WithColor.h"
26#include "llvm/TargetParser/Triple.h"
44template <
typename... Ts>
46 std::string Message = llvm::formatv(Fmt, std::forward<Ts>(Args)...);
56template <
typename... Ts>
57inline void info(
bool Verbose,
unsigned Level,
const char *Fmt, Ts &&...Args) {
59 llvm::WithColor::note()
61 << llvm::formatv(Fmt, std::forward<Ts>(Args)...) <<
"\n";
77void initTool(
int argc,
const char **argv, llvm::StringRef Version,
78 llvm::cl::OptionCategory &Category, llvm::StringRef ToolHeading);
91 llvm::StringRef
Value);
llvm::StringRef getToolName()
Returns the name of the running tool, as set by initTool().
constexpr unsigned IndentationWidth
Number of spaces per indentation level used by info().
llvm::Triple parseTargetTripleOrFail(llvm::StringRef FlagName, llvm::StringRef Value)
Parses and validates a target triple supplied on the command line.
void fail(const char *Msg)
void initTool(int argc, const char **argv, llvm::StringRef Version, llvm::cl::OptionCategory &Category, llvm::StringRef ToolHeading)
Sets ToolName, ToolVersion, and the version printer, hides unrelated command-line options,...
void info(bool Verbose, unsigned Level, const char *Fmt, Ts &&...Args)
Prints an indented note to stderr when Verbose is set.
void loadPlugins(llvm::ArrayRef< std::string > Paths)