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 CompilerDeclContext
35 CompilerDecl::GetDeclContext() const
36 {
37     return m_type_system->DeclGetDeclContext(m_opaque_decl);
38 }
39 
40 CompilerType
41 CompilerDecl::GetFunctionReturnType() const
42 {
43     return m_type_system->DeclGetFunctionReturnType(m_opaque_decl);
44 }
45 
46 size_t
47 CompilerDecl::GetNumFunctionArguments() const
48 {
49     return m_type_system->DeclGetFunctionNumArguments(m_opaque_decl);
50 }
51 
52 CompilerType
53 CompilerDecl::GetFunctionArgumentType (size_t arg_idx) const
54 {
55     return m_type_system->DeclGetFunctionArgumentType(m_opaque_decl, arg_idx);
56 }
57 
58 bool
59 lldb_private::operator == (const lldb_private::CompilerDecl &lhs, const lldb_private::CompilerDecl &rhs)
60 {
61     return lhs.GetTypeSystem() == rhs.GetTypeSystem() && lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl();
62 }
63 
64 
65 bool
66 lldb_private::operator != (const lldb_private::CompilerDecl &lhs, const lldb_private::CompilerDecl &rhs)
67 {
68     return lhs.GetTypeSystem() != rhs.GetTypeSystem() || lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl();
69 }
70 
71