15ffd83dbSDimitry Andric //===-- CompilerDecl.cpp --------------------------------------------------===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #include "lldb/Symbol/CompilerDecl.h"
100b57cec5SDimitry Andric #include "lldb/Symbol/CompilerDeclContext.h"
110b57cec5SDimitry Andric #include "lldb/Symbol/TypeSystem.h"
120b57cec5SDimitry Andric 
130b57cec5SDimitry Andric using namespace lldb_private;
140b57cec5SDimitry Andric 
GetName() const150b57cec5SDimitry Andric ConstString CompilerDecl::GetName() const {
160b57cec5SDimitry Andric   return m_type_system->DeclGetName(m_opaque_decl);
170b57cec5SDimitry Andric }
180b57cec5SDimitry Andric 
GetMangledName() const190b57cec5SDimitry Andric ConstString CompilerDecl::GetMangledName() const {
200b57cec5SDimitry Andric   return m_type_system->DeclGetMangledName(m_opaque_decl);
210b57cec5SDimitry Andric }
220b57cec5SDimitry Andric 
GetDeclContext() const230b57cec5SDimitry Andric CompilerDeclContext CompilerDecl::GetDeclContext() const {
240b57cec5SDimitry Andric   return m_type_system->DeclGetDeclContext(m_opaque_decl);
250b57cec5SDimitry Andric }
260b57cec5SDimitry Andric 
GetFunctionReturnType() const270b57cec5SDimitry Andric CompilerType CompilerDecl::GetFunctionReturnType() const {
280b57cec5SDimitry Andric   return m_type_system->DeclGetFunctionReturnType(m_opaque_decl);
290b57cec5SDimitry Andric }
300b57cec5SDimitry Andric 
GetNumFunctionArguments() const310b57cec5SDimitry Andric size_t CompilerDecl::GetNumFunctionArguments() const {
320b57cec5SDimitry Andric   return m_type_system->DeclGetFunctionNumArguments(m_opaque_decl);
330b57cec5SDimitry Andric }
340b57cec5SDimitry Andric 
GetFunctionArgumentType(size_t arg_idx) const350b57cec5SDimitry Andric CompilerType CompilerDecl::GetFunctionArgumentType(size_t arg_idx) const {
360b57cec5SDimitry Andric   return m_type_system->DeclGetFunctionArgumentType(m_opaque_decl, arg_idx);
370b57cec5SDimitry Andric }
380b57cec5SDimitry Andric 
operator ==(const lldb_private::CompilerDecl & lhs,const lldb_private::CompilerDecl & rhs)390b57cec5SDimitry Andric bool lldb_private::operator==(const lldb_private::CompilerDecl &lhs,
400b57cec5SDimitry Andric                               const lldb_private::CompilerDecl &rhs) {
410b57cec5SDimitry Andric   return lhs.GetTypeSystem() == rhs.GetTypeSystem() &&
420b57cec5SDimitry Andric          lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl();
430b57cec5SDimitry Andric }
440b57cec5SDimitry Andric 
operator !=(const lldb_private::CompilerDecl & lhs,const lldb_private::CompilerDecl & rhs)450b57cec5SDimitry Andric bool lldb_private::operator!=(const lldb_private::CompilerDecl &lhs,
460b57cec5SDimitry Andric                               const lldb_private::CompilerDecl &rhs) {
470b57cec5SDimitry Andric   return lhs.GetTypeSystem() != rhs.GetTypeSystem() ||
480b57cec5SDimitry Andric          lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl();
490b57cec5SDimitry Andric }
50*c9157d92SDimitry Andric 
51*c9157d92SDimitry Andric std::vector<lldb_private::CompilerContext>
GetCompilerContext() const52*c9157d92SDimitry Andric CompilerDecl::GetCompilerContext() const {
53*c9157d92SDimitry Andric   return m_type_system->DeclGetCompilerContext(m_opaque_decl);
54*c9157d92SDimitry Andric }
55