brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 9024ba5 Raw
63 lines · cpp
1//===-- Error.cpp -----------------------------------------------*- C++ -*-===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "Error.h"10#include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX11 12#ifdef LLVM_ON_UNIX13#include <string.h>14#endif // LLVM_ON_UNIX15 16namespace llvm {17namespace exegesis {18 19char ClusteringError::ID;20 21void ClusteringError::log(raw_ostream &OS) const { OS << Msg; }22 23std::error_code ClusteringError::convertToErrorCode() const {24  return inconvertibleErrorCode();25}26 27char SnippetExecutionFailure::ID;28 29std::error_code SnippetExecutionFailure::convertToErrorCode() const {30  return inconvertibleErrorCode();31}32 33char SnippetSegmentationFault::ID;34 35void SnippetSegmentationFault::log(raw_ostream &OS) const {36  OS << "The snippet encountered a segmentation fault at address "37     << Twine::utohexstr(Address);38}39 40char SnippetSignal::ID;41 42void SnippetSignal::log(raw_ostream &OS) const {43  OS << "snippet crashed while running";44#ifdef LLVM_ON_UNIX45  OS << ": " << strsignal(SignalNumber);46#else47  (void)SignalNumber;48#endif // LLVM_ON_UNIX49}50 51char PerfCounterNotFullyEnabled::ID;52 53std::error_code PerfCounterNotFullyEnabled::convertToErrorCode() const {54  return inconvertibleErrorCode();55}56 57void PerfCounterNotFullyEnabled::log(raw_ostream &OS) const {58  OS << "The perf counter was not scheduled on the CPU the entire time.";59}60 61} // namespace exegesis62} // namespace llvm63