llvm/llvm/lib/TableGen/Error.cpp

//===- Error.cpp - tblgen error handling helper routines --------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file contains error handling helper routines to pretty-print diagnostic
// messages from tblgen.
//
//===----------------------------------------------------------------------===//

#include "llvm/ADT/Twine.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/WithColor.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include <cstdlib>

namespace llvm {

SourceMgr SrcMgr;
unsigned ErrorsPrinted =;

static void PrintMessage(ArrayRef<SMLoc> Loc, SourceMgr::DiagKind Kind,
                         const Twine &Msg) {}

// Run file cleanup handlers and then exit fatally (with non-zero exit code).
[[noreturn]] inline static void fatal_exit() {}

// Functions to print notes.

void PrintNote(const Twine &Msg) {}

void PrintNote(function_ref<void(raw_ostream &OS)> PrintMsg) {}

void PrintNote(ArrayRef<SMLoc> NoteLoc, const Twine &Msg) {}

// Functions to print fatal notes.

void PrintFatalNote(const Twine &Msg) {}

void PrintFatalNote(ArrayRef<SMLoc> NoteLoc, const Twine &Msg) {}

// This method takes a Record and uses the source location
// stored in it.
void PrintFatalNote(const Record *Rec, const Twine &Msg) {}

// This method takes a RecordVal and uses the source location
// stored in it.
void PrintFatalNote(const RecordVal *RecVal, const Twine &Msg) {}

// Functions to print warnings.

void PrintWarning(const Twine &Msg) {}

void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg) {}

void PrintWarning(const char *Loc, const Twine &Msg) {}

// Functions to print errors.

void PrintError(const Twine &Msg) {}

void PrintError(function_ref<void(raw_ostream &OS)> PrintMsg) {}

void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg) {}

void PrintError(const char *Loc, const Twine &Msg) {}

// This method takes a Record and uses the source location
// stored in it.
void PrintError(const Record *Rec, const Twine &Msg) {}

// This method takes a RecordVal and uses the source location
// stored in it.
void PrintError(const RecordVal *RecVal, const Twine &Msg) {}

// Functions to print fatal errors.

void PrintFatalError(const Twine &Msg) {}

void PrintFatalError(function_ref<void(raw_ostream &OS)> PrintMsg) {}

void PrintFatalError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg) {}

// This method takes a Record and uses the source location
// stored in it.
void PrintFatalError(const Record *Rec, const Twine &Msg) {}

// This method takes a RecordVal and uses the source location
// stored in it.
void PrintFatalError(const RecordVal *RecVal, const Twine &Msg) {}

// Check an assertion: Obtain the condition value and be sure it is true.
// If not, print a nonfatal error along with the message.
void CheckAssert(SMLoc Loc, Init *Condition, Init *Message) {}

// Dump a message to stderr.
void dumpMessage(SMLoc Loc, Init *Message) {}

} // end namespace llvm