diff options
| author | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-12 19:45:09 +0800 |
|---|---|---|
| committer | Richard-Qin-X <richard.qin.001@gmail.com> | 2026-08-12 19:45:09 +0800 |
| commit | 09e8ef3e0dae29be7aa21a6e22a118a3f545945f (patch) | |
| tree | cfc5a7148aca9e768df16743c2c637e8c00a9d44 /backend/lib/Tooling/BackendInvocation.cpp | |
| parent | 1775d50ba02dab033c639f5c8fedd46cb6613bef (diff) | |
| download | rcc-project-09e8ef3e0dae29be7aa21a6e22a118a3f545945f.tar.gz rcc-project-09e8ef3e0dae29be7aa21a6e22a118a3f545945f.tar.xz | |
[Tooling] Complete the LLVM MIR command-line contract
Diffstat (limited to 'backend/lib/Tooling/BackendInvocation.cpp')
| -rw-r--r-- | backend/lib/Tooling/BackendInvocation.cpp | 74 |
1 files changed, 0 insertions, 74 deletions
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<RelocationModel> 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<CodeModel> 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<OptimizationLevel> 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<LayoutOwnership> parseLayoutOwnership(std::string_view Value) { if (Value == "native-object") return LayoutOwnership::NativeObject; |
