blob: c4beff1a14e2930bf52a59181f0a868673fd4ae6 [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 () :
Greg Clayton63094e02010-06-23 01:19:29 +000018 m_opaque_ptr (NULL)
Chris Lattner24943d22010-06-08 16:52:24 +000019{
20}
21
22SBFunction::SBFunction (lldb_private::Function *lldb_object_ptr) :
Greg Clayton63094e02010-06-23 01:19:29 +000023 m_opaque_ptr (lldb_object_ptr)
Chris Lattner24943d22010-06-08 16:52:24 +000024{
25}
26
27SBFunction::~SBFunction ()
28{
Greg Clayton63094e02010-06-23 01:19:29 +000029 m_opaque_ptr = NULL;
Chris Lattner24943d22010-06-08 16:52:24 +000030}
31
32bool
33SBFunction::IsValid () const
34{
Greg Clayton63094e02010-06-23 01:19:29 +000035 return m_opaque_ptr != NULL;
Chris Lattner24943d22010-06-08 16:52:24 +000036}
37
38const char *
39SBFunction::GetName() const
40{
Greg Clayton63094e02010-06-23 01:19:29 +000041 if (m_opaque_ptr)
42 return m_opaque_ptr->GetMangled().GetName().AsCString();
Chris Lattner24943d22010-06-08 16:52:24 +000043 return NULL;
44}
45
46const char *
47SBFunction::GetMangledName () const
48{
Greg Clayton63094e02010-06-23 01:19:29 +000049 if (m_opaque_ptr)
50 return m_opaque_ptr->GetMangled().GetMangledName().AsCString();
Chris Lattner24943d22010-06-08 16:52:24 +000051 return NULL;
52}
53
54bool
55SBFunction::operator == (const SBFunction &rhs) const
56{
Greg Clayton63094e02010-06-23 01:19:29 +000057 return m_opaque_ptr == rhs.m_opaque_ptr;
Chris Lattner24943d22010-06-08 16:52:24 +000058}
59
60bool
61SBFunction::operator != (const SBFunction &rhs) const
62{
Greg Clayton63094e02010-06-23 01:19:29 +000063 return m_opaque_ptr != rhs.m_opaque_ptr;
Chris Lattner24943d22010-06-08 16:52:24 +000064}