llvm/lld/Common/ErrorHandler.cpp

//===- ErrorHandler.cpp ---------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "lld/Common/ErrorHandler.h"

#include "llvm/Support/Parallel.h"

#include "lld/Common/CommonLinkerContext.h"
#include "llvm/ADT/Twine.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/IR/DiagnosticPrinter.h"
#include "llvm/Support/CrashRecoveryContext.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/Process.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/raw_ostream.h"
#include <regex>

usingnamespacellvm;
usingnamespacelld;

static StringRef getSeparator(const Twine &msg) {}

ErrorHandler::~ErrorHandler() {}

void ErrorHandler::initialize(llvm::raw_ostream &stdoutOS,
                              llvm::raw_ostream &stderrOS, bool exitEarly,
                              bool disableOutput) {}

void ErrorHandler::flushStreams() {}

ErrorHandler &lld::errorHandler() {}

void lld::error(const Twine &msg) {}
void lld::error(const Twine &msg, ErrorTag tag, ArrayRef<StringRef> args) {}
void lld::fatal(const Twine &msg) {}
void lld::log(const Twine &msg) {}
void lld::message(const Twine &msg, llvm::raw_ostream &s) {}
void lld::warn(const Twine &msg) {}
uint64_t lld::errorCount() {}

raw_ostream &lld::outs() {}

raw_ostream &lld::errs() {}

raw_ostream &ErrorHandler::outs() {}

raw_ostream &ErrorHandler::errs() {}

void lld::exitLld(int val) {}

void lld::diagnosticHandler(const DiagnosticInfo &di) {}

void lld::checkError(Error e) {}

// This is for --vs-diagnostics.
//
// Normally, lld's error message starts with argv[0]. Therefore, it usually
// looks like this:
//
//   ld.lld: error: ...
//
// This error message style is unfortunately unfriendly to Visual Studio
// IDE. VS interprets the first word of the first line as an error location
// and make it clickable, thus "ld.lld" in the above message would become a
// clickable text. When you click it, VS opens "ld.lld" executable file with
// a binary editor.
//
// As a workaround, we print out an error location instead of "ld.lld" if
// lld is running in VS diagnostics mode. As a result, error message will
// look like this:
//
//   src/foo.c(35): error: ...
//
// This function returns an error location string. An error location is
// extracted from an error message using regexps.
std::string ErrorHandler::getLocation(const Twine &msg) {}

void ErrorHandler::reportDiagnostic(StringRef location, Colors c,
                                    StringRef diagKind, const Twine &msg) {}

void ErrorHandler::log(const Twine &msg) {}

void ErrorHandler::message(const Twine &msg, llvm::raw_ostream &s) {}

void ErrorHandler::warn(const Twine &msg) {}

void ErrorHandler::error(const Twine &msg) {}

void ErrorHandler::error(const Twine &msg, ErrorTag tag,
                         ArrayRef<StringRef> args) {}

void ErrorHandler::fatal(const Twine &msg) {}