1 | //===-- CompilerDecl.cpp --------------------------------------------------===// |
---|---|
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | |
9 | #include "lldb/Symbol/CompilerDecl.h" |
10 | #include "lldb/Symbol/CompilerDeclContext.h" |
11 | #include "lldb/Symbol/TypeSystem.h" |
12 | |
13 | using namespace lldb_private; |
14 | |
15 | ConstString CompilerDecl::GetName() const { |
16 | return m_type_system->DeclGetName(opaque_decl: m_opaque_decl); |
17 | } |
18 | |
19 | ConstString CompilerDecl::GetMangledName() const { |
20 | return m_type_system->DeclGetMangledName(opaque_decl: m_opaque_decl); |
21 | } |
22 | |
23 | CompilerDeclContext CompilerDecl::GetDeclContext() const { |
24 | return m_type_system->DeclGetDeclContext(opaque_decl: m_opaque_decl); |
25 | } |
26 | |
27 | CompilerType CompilerDecl::GetFunctionReturnType() const { |
28 | return m_type_system->DeclGetFunctionReturnType(opaque_decl: m_opaque_decl); |
29 | } |
30 | |
31 | size_t CompilerDecl::GetNumFunctionArguments() const { |
32 | return m_type_system->DeclGetFunctionNumArguments(opaque_decl: m_opaque_decl); |
33 | } |
34 | |
35 | CompilerType CompilerDecl::GetFunctionArgumentType(size_t arg_idx) const { |
36 | return m_type_system->DeclGetFunctionArgumentType(opaque_decl: m_opaque_decl, arg_idx); |
37 | } |
38 | |
39 | bool lldb_private::operator==(const lldb_private::CompilerDecl &lhs, |
40 | const lldb_private::CompilerDecl &rhs) { |
41 | return lhs.GetTypeSystem() == rhs.GetTypeSystem() && |
42 | lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl(); |
43 | } |
44 | |
45 | bool lldb_private::operator!=(const lldb_private::CompilerDecl &lhs, |
46 | const lldb_private::CompilerDecl &rhs) { |
47 | return lhs.GetTypeSystem() != rhs.GetTypeSystem() || |
48 | lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl(); |
49 | } |
50 | |
51 | std::vector<lldb_private::CompilerContext> |
52 | CompilerDecl::GetCompilerContext() const { |
53 | return m_type_system->DeclGetCompilerContext(opaque_decl: m_opaque_decl); |
54 | } |
55 |