blob: 42e5fb0810711348c1e2962fd34a960e57ea8719 [file] [log] [blame]
Paul Hermand628cbb2015-09-15 23:44:17 +00001//===-- 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
14using namespace lldb_private;
15
16bool
17CompilerDecl::IsClang () const
18{
19 return IsValid() && m_type_system->getKind() == TypeSystem::eKindClang;
20}
21
22ConstString
23CompilerDecl::GetName() const
24{
25 return m_type_system->DeclGetName(m_opaque_decl);
26}
27
Greg Claytonfe689042015-11-10 17:47:04 +000028ConstString
29CompilerDecl::GetMangledName () const
30{
31 return m_type_system->DeclGetMangledName(m_opaque_decl);
32}
33
Paul Hermand628cbb2015-09-15 23:44:17 +000034lldb::VariableSP
35CompilerDecl::GetAsVariable ()
36{
37 return m_type_system->DeclGetVariable(m_opaque_decl);
38}
39
Greg Claytonfe689042015-11-10 17:47:04 +000040CompilerDeclContext
41CompilerDecl::GetDeclContext() const
42{
43 return m_type_system->DeclGetDeclContext(m_opaque_decl);
44}
45
46CompilerType
47CompilerDecl::GetFunctionReturnType() const
48{
49 return m_type_system->DeclGetFunctionReturnType(m_opaque_decl);
50}
51
52size_t
53CompilerDecl::GetNumFunctionArguments() const
54{
55 return m_type_system->DeclGetFunctionNumArguments(m_opaque_decl);
56}
57
58CompilerType
59CompilerDecl::GetFunctionArgumentType (size_t arg_idx) const
60{
61 return m_type_system->DeclGetFunctionArgumentType(m_opaque_decl, arg_idx);
62}
63
Paul Hermand628cbb2015-09-15 23:44:17 +000064bool
65lldb_private::operator == (const lldb_private::CompilerDecl &lhs, const lldb_private::CompilerDecl &rhs)
66{
67 return lhs.GetTypeSystem() == rhs.GetTypeSystem() && lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl();
68}
69
70
71bool
72lldb_private::operator != (const lldb_private::CompilerDecl &lhs, const lldb_private::CompilerDecl &rhs)
73{
74 return lhs.GetTypeSystem() != rhs.GetTypeSystem() || lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl();
75}
76