1 //===-- CompilerDecl.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/Symbol/CompilerDecl.h" 11 #include "lldb/Symbol/CompilerDeclContext.h" 12 #include "lldb/Symbol/TypeSystem.h" 13 14 using namespace lldb_private; 15 16 bool 17 CompilerDecl::IsClang () const 18 { 19 return IsValid() && m_type_system->getKind() == TypeSystem::eKindClang; 20 } 21 22 ConstString 23 CompilerDecl::GetName() const 24 { 25 return m_type_system->DeclGetName(m_opaque_decl); 26 } 27 28 ConstString 29 CompilerDecl::GetMangledName () const 30 { 31 return m_type_system->DeclGetMangledName(m_opaque_decl); 32 } 33 34 lldb::VariableSP 35 CompilerDecl::GetAsVariable () 36 { 37 return m_type_system->DeclGetVariable(m_opaque_decl); 38 } 39 40 CompilerDeclContext 41 CompilerDecl::GetDeclContext() const 42 { 43 return m_type_system->DeclGetDeclContext(m_opaque_decl); 44 } 45 46 CompilerType 47 CompilerDecl::GetFunctionReturnType() const 48 { 49 return m_type_system->DeclGetFunctionReturnType(m_opaque_decl); 50 } 51 52 size_t 53 CompilerDecl::GetNumFunctionArguments() const 54 { 55 return m_type_system->DeclGetFunctionNumArguments(m_opaque_decl); 56 } 57 58 CompilerType 59 CompilerDecl::GetFunctionArgumentType (size_t arg_idx) const 60 { 61 return m_type_system->DeclGetFunctionArgumentType(m_opaque_decl, arg_idx); 62 } 63 64 bool 65 lldb_private::operator == (const lldb_private::CompilerDecl &lhs, const lldb_private::CompilerDecl &rhs) 66 { 67 return lhs.GetTypeSystem() == rhs.GetTypeSystem() && lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl(); 68 } 69 70 71 bool 72 lldb_private::operator != (const lldb_private::CompilerDecl &lhs, const lldb_private::CompilerDecl &rhs) 73 { 74 return lhs.GetTypeSystem() != rhs.GetTypeSystem() || lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl(); 75 } 76 77