1 //===-- CompilerDecl.cpp ----------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "lldb/Symbol/CompilerDecl.h" 11 #include "lldb/Symbol/CompilerDeclContext.h" 12 #include "lldb/Symbol/TypeSystem.h" 13 14 using namespace lldb_private; 15 16 bool 17 CompilerDecl::IsClang () const 18 { 19 return IsValid() && m_type_system->getKind() == TypeSystem::eKindClang; 20 } 21 22 ConstString 23 CompilerDecl::GetName() const 24 { 25 return m_type_system->DeclGetName(m_opaque_decl); 26 } 27 28 lldb::VariableSP 29 CompilerDecl::GetAsVariable () 30 { 31 return m_type_system->DeclGetVariable(m_opaque_decl); 32 } 33 34 bool 35 lldb_private::operator == (const lldb_private::CompilerDecl &lhs, const lldb_private::CompilerDecl &rhs) 36 { 37 return lhs.GetTypeSystem() == rhs.GetTypeSystem() && lhs.GetOpaqueDecl() == rhs.GetOpaqueDecl(); 38 } 39 40 41 bool 42 lldb_private::operator != (const lldb_private::CompilerDecl &lhs, const lldb_private::CompilerDecl &rhs) 43 { 44 return lhs.GetTypeSystem() != rhs.GetTypeSystem() || lhs.GetOpaqueDecl() != rhs.GetOpaqueDecl(); 45 } 46 47