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