OSDN Git Service

[CallSiteSplitting] Report edge deletion to DomTreeUpdater
[android-x86/external-llvm.git] / lib / TextAPI / MachO / Symbol.cpp
1 //===- lib/TextAPI/Symbol.cpp - Symbol --------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// \brief Implements the Symbol
12 ///
13 //===----------------------------------------------------------------------===//
14
15 #include "llvm/TextAPI/MachO/Symbol.h"
16 #include <string>
17
18 namespace llvm {
19 namespace MachO {
20
21 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
22 LLVM_DUMP_METHOD void Symbol::dump(raw_ostream &OS) const {
23   std::string Result;
24   if (isUndefined())
25     Result += "(undef) ";
26   if (isWeakDefined())
27     Result += "(weak-def) ";
28   if (isWeakReferenced())
29     Result += "(weak-ref) ";
30   if (isThreadLocalValue())
31     Result += "(tlv) ";
32   switch (Kind) {
33   case SymbolKind::GlobalSymbol:
34     Result + Name.str();
35     break;
36   case SymbolKind::ObjectiveCClass:
37     Result + "(ObjC Class) " + Name.str();
38     break;
39   case SymbolKind::ObjectiveCClassEHType:
40     Result + "(ObjC Class EH) " + Name.str();
41     break;
42   case SymbolKind::ObjectiveCInstanceVariable:
43     Result + "(ObjC IVar) " + Name.str();
44     break;
45   }
46   OS << Result;
47 }
48 #endif
49
50 } // end namespace MachO.
51 } // end namespace llvm.