aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/Support/Error.cpp
diff options
context:
space:
mode:
authorRichard-Qin-X <richard.qin.001@gmail.com>2026-08-01 04:30:34 +0800
committerRichard-Qin-X <richard.qin.001@gmail.com>2026-08-01 04:30:34 +0800
commit81cf8b68eca2636574f3d0a9fa1cf0b428c163e9 (patch)
treef3a83496e71358123cc5f838269dc134d02b63f6 /backend/lib/Support/Error.cpp
parent72af0dedf9e18911da65b9a5c4906689e868d9fc (diff)
downloadrcc-project-81cf8b68eca2636574f3d0a9fa1cf0b428c163e9.tar.gz
rcc-project-81cf8b68eca2636574f3d0a9fa1cf0b428c163e9.tar.xz
[Backend] Establish standalone build infrastructure
Add the thin monorepo CMake entry point and an independently configurable backend project. Enforce the Clang/C++23 toolchain, expose Make/Ninja-neutral tests and developer checks, export an installable RCCBackend package, and introduce the first Support error abstraction.
Diffstat (limited to 'backend/lib/Support/Error.cpp')
-rw-r--r--backend/lib/Support/Error.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/backend/lib/Support/Error.cpp b/backend/lib/Support/Error.cpp
new file mode 100644
index 0000000..dc7d590
--- /dev/null
+++ b/backend/lib/Support/Error.cpp
@@ -0,0 +1,28 @@
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "rcc/Support/Error.h"
+
+namespace rcc {
+
+std::string_view getErrorCodeName(ErrorCode Code) noexcept {
+ switch (Code) {
+ case ErrorCode::InvalidArgument:
+ return "invalid argument";
+ case ErrorCode::ParseError:
+ return "parse error";
+ case ErrorCode::VerificationError:
+ return "verification error";
+ case ErrorCode::Unsupported:
+ return "unsupported";
+ case ErrorCode::IoError:
+ return "I/O error";
+ case ErrorCode::InternalError:
+ return "internal error";
+ }
+
+ return "unknown error";
+}
+
+Error::Error(ErrorCode Code, std::string Message) : Code(Code), Message(std::move(Message)) {}
+
+} // namespace rcc