* Copyright (c) 2026 Huawei Technologies Co., Ltd.
* This program is free software, you can redistribute it and/or modify it under the terms and conditions of
* CANN Open Software License Agreement Version 2.0 (the "License").
* Please refer to the License for details. You may not use this file except in compliance with the License.
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
* See LICENSE in the root of the software repository for the full text of the License.
*/
#ifndef PYPTO_IR_VERIFIER_VERIFICATION_ERROR_H_
#define PYPTO_IR_VERIFIER_VERIFICATION_ERROR_H_
#include <string>
namespace pypto {
namespace ir {
* \brief SSA verification error types and utilities
*/
namespace ssa {
* \brief Error types for SSA verification
*/
enum class ErrorType : int {
MULTIPLE_ASSIGNMENT = 1,
NAME_SHADOWING = 2,
MISSING_YIELD = 3
};
* \brief Convert SSA error type to string
*/
std::string ErrorTypeToString(ErrorType type);
}
* \brief Type checking error types and utilities
*/
namespace typecheck {
* \brief Error types for type checking
*/
enum class ErrorType : int {
TYPE_KIND_MISMATCH = 101,
DTYPE_MISMATCH = 102,
SHAPE_DIMENSION_MISMATCH = 103,
SHAPE_VALUE_MISMATCH = 104,
SIZE_MISMATCH = 105,
IF_CONDITION_MUST_BE_SCALAR = 106,
FOR_RANGE_MUST_BE_SCALAR = 107
};
* \brief Convert type check error type to string
*/
std::string ErrorTypeToString(ErrorType type);
}
* \brief Nested call verification error types and utilities
*/
namespace nested_call {
* \brief Error types for nested call verification
*/
enum class ErrorType : int {
CALL_IN_CALL_ARGS = 201,
CALL_IN_IF_CONDITION = 202,
CALL_IN_FOR_RANGE = 203,
CALL_IN_BINARY_EXPR = 204,
CALL_IN_UNARY_EXPR = 205,
CALL_IN_WHILE_CONDITION = 206
};
* \brief Convert nested call error type to string
*/
std::string ErrorTypeToString(ErrorType type);
}
}
}
#endif