Files
llvm/lldb/source/Symbol/CompilerDecl.cpp
Paul Herman d628cbb999 Search variables based on clang::DeclContext and clang::Decl tree
Summary: SymbolFileDWARF now creates VarDecl and BlockDecl and adds them to the Decl tree. Then, in ClangExpressionDeclMap it uses the Decl tree to search for a variable. This fixes lots of variable scoping problems.

Reviewers: sivachandra, chaoren, spyffe, clayborg

Subscribers: tberghammer, jingham, lldb-commits

Differential Revision: http://reviews.llvm.org/D12658

llvm-svn: 247746
2015-09-15 23:44:17 +00:00

47 lines
1.2 KiB
C++

//===-- CompilerDecl.cpp ----------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "lldb/Symbol/CompilerDecl.h"
#include "lldb/Symbol/CompilerDeclContext.h"
#include "lldb/Symbol/TypeSystem.h"
using namespace lldb_private;
bool
CompilerDecl::IsClang () const
{
return IsValid() && m_type_system->getKind() == TypeSystem::eKindClang;
}
ConstString
CompilerDecl::GetName() const
{
return m_type_system->DeclGetName(m_opaque_decl);
}
lldb::VariableSP
CompilerDecl::GetAsVariable ()
{
return m_type_system->DeclGetVariable(m_opaque_decl);
}
bool
lldb_private::operator == (const lldb_private::CompilerDecl &lhs, const lldb_private::CompilerDecl &rhs)
{
return lhs.GetTypeSystem() == rhs.GetTypeSystem() && lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl();
}
bool
lldb_private::operator != (const lldb_private::CompilerDecl &lhs, const lldb_private::CompilerDecl &rhs)
{
return lhs.GetTypeSystem() != rhs.GetTypeSystem() || lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl();
}