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