diff options
Diffstat (limited to 'source/Symbol/CompilerDeclContext.cpp')
-rw-r--r-- | source/Symbol/CompilerDeclContext.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/source/Symbol/CompilerDeclContext.cpp b/source/Symbol/CompilerDeclContext.cpp index 43a83bbca77bd..a6f046c4eb22e 100644 --- a/source/Symbol/CompilerDeclContext.cpp +++ b/source/Symbol/CompilerDeclContext.cpp @@ -1,9 +1,8 @@ //===-- CompilerDeclContext.cpp ---------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -60,6 +59,19 @@ bool CompilerDeclContext::IsClassMethod(lldb::LanguageType *language_ptr, return false; } +bool CompilerDeclContext::IsContainedInLookup(CompilerDeclContext other) const { + if (!IsValid()) + return false; + + // If the other context is just the current context, we don't need to go + // over the type system to know that the lookup is identical. + if (this == &other) + return true; + + return m_type_system->DeclContextIsContainedInLookup(m_opaque_decl_ctx, + other.m_opaque_decl_ctx); +} + bool lldb_private::operator==(const lldb_private::CompilerDeclContext &lhs, const lldb_private::CompilerDeclContext &rhs) { return lhs.GetTypeSystem() == rhs.GetTypeSystem() && |