1 //===-- CompilerDeclContext.cpp ---------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lldb/Symbol/CompilerDeclContext.h"
11 #include "lldb/Symbol/CompilerDecl.h"
12 #include "lldb/Symbol/TypeSystem.h"
15 using namespace lldb_private;
17 std::vector<CompilerDecl>
18 CompilerDeclContext::FindDeclByName(ConstString name,
19 const bool ignore_using_decls) {
21 return m_type_system->DeclContextFindDeclByName(m_opaque_decl_ctx, name,
24 return std::vector<CompilerDecl>();
27 bool CompilerDeclContext::IsClang() const {
28 return IsValid() && m_type_system->getKind() == TypeSystem::eKindClang;
31 ConstString CompilerDeclContext::GetName() const {
33 return m_type_system->DeclContextGetName(m_opaque_decl_ctx);
38 ConstString CompilerDeclContext::GetScopeQualifiedName() const {
40 return m_type_system->DeclContextGetScopeQualifiedName(m_opaque_decl_ctx);
45 bool CompilerDeclContext::IsStructUnionOrClass() const {
47 return m_type_system->DeclContextIsStructUnionOrClass(m_opaque_decl_ctx);
52 bool CompilerDeclContext::IsClassMethod(lldb::LanguageType *language_ptr,
53 bool *is_instance_method_ptr,
54 ConstString *language_object_name_ptr) {
56 return m_type_system->DeclContextIsClassMethod(
57 m_opaque_decl_ctx, language_ptr, is_instance_method_ptr,
58 language_object_name_ptr);
63 bool lldb_private::operator==(const lldb_private::CompilerDeclContext &lhs,
64 const lldb_private::CompilerDeclContext &rhs) {
65 return lhs.GetTypeSystem() == rhs.GetTypeSystem() &&
66 lhs.GetOpaqueDeclContext() == rhs.GetOpaqueDeclContext();
69 bool lldb_private::operator!=(const lldb_private::CompilerDeclContext &lhs,
70 const lldb_private::CompilerDeclContext &rhs) {
71 return lhs.GetTypeSystem() != rhs.GetTypeSystem() ||
72 lhs.GetOpaqueDeclContext() != rhs.GetOpaqueDeclContext();