11#include "llvm/ADT/StringRef.h"
12#include "llvm/Support/raw_ostream.h"
13#include "llvm/Support/CommandLine.h"
35cl::OptionCategory
MiscCat(
"Miscellaneous options",
"");
39cl::opt<bool> WarningsOnlyToFile(
40 "warnings-only-to-file", cl::init(
false),
41 cl::desc(
"All warnings will be written to warnings.txt only. If disabled, "
42 "they are also written on screen."),
47 const char *prefixToSearchFor) {
48 if (pfx && strcmp(pfx, prefixToSearchFor) == 0)
51 if (llvm::StringRef(msg).startswith(prefixToSearchFor))
62 llvm::raw_fd_ostream fdos(fileno(fp),
false,
64 bool modifyConsoleColor = fdos.is_displayed() && (fp == stderr);
66 if (modifyConsoleColor) {
70 fdos.changeColor(llvm::raw_ostream::MAGENTA,
76 fdos.changeColor(llvm::raw_ostream::MAGENTA,
82 fdos.changeColor(llvm::raw_ostream::RED,
88 fdos.changeColor(llvm::raw_ostream::WHITE,
99 vfprintf(fp, msg, ap);
104 if (modifyConsoleColor)
162 static std::set<std::pair<const void *, const char *> > keys;
163 std::pair<const void *, const char *> key;
168 if (strncmp(msg,
"calling external", strlen(
"calling external")) != 0)
169 key = std::make_pair(
id, msg);
171 key = std::make_pair(
id,
"calling external");
173 if (!keys.count(key)) {
static void klee_vfmessage(FILE *fp, const char *pfx, const char *msg, va_list ap)
static const char * errorPrefix
static const char * warningPrefix
static const char * warningOncePrefix
static bool shouldSetColor(const char *pfx, const char *msg, const char *prefixToSearchFor)
static const char * notePrefix
static void klee_vmessage(const char *pfx, bool onlyToFile, const char *msg, va_list ap)
void klee_message(const char *msg,...) __attribute__((format(printf
llvm::cl::OptionCategory MiscCat
void void klee_message_to_file(const char *msg,...) __attribute__((format(printf
void klee_error(const char *msg,...) __attribute__((format(printf
void void void void klee_warning_once(const void *id, const char *msg,...) __attribute__((format(printf
void void void klee_warning(const char *msg,...) __attribute__((format(printf
cl::OptionCategory MiscCat("Miscellaneous options", "")