blob: 8500c8bd8a6b0a9a8011696a147d632cb30b4c59 [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- SBSymbol.cpp --------------------------------------------*- 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#include "lldb/API/SBSymbol.h"
11#include "lldb/Symbol/Symbol.h"
12
13using namespace lldb;
14
15
16SBSymbol::SBSymbol () :
17 m_lldb_object_ptr (NULL)
18{
19}
20
21SBSymbol::SBSymbol (lldb_private::Symbol *lldb_object_ptr) :
22 m_lldb_object_ptr (lldb_object_ptr)
23{
24}
25
26SBSymbol::~SBSymbol ()
27{
28 m_lldb_object_ptr = NULL;
29}
30
31bool
32SBSymbol::IsValid () const
33{
34 return m_lldb_object_ptr != NULL;
35}
36
37const char *
38SBSymbol::GetName() const
39{
40 if (m_lldb_object_ptr)
41 return m_lldb_object_ptr->GetMangled().GetName().AsCString();
42 return NULL;
43}
44
45const char *
46SBSymbol::GetMangledName () const
47{
48 if (m_lldb_object_ptr)
49 return m_lldb_object_ptr->GetMangled().GetMangledName().AsCString();
50 return NULL;
51}
52
53
54bool
55SBSymbol::operator == (const SBSymbol &rhs) const
56{
57 return m_lldb_object_ptr == rhs.m_lldb_object_ptr;
58}
59
60bool
61SBSymbol::operator != (const SBSymbol &rhs) const
62{
63 return m_lldb_object_ptr != rhs.m_lldb_object_ptr;
64}