llvm/llvm/lib/Support/Error.cpp

//===----- lib/Support/Error.cpp - Error and associated utilities ---------===//
//
// 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 "llvm/Support/Error.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/ErrorHandling.h"
#include <system_error>

usingnamespacellvm;

namespace {

  enum class ErrorErrorCode : int {};

  // FIXME: This class is only here to support the transition to llvm::Error. It
  // will be removed once this transition is complete. Clients should prefer to
  // deal with the Error value directly, rather than converting to error_code.
  class ErrorErrorCategory : public std::error_category {};

}

ErrorErrorCategory &getErrorErrorCat() {}

namespace llvm {

void ErrorInfoBase::anchor() {}
char ErrorInfoBase::ID =;
char ErrorList::ID =;
void ECError::anchor() {}
char ECError::ID =;
char StringError::ID =;
char FileError::ID =;

void logAllUnhandledErrors(Error E, raw_ostream &OS, Twine ErrorBanner) {}

/// Write all error messages (if any) in E to a string. The newline character
/// is used to separate error messages.
std::string toString(Error E) {}

std::string toStringWithoutConsuming(const Error &E) {}

std::error_code ErrorList::convertToErrorCode() const {}

std::error_code inconvertibleErrorCode() {}

std::error_code FileError::convertToErrorCode() const {}

Error errorCodeToError(std::error_code EC) {}

std::error_code errorToErrorCode(Error Err) {}

#if LLVM_ENABLE_ABI_BREAKING_CHECKS
void Error::fatalUncheckedError() const {
  dbgs() << "Program aborted due to an unhandled Error:\n";
  if (getPtr()) {
    getPtr()->log(dbgs());
    dbgs() << "\n";
  }else
    dbgs() << "Error value was Success. (Note: Success values must still be "
              "checked prior to being destroyed).\n";
  abort();
}
#endif

StringError::StringError(std::error_code EC, const Twine &S)
    :{}

StringError::StringError(const Twine &S, std::error_code EC)
    :{}

StringError::StringError(std::string &&S, std::error_code EC, bool PrintMsgOnly)
    :{}

void StringError::log(raw_ostream &OS) const {}

std::error_code StringError::convertToErrorCode() const {}

Error createStringError(std::string &&Msg, std::error_code EC) {}

void report_fatal_error(Error Err, bool GenCrashDiag) {}

} // end namespace llvm

LLVMErrorTypeId LLVMGetErrorTypeId(LLVMErrorRef Err) {}

void LLVMConsumeError(LLVMErrorRef Err) {}



void LLVMCantFail(LLVMErrorRef Err) {}

char *LLVMGetErrorMessage(LLVMErrorRef Err) {}

void LLVMDisposeErrorMessage(char *ErrMsg) {}

LLVMErrorTypeId LLVMGetStringErrorTypeId() {}

LLVMErrorRef LLVMCreateStringError(const char *ErrMsg) {}