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 IsClang() const16bool CompilerDecl::IsClang() const { 17 return IsValid() && m_type_system->getKind() == TypeSystem::eKindClang; 18 } 19 GetName() const20ConstString CompilerDecl::GetName() const { 21 return m_type_system->DeclGetName(m_opaque_decl); 22 } 23 GetMangledName() const24ConstString CompilerDecl::GetMangledName() const { 25 return m_type_system->DeclGetMangledName(m_opaque_decl); 26 } 27 GetDeclContext() const28CompilerDeclContext CompilerDecl::GetDeclContext() const { 29 return m_type_system->DeclGetDeclContext(m_opaque_decl); 30 } 31 GetFunctionReturnType() const32CompilerType CompilerDecl::GetFunctionReturnType() const { 33 return m_type_system->DeclGetFunctionReturnType(m_opaque_decl); 34 } 35 GetNumFunctionArguments() const36size_t CompilerDecl::GetNumFunctionArguments() const { 37 return m_type_system->DeclGetFunctionNumArguments(m_opaque_decl); 38 } 39 GetFunctionArgumentType(size_t arg_idx) const40CompilerType CompilerDecl::GetFunctionArgumentType(size_t arg_idx) const { 41 return m_type_system->DeclGetFunctionArgumentType(m_opaque_decl, arg_idx); 42 } 43 operator ==(const lldb_private::CompilerDecl & lhs,const lldb_private::CompilerDecl & rhs)44bool lldb_private::operator==(const lldb_private::CompilerDecl &lhs, 45 const lldb_private::CompilerDecl &rhs) { 46 return lhs.GetTypeSystem() == rhs.GetTypeSystem() && 47 lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl(); 48 } 49 operator !=(const lldb_private::CompilerDecl & lhs,const lldb_private::CompilerDecl & rhs)50bool lldb_private::operator!=(const lldb_private::CompilerDecl &lhs, 51 const lldb_private::CompilerDecl &rhs) { 52 return lhs.GetTypeSystem() != rhs.GetTypeSystem() || 53 lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl(); 54 } 55