aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI/MachO/TextStubCommon.cpp
diff options
context:
space:
mode:
authorCyndy Ishida <cyndy_ishida@apple.com>2019-10-08 15:24:37 +0000
committerCyndy Ishida <cyndy_ishida@apple.com>2019-10-08 15:24:37 +0000
commitfb92ef1e55d7371c29d695889d0b4d026627637d (patch)
tree02dac29824e26c251115e986ce2ebbf9d0c5f632 /llvm/lib/TextAPI/MachO/TextStubCommon.cpp
parentc382d03ca85d0c93b3e49949006e42314b9d4409 (diff)
downloadllvm-fb92ef1e55d7371c29d695889d0b4d026627637d.zip
llvm-fb92ef1e55d7371c29d695889d0b4d026627637d.tar.gz
llvm-fb92ef1e55d7371c29d695889d0b4d026627637d.tar.bz2
Revert [TextAPI] Introduce TBDv4
This reverts r374058 (git commit 5d566c5a46aeaa1fa0e5c0b823c9d5f84036dc9a) llvm-svn: 374062
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 183c5d5..cfd9ac8 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 {};