1*80814287SRaphael Isemann //===-- CompilerDecl.cpp --------------------------------------------------===// 2d628cbb9SPaul Herman // 32946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 42946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 52946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6d628cbb9SPaul Herman // 7d628cbb9SPaul Herman //===----------------------------------------------------------------------===// 8d628cbb9SPaul Herman 9d628cbb9SPaul Herman #include "lldb/Symbol/CompilerDecl.h" 10d628cbb9SPaul Herman #include "lldb/Symbol/CompilerDeclContext.h" 11d628cbb9SPaul Herman #include "lldb/Symbol/TypeSystem.h" 12d628cbb9SPaul Herman 13d628cbb9SPaul Herman using namespace lldb_private; 14d628cbb9SPaul Herman GetName() const15b9c1b51eSKate StoneConstString CompilerDecl::GetName() const { 16d628cbb9SPaul Herman return m_type_system->DeclGetName(m_opaque_decl); 17d628cbb9SPaul Herman } 18d628cbb9SPaul Herman GetMangledName() const19b9c1b51eSKate StoneConstString CompilerDecl::GetMangledName() const { 20fe68904fSGreg Clayton return m_type_system->DeclGetMangledName(m_opaque_decl); 21fe68904fSGreg Clayton } 22fe68904fSGreg Clayton GetDeclContext() const23b9c1b51eSKate StoneCompilerDeclContext CompilerDecl::GetDeclContext() const { 24fe68904fSGreg Clayton return m_type_system->DeclGetDeclContext(m_opaque_decl); 25fe68904fSGreg Clayton } 26fe68904fSGreg Clayton GetFunctionReturnType() const27b9c1b51eSKate StoneCompilerType CompilerDecl::GetFunctionReturnType() const { 28fe68904fSGreg Clayton return m_type_system->DeclGetFunctionReturnType(m_opaque_decl); 29fe68904fSGreg Clayton } 30fe68904fSGreg Clayton GetNumFunctionArguments() const31b9c1b51eSKate Stonesize_t CompilerDecl::GetNumFunctionArguments() const { 32fe68904fSGreg Clayton return m_type_system->DeclGetFunctionNumArguments(m_opaque_decl); 33fe68904fSGreg Clayton } 34fe68904fSGreg Clayton GetFunctionArgumentType(size_t arg_idx) const35b9c1b51eSKate StoneCompilerType CompilerDecl::GetFunctionArgumentType(size_t arg_idx) const { 36fe68904fSGreg Clayton return m_type_system->DeclGetFunctionArgumentType(m_opaque_decl, arg_idx); 37fe68904fSGreg Clayton } 38fe68904fSGreg Clayton operator ==(const lldb_private::CompilerDecl & lhs,const lldb_private::CompilerDecl & rhs)39b9c1b51eSKate Stonebool lldb_private::operator==(const lldb_private::CompilerDecl &lhs, 40b9c1b51eSKate Stone const lldb_private::CompilerDecl &rhs) { 41b9c1b51eSKate Stone return lhs.GetTypeSystem() == rhs.GetTypeSystem() && 42b9c1b51eSKate Stone lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl(); 43d628cbb9SPaul Herman } 44d628cbb9SPaul Herman operator !=(const lldb_private::CompilerDecl & lhs,const lldb_private::CompilerDecl & rhs)45b9c1b51eSKate Stonebool lldb_private::operator!=(const lldb_private::CompilerDecl &lhs, 46b9c1b51eSKate Stone const lldb_private::CompilerDecl &rhs) { 47b9c1b51eSKate Stone return lhs.GetTypeSystem() != rhs.GetTypeSystem() || 48b9c1b51eSKate Stone lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl(); 49d628cbb9SPaul Herman } 50