LLDB  mainline
CompilerDeclContext.cpp
Go to the documentation of this file.
1 //===-- CompilerDeclContext.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 
11 #include "lldb/Symbol/TypeSystem.h"
12 #include <vector>
13 
14 using namespace lldb_private;
15 
16 std::vector<CompilerDecl>
18  const bool ignore_using_decls) {
19  if (IsValid())
21  ignore_using_decls);
22  return std::vector<CompilerDecl>();
23 }
24 
26  if (IsValid())
28  return ConstString();
29 }
30 
32  if (IsValid())
34  return ConstString();
35 }
36 
38  bool *is_instance_method_ptr,
39  ConstString *language_object_name_ptr) {
40  if (IsValid())
42  m_opaque_decl_ctx, language_ptr, is_instance_method_ptr,
43  language_object_name_ptr);
44  return false;
45 }
46 
48  if (!IsValid())
49  return false;
50 
51  // If the other context is just the current context, we don't need to go
52  // over the type system to know that the lookup is identical.
53  if (this == &other)
54  return true;
55 
57  other.m_opaque_decl_ctx);
58 }
59 
62  return lhs.GetTypeSystem() == rhs.GetTypeSystem() &&
64 }
65 
68  return lhs.GetTypeSystem() != rhs.GetTypeSystem() ||
70 }
lldb_private::CompilerDeclContext::FindDeclByName
std::vector< CompilerDecl > FindDeclByName(ConstString name, const bool ignore_using_decls)
Definition: CompilerDeclContext.cpp:17
CompilerDecl.h
lldb_private::CompilerDeclContext::GetScopeQualifiedName
ConstString GetScopeQualifiedName() const
Definition: CompilerDeclContext.cpp:31
lldb_private::CompilerDeclContext::m_opaque_decl_ctx
void * m_opaque_decl_ctx
Definition: CompilerDeclContext.h:121
lldb_private::CompilerDeclContext::GetOpaqueDeclContext
void * GetOpaqueDeclContext() const
Definition: CompilerDeclContext.h:103
lldb_private::TypeSystem::DeclContextGetName
virtual ConstString DeclContextGetName(void *opaque_decl_ctx)=0
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::TypeSystem::DeclContextIsClassMethod
virtual bool DeclContextIsClassMethod(void *opaque_decl_ctx, lldb::LanguageType *language_ptr, bool *is_instance_method_ptr, ConstString *language_object_name_ptr)=0
lldb_private::CompilerDeclContext::m_type_system
TypeSystem * m_type_system
Definition: CompilerDeclContext.h:120
lldb_private::operator==
bool operator==(const Address &lhs, const Address &rhs)
Definition: Address.cpp:986
lldb_private::CompilerDeclContext::IsValid
bool IsValid() const
Definition: CompilerDeclContext.h:55
lldb_private::TypeSystem::DeclContextFindDeclByName
virtual std::vector< CompilerDecl > DeclContextFindDeclByName(void *opaque_decl_ctx, ConstString name, const bool ignore_imported_decls)
Definition: TypeSystem.cpp:169
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::TypeSystem::DeclContextIsContainedInLookup
virtual bool DeclContextIsContainedInLookup(void *opaque_decl_ctx, void *other_opaque_decl_ctx)=0
lldb_private::CompilerDeclContext::GetName
ConstString GetName() const
Definition: CompilerDeclContext.cpp:25
TypeSystem.h
lldb_private::CompilerDeclContext
Represents a generic declaration context in a program.
Definition: CompilerDeclContext.h:30
lldb_private::operator!=
bool operator!=(const Address &lhs, const Address &rhs)
Definition: Address.cpp:992
lldb_private::TypeSystem::DeclContextGetScopeQualifiedName
virtual ConstString DeclContextGetScopeQualifiedName(void *opaque_decl_ctx)=0
lldb_private::CompilerDeclContext::GetTypeSystem
TypeSystem * GetTypeSystem() const
Definition: CompilerDeclContext.h:101
CompilerDeclContext.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::CompilerDeclContext::IsContainedInLookup
bool IsContainedInLookup(CompilerDeclContext other) const
Check if the given other decl context is contained in the lookup of this decl context (for example be...
Definition: CompilerDeclContext.cpp:47
lldb_private::CompilerDeclContext::IsClassMethod
bool IsClassMethod(lldb::LanguageType *language_ptr, bool *is_instance_method_ptr, ConstString *language_object_name_ptr)
Checks if this decl context represents a method of a class.
Definition: CompilerDeclContext.cpp:37