diff options
author | Cyndy Ishida <cyndy_ishida@apple.com> | 2019-10-08 15:24:37 +0000 |
---|---|---|
committer | Cyndy Ishida <cyndy_ishida@apple.com> | 2019-10-08 15:24:37 +0000 |
commit | fb92ef1e55d7371c29d695889d0b4d026627637d (patch) | |
tree | 02dac29824e26c251115e986ce2ebbf9d0c5f632 /llvm/lib/TextAPI/MachO/Target.cpp | |
parent | c382d03ca85d0c93b3e49949006e42314b9d4409 (diff) | |
download | llvm-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/Target.cpp')
-rw-r--r-- | llvm/lib/TextAPI/MachO/Target.cpp | 40 |
1 files changed, 1 insertions, 39 deletions
diff --git a/llvm/lib/TextAPI/MachO/Target.cpp b/llvm/lib/TextAPI/MachO/Target.cpp index 52fb339..3052aa5 100644 --- a/llvm/lib/TextAPI/MachO/Target.cpp +++ b/llvm/lib/TextAPI/MachO/Target.cpp @@ -17,44 +17,6 @@ namespace llvm { namespace MachO { -Expected<Target> Target::create(StringRef TargetValue) { - auto Result = TargetValue.split('-'); - auto ArchitectureStr = Result.first; - auto Architecture = getArchitectureFromName(ArchitectureStr); - if (Architecture == AK_unknown) - return make_error<StringError>("invalid architecture", - inconvertibleErrorCode()); - auto PlatformStr = Result.second; - PlatformKind Platform; - Platform = StringSwitch<PlatformKind>(PlatformStr) - .Case("macos", PlatformKind::macOS) - .Case("ios", PlatformKind::iOS) - .Case("tvos", PlatformKind::tvOS) - .Case("watchos", PlatformKind::watchOS) - .Case("bridgeos", PlatformKind::bridgeOS) - .Case("maccatalyst", PlatformKind::macCatalyst) - .Case("ios-simulator", PlatformKind::iOSSimulator) - .Case("tvos-simulator", PlatformKind::tvOSSimulator) - .Case("watchos-simulator", PlatformKind::watchOSSimulator) - .Default(PlatformKind::unknown); - - if (Platform == PlatformKind::unknown) { - if (PlatformStr.startswith("<") && PlatformStr.endswith(">")) { - PlatformStr = PlatformStr.drop_front().drop_back(); - unsigned long long RawValue; - if (PlatformStr.getAsInteger(10, RawValue)) - return make_error<StringError>("invalid platform number", - inconvertibleErrorCode()); - - Platform = (PlatformKind)RawValue; - } - return make_error<StringError>("invalid platform", - inconvertibleErrorCode()); - } - - return Target{Architecture, Platform}; -} - Target::operator std::string() const { return (getArchitectureName(Arch) + " (" + getPlatformName(Platform) + ")") .str(); @@ -80,4 +42,4 @@ ArchitectureSet mapToArchitectureSet(ArrayRef<Target> Targets) { } } // end namespace MachO. -} // end namespace llvm. +} // end namespace llvm.
\ No newline at end of file |