summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TextAPI/MachO/TextStubCommon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/TextAPI/MachO/TextStubCommon.cpp')
-rw-r--r--llvm/lib/TextAPI/MachO/TextStubCommon.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/llvm/lib/TextAPI/MachO/TextStubCommon.cpp b/llvm/lib/TextAPI/MachO/TextStubCommon.cpp
index 183c5d5a93b..cfd9ac8d0cf 100644
--- a/llvm/lib/TextAPI/MachO/TextStubCommon.cpp
+++ b/llvm/lib/TextAPI/MachO/TextStubCommon.cpp
@@ -172,25 +172,14 @@ void ScalarTraits<SwiftVersion>::output(const SwiftVersion &Value, void *,
break;
}
}
-StringRef ScalarTraits<SwiftVersion>::input(StringRef Scalar, void *IO,
+StringRef ScalarTraits<SwiftVersion>::input(StringRef Scalar, void *,
SwiftVersion &Value) {
- const auto *Ctx = reinterpret_cast<TextAPIContext *>(IO);
- assert((!Ctx || Ctx->FileKind != FileType::Invalid) &&
- "File type is not set in context");
-
- if (Ctx->FileKind == FileType::TBD_V4) {
- if (Scalar.getAsInteger(10, Value))
- return "invalid Swift ABI version.";
- return {};
- } else {
- Value = StringSwitch<SwiftVersion>(Scalar)
- .Case("1.0", 1)
- .Case("1.1", 2)
- .Case("2.0", 3)
- .Case("3.0", 4)
- .Default(0);
- }
-
+ Value = StringSwitch<SwiftVersion>(Scalar)
+ .Case("1.0", 1)
+ .Case("1.1", 2)
+ .Case("2.0", 3)
+ .Case("3.0", 4)
+ .Default(0);
if (Value != SwiftVersion(0))
return {};
OpenPOWER on IntegriCloud