19f2f44ceSEd Maste //===-- CompilerDecl.cpp ----------------------------------------*- C++ -*-===//
29f2f44ceSEd Maste //
39f2f44ceSEd Maste //                     The LLVM Compiler Infrastructure
49f2f44ceSEd Maste //
59f2f44ceSEd Maste // This file is distributed under the University of Illinois Open Source
69f2f44ceSEd Maste // License. See LICENSE.TXT for details.
79f2f44ceSEd Maste //
89f2f44ceSEd Maste //===----------------------------------------------------------------------===//
99f2f44ceSEd Maste 
109f2f44ceSEd Maste #include "lldb/Symbol/CompilerDecl.h"
119f2f44ceSEd Maste #include "lldb/Symbol/CompilerDeclContext.h"
129f2f44ceSEd Maste #include "lldb/Symbol/TypeSystem.h"
139f2f44ceSEd Maste 
149f2f44ceSEd Maste using namespace lldb_private;
159f2f44ceSEd Maste 
IsClang() const16*435933ddSDimitry Andric bool CompilerDecl::IsClang() const {
179f2f44ceSEd Maste   return IsValid() && m_type_system->getKind() == TypeSystem::eKindClang;
189f2f44ceSEd Maste }
199f2f44ceSEd Maste 
GetName() const20*435933ddSDimitry Andric ConstString CompilerDecl::GetName() const {
219f2f44ceSEd Maste   return m_type_system->DeclGetName(m_opaque_decl);
229f2f44ceSEd Maste }
239f2f44ceSEd Maste 
GetMangledName() const24*435933ddSDimitry Andric ConstString CompilerDecl::GetMangledName() const {
259f2f44ceSEd Maste   return m_type_system->DeclGetMangledName(m_opaque_decl);
269f2f44ceSEd Maste }
279f2f44ceSEd Maste 
GetDeclContext() const28*435933ddSDimitry Andric CompilerDeclContext CompilerDecl::GetDeclContext() const {
299f2f44ceSEd Maste   return m_type_system->DeclGetDeclContext(m_opaque_decl);
309f2f44ceSEd Maste }
319f2f44ceSEd Maste 
GetFunctionReturnType() const32*435933ddSDimitry Andric CompilerType CompilerDecl::GetFunctionReturnType() const {
339f2f44ceSEd Maste   return m_type_system->DeclGetFunctionReturnType(m_opaque_decl);
349f2f44ceSEd Maste }
359f2f44ceSEd Maste 
GetNumFunctionArguments() const36*435933ddSDimitry Andric size_t CompilerDecl::GetNumFunctionArguments() const {
379f2f44ceSEd Maste   return m_type_system->DeclGetFunctionNumArguments(m_opaque_decl);
389f2f44ceSEd Maste }
399f2f44ceSEd Maste 
GetFunctionArgumentType(size_t arg_idx) const40*435933ddSDimitry Andric CompilerType CompilerDecl::GetFunctionArgumentType(size_t arg_idx) const {
419f2f44ceSEd Maste   return m_type_system->DeclGetFunctionArgumentType(m_opaque_decl, arg_idx);
429f2f44ceSEd Maste }
439f2f44ceSEd Maste 
operator ==(const lldb_private::CompilerDecl & lhs,const lldb_private::CompilerDecl & rhs)44*435933ddSDimitry Andric bool lldb_private::operator==(const lldb_private::CompilerDecl &lhs,
45*435933ddSDimitry Andric                               const lldb_private::CompilerDecl &rhs) {
46*435933ddSDimitry Andric   return lhs.GetTypeSystem() == rhs.GetTypeSystem() &&
47*435933ddSDimitry Andric          lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl();
489f2f44ceSEd Maste }
499f2f44ceSEd Maste 
operator !=(const lldb_private::CompilerDecl & lhs,const lldb_private::CompilerDecl & rhs)50*435933ddSDimitry Andric bool lldb_private::operator!=(const lldb_private::CompilerDecl &lhs,
51*435933ddSDimitry Andric                               const lldb_private::CompilerDecl &rhs) {
52*435933ddSDimitry Andric   return lhs.GetTypeSystem() != rhs.GetTypeSystem() ||
53*435933ddSDimitry Andric          lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl();
549f2f44ceSEd Maste }
55