diff options
| author | Cyndy Ishida <cyndy_ishida@apple.com> | 2019-10-10 04:24:44 +0000 |
|---|---|---|
| committer | Cyndy Ishida <cyndy_ishida@apple.com> | 2019-10-10 04:24:44 +0000 |
| commit | f9d8162b573df0765b22927da779537b132365c9 (patch) | |
| tree | 930ffa6248d8e39d38ba6a24ac41479f635548c0 /llvm/include | |
| parent | c752f5bce4cc524c9b808272ed9c7da67db61938 (diff) | |
| download | bcm5719-llvm-f9d8162b573df0765b22927da779537b132365c9.tar.gz bcm5719-llvm-f9d8162b573df0765b22927da779537b132365c9.zip | |
Reland "[TextAPI] Introduce TBDv4"
Original Patch broke for compilations w/ gcc and exposed asan fail.
This reland repairs those bugs.
Differential Revision: https://reviews.llvm.org/D67529
llvm-svn: 374277
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/TextAPI/MachO/InterfaceFile.h | 3 | ||||
| -rw-r--r-- | llvm/include/llvm/TextAPI/MachO/Symbol.h | 11 | ||||
| -rw-r--r-- | llvm/include/llvm/TextAPI/MachO/Target.h | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/llvm/include/llvm/TextAPI/MachO/InterfaceFile.h b/llvm/include/llvm/TextAPI/MachO/InterfaceFile.h index 8bb6b5ff066..bd434e04b69 100644 --- a/llvm/include/llvm/TextAPI/MachO/InterfaceFile.h +++ b/llvm/include/llvm/TextAPI/MachO/InterfaceFile.h @@ -67,6 +67,9 @@ enum FileType : unsigned { /// Text-based stub file (.tbd) version 3.0 TBD_V3 = 1U << 2, + /// Text-based stub file (.tbd) version 4.0 + TBD_V4 = 1U << 3, + All = ~0U, LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/All), diff --git a/llvm/include/llvm/TextAPI/MachO/Symbol.h b/llvm/include/llvm/TextAPI/MachO/Symbol.h index b6444fbd78f..1b1632c599c 100644 --- a/llvm/include/llvm/TextAPI/MachO/Symbol.h +++ b/llvm/include/llvm/TextAPI/MachO/Symbol.h @@ -38,7 +38,10 @@ enum class SymbolFlags : uint8_t { /// Undefined Undefined = 1U << 3, - LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/Undefined), + /// Rexported + Rexported = 1U << 4, + + LLVM_MARK_AS_BITMASK_ENUM(/*LargestValue=*/Rexported), }; // clang-format on @@ -50,7 +53,7 @@ enum class SymbolKind : uint8_t { ObjectiveCInstanceVariable, }; -using TargetList = SmallVector<Target, 20>; +using TargetList = SmallVector<Target, 5>; class Symbol { public: Symbol(SymbolKind Kind, StringRef Name, TargetList Targets, SymbolFlags Flags) @@ -81,6 +84,10 @@ public: return (Flags & SymbolFlags::Undefined) == SymbolFlags::Undefined; } + bool isReexported() const { + return (Flags & SymbolFlags::Rexported) == SymbolFlags::Rexported; + } + using const_target_iterator = TargetList::const_iterator; using const_target_range = llvm::iterator_range<const_target_iterator>; const_target_range targets() const { return {Targets}; } diff --git a/llvm/include/llvm/TextAPI/MachO/Target.h b/llvm/include/llvm/TextAPI/MachO/Target.h index 74e900d812f..5fe44cb7d36 100644 --- a/llvm/include/llvm/TextAPI/MachO/Target.h +++ b/llvm/include/llvm/TextAPI/MachO/Target.h @@ -29,6 +29,8 @@ public: explicit Target(const llvm::Triple &Triple) : Arch(mapToArchitecture(Triple)), Platform(mapToPlatformKind(Triple)) {} + static llvm::Expected<Target> create(StringRef Target); + operator std::string() const; Architecture Arch; |

