From 09e8ef3e0dae29be7aa21a6e22a118a3f545945f Mon Sep 17 00:00:00 2001 From: Richard-Qin-X Date: Wed, 12 Aug 2026 19:45:09 +0800 Subject: [Tooling] Complete the LLVM MIR command-line contract --- backend/lib/Tooling/BackendInvocation.cpp | 74 ------------------------------- 1 file changed, 74 deletions(-) (limited to 'backend/lib/Tooling/BackendInvocation.cpp') diff --git a/backend/lib/Tooling/BackendInvocation.cpp b/backend/lib/Tooling/BackendInvocation.cpp index 677cd2d..232d34f 100644 --- a/backend/lib/Tooling/BackendInvocation.cpp +++ b/backend/lib/Tooling/BackendInvocation.cpp @@ -265,46 +265,6 @@ void appendMIRTextInfo(std::string &Output, const TargetMIRTextInfo &MIRText) { } // namespace -std::string_view spelling(RelocationModel Value) noexcept { - switch (Value) { - case RelocationModel::Static: - return "static"; - case RelocationModel::PositionIndependent: - return "pic"; - } - return "invalid"; -} - -std::string_view spelling(CodeModel Value) noexcept { - switch (Value) { - case CodeModel::Small: - return "small"; - case CodeModel::Medium: - return "medium"; - case CodeModel::Large: - return "large"; - } - return "invalid"; -} - -std::string_view spelling(OptimizationLevel Value) noexcept { - switch (Value) { - case OptimizationLevel::O0: - return "O0"; - case OptimizationLevel::O1: - return "O1"; - case OptimizationLevel::O2: - return "O2"; - case OptimizationLevel::O3: - return "O3"; - case OptimizationLevel::Os: - return "Os"; - case OptimizationLevel::Oz: - return "Oz"; - } - return "invalid"; -} - std::string_view spelling(LayoutOwnership Value) noexcept { switch (Value) { case LayoutOwnership::NativeObject: @@ -317,40 +277,6 @@ std::string_view spelling(LayoutOwnership Value) noexcept { return "invalid"; } -Expected parseRelocationModel(std::string_view Value) { - if (Value == "static") - return RelocationModel::Static; - if (Value == "pic") - return RelocationModel::PositionIndependent; - return makeUnexpected(ErrorCode::ManifestError, "unknown relocation model"); -} - -Expected parseCodeModel(std::string_view Value) { - if (Value == "small") - return CodeModel::Small; - if (Value == "medium") - return CodeModel::Medium; - if (Value == "large") - return CodeModel::Large; - return makeUnexpected(ErrorCode::ManifestError, "unknown code model"); -} - -Expected parseOptimizationLevel(std::string_view Value) { - if (Value == "O0") - return OptimizationLevel::O0; - if (Value == "O1") - return OptimizationLevel::O1; - if (Value == "O2") - return OptimizationLevel::O2; - if (Value == "O3") - return OptimizationLevel::O3; - if (Value == "Os") - return OptimizationLevel::Os; - if (Value == "Oz") - return OptimizationLevel::Oz; - return makeUnexpected(ErrorCode::ManifestError, "unknown optimization level"); -} - Expected parseLayoutOwnership(std::string_view Value) { if (Value == "native-object") return LayoutOwnership::NativeObject; -- cgit v1.2.3