1 //===- Symbol.cpp ---------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Implements the Symbol.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/TextAPI/MachO/Symbol.h"
19 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
20 LLVM_DUMP_METHOD void Symbol::dump(raw_ostream &OS) const {
25 Result += "(weak-def) ";
26 if (isWeakReferenced())
27 Result += "(weak-ref) ";
28 if (isThreadLocalValue())
31 case SymbolKind::GlobalSymbol:
34 case SymbolKind::ObjectiveCClass:
35 Result += "(ObjC Class) " + Name.str();
37 case SymbolKind::ObjectiveCClassEHType:
38 Result += "(ObjC Class EH) " + Name.str();
40 case SymbolKind::ObjectiveCInstanceVariable:
41 Result += "(ObjC IVar) " + Name.str();
48 Symbol::const_filtered_target_range
49 Symbol::targets(ArchitectureSet Architectures) const {
50 std::function<bool(const Target &)> FN =
51 [Architectures](const Target &Target) {
52 return Architectures.has(Target.Arch);
54 return make_filter_range(Targets, FN);
57 } // end namespace MachO.
58 } // end namespace llvm.