blob: 017e541bd203ca81ffd4eae184023461f7f80cb5 [file] [log] [blame]
Paul Hermand628cbb2015-09-15 23:44:17 +00001//===-- CompilerDecl.cpp ----------------------------------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Paul Hermand628cbb2015-09-15 23:44:17 +00006//
7//===----------------------------------------------------------------------===//
8
9#include "lldb/Symbol/CompilerDecl.h"
Raphael Isemann92d5ea5d2019-11-27 10:27:25 +010010#include "lldb/Symbol/ClangASTContext.h"
Paul Hermand628cbb2015-09-15 23:44:17 +000011#include "lldb/Symbol/CompilerDeclContext.h"
12#include "lldb/Symbol/TypeSystem.h"
13
14using namespace lldb_private;
15
Kate Stoneb9c1b512016-09-06 20:57:50 +000016ConstString CompilerDecl::GetName() const {
17 return m_type_system->DeclGetName(m_opaque_decl);
Paul Hermand628cbb2015-09-15 23:44:17 +000018}
19
Kate Stoneb9c1b512016-09-06 20:57:50 +000020ConstString CompilerDecl::GetMangledName() const {
21 return m_type_system->DeclGetMangledName(m_opaque_decl);
Greg Claytonfe689042015-11-10 17:47:04 +000022}
23
Kate Stoneb9c1b512016-09-06 20:57:50 +000024CompilerDeclContext CompilerDecl::GetDeclContext() const {
25 return m_type_system->DeclGetDeclContext(m_opaque_decl);
Greg Claytonfe689042015-11-10 17:47:04 +000026}
27
Kate Stoneb9c1b512016-09-06 20:57:50 +000028CompilerType CompilerDecl::GetFunctionReturnType() const {
29 return m_type_system->DeclGetFunctionReturnType(m_opaque_decl);
Greg Claytonfe689042015-11-10 17:47:04 +000030}
31
Kate Stoneb9c1b512016-09-06 20:57:50 +000032size_t CompilerDecl::GetNumFunctionArguments() const {
33 return m_type_system->DeclGetFunctionNumArguments(m_opaque_decl);
Greg Claytonfe689042015-11-10 17:47:04 +000034}
35
Kate Stoneb9c1b512016-09-06 20:57:50 +000036CompilerType CompilerDecl::GetFunctionArgumentType(size_t arg_idx) const {
37 return m_type_system->DeclGetFunctionArgumentType(m_opaque_decl, arg_idx);
Greg Claytonfe689042015-11-10 17:47:04 +000038}
39
Kate Stoneb9c1b512016-09-06 20:57:50 +000040bool lldb_private::operator==(const lldb_private::CompilerDecl &lhs,
41 const lldb_private::CompilerDecl &rhs) {
42 return lhs.GetTypeSystem() == rhs.GetTypeSystem() &&
43 lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl();
Paul Hermand628cbb2015-09-15 23:44:17 +000044}
45
Kate Stoneb9c1b512016-09-06 20:57:50 +000046bool lldb_private::operator!=(const lldb_private::CompilerDecl &lhs,
47 const lldb_private::CompilerDecl &rhs) {
48 return lhs.GetTypeSystem() != rhs.GetTypeSystem() ||
49 lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl();
Paul Hermand628cbb2015-09-15 23:44:17 +000050}