Revert "[HLSL] Add `Increment`/`DecrementCounter` methods to structured buffers ...
[llvm-project.git] / llvm / tools / llvm-exegesis / lib / Error.cpp
blob2eee3f2f54c59c9c6403f0ab9f6780025c606118
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "Error.h"
10 #include "llvm/Config/llvm-config.h" // for LLVM_ON_UNIX
12 #ifdef LLVM_ON_UNIX
13 #include "llvm/Support/SystemZ/zOSSupport.h"
14 #include <string.h>
15 #endif // LLVM_ON_UNIX
17 namespace llvm {
18 namespace exegesis {
20 char ClusteringError::ID;
22 void ClusteringError::log(raw_ostream &OS) const { OS << Msg; }
24 std::error_code ClusteringError::convertToErrorCode() const {
25 return inconvertibleErrorCode();
28 char SnippetExecutionFailure::ID;
30 std::error_code SnippetExecutionFailure::convertToErrorCode() const {
31 return inconvertibleErrorCode();
34 char SnippetSegmentationFault::ID;
36 void SnippetSegmentationFault::log(raw_ostream &OS) const {
37 OS << "The snippet encountered a segmentation fault at address "
38 << Twine::utohexstr(Address);
41 char SnippetSignal::ID;
43 void SnippetSignal::log(raw_ostream &OS) const {
44 OS << "snippet crashed while running";
45 #ifdef LLVM_ON_UNIX
46 OS << ": " << strsignal(SignalNumber);
47 #else
48 (void)SignalNumber;
49 #endif // LLVM_ON_UNIX
52 } // namespace exegesis
53 } // namespace llvm