2022-02-26 08:50:09 +08:00
|
|
|
//===- exception.h --------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// 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
|
|
|
|
// Also available under a BSD-style license. See LICENSE.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2022-02-18 09:15:37 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <exception>
|
|
|
|
#include <sstream>
|
|
|
|
#include <string>
|
|
|
|
|
2022-03-24 22:15:43 +08:00
|
|
|
#define UNIMPLEMENTED_ERROR(msg) \
|
|
|
|
{ \
|
|
|
|
std::ostringstream err; \
|
|
|
|
err << "Unimplemented Error: " << msg; \
|
|
|
|
throw std::runtime_error(err.str()); \
|
|
|
|
}
|
2022-02-18 09:15:37 +08:00
|
|
|
|
2022-03-24 22:15:43 +08:00
|
|
|
#define UNIMPLEMENTED_FUNCTION_ERROR() \
|
2024-01-30 01:59:33 +08:00
|
|
|
UNIMPLEMENTED_ERROR("\n\t" << __FILE__ << ":" << __LINE__ << " " \
|
|
|
|
<< __PRETTY_FUNCTION__)
|
2022-02-18 09:15:37 +08:00
|
|
|
|
2022-03-24 22:15:43 +08:00
|
|
|
#define UNSUPPORTED_ERROR(msg) \
|
|
|
|
{ \
|
|
|
|
std::ostringstream err; \
|
|
|
|
err << "Unsupported Error: " << msg; \
|
|
|
|
throw std::runtime_error(err.str()); \
|
|
|
|
}
|