[MIPS GlobalISel] Select float constants
[llvm-complete.git] / lib / TextAPI / MachO / Symbol.cpp
blob8c9ec78a96a4c706a713bb1fe300c23940c3001f
1 //===- Symbol.cpp ---------------------------------------------------------===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Implements the Symbol.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/TextAPI/MachO/Symbol.h"
14 #include <string>
16 namespace llvm {
17 namespace MachO {
19 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
20 LLVM_DUMP_METHOD void Symbol::dump(raw_ostream &OS) const {
21 std::string Result;
22 if (isUndefined())
23 Result += "(undef) ";
24 if (isWeakDefined())
25 Result += "(weak-def) ";
26 if (isWeakReferenced())
27 Result += "(weak-ref) ";
28 if (isThreadLocalValue())
29 Result += "(tlv) ";
30 switch (Kind) {
31 case SymbolKind::GlobalSymbol:
32 Result + Name.str();
33 break;
34 case SymbolKind::ObjectiveCClass:
35 Result + "(ObjC Class) " + Name.str();
36 break;
37 case SymbolKind::ObjectiveCClassEHType:
38 Result + "(ObjC Class EH) " + Name.str();
39 break;
40 case SymbolKind::ObjectiveCInstanceVariable:
41 Result + "(ObjC IVar) " + Name.str();
42 break;
44 OS << Result;
46 #endif
48 } // end namespace MachO.
49 } // end namespace llvm.