Add APIs on SBFunction and SBCompileUnit to inquire about the language type that the function/compile unit is defined in

llvm-svn: 222189
This commit is contained in:
Enrico Granata 2014-11-17 23:06:20 +00:00
parent d970702ab3
commit 6cd8e0c9b0
6 changed files with 30 additions and 0 deletions

View File

@ -78,6 +78,9 @@ public:
lldb::SBTypeList
GetTypes (uint32_t type_mask = lldb::eTypeClassAny);
lldb::LanguageType
GetLanguage ();
bool
operator == (const lldb::SBCompileUnit &rhs) const;

View File

@ -58,6 +58,9 @@ public:
lldb::SBBlock
GetBlock ();
lldb::LanguageType
GetLanguage ();
bool
operator == (const lldb::SBFunction &rhs) const;

View File

@ -106,6 +106,9 @@ public:
lldb::SBTypeList
GetTypes (uint32_t type_mask = lldb::eTypeClassAny);
lldb::LanguageType
GetLanguage ();
bool
GetDescription (lldb::SBStream &description);

View File

@ -82,6 +82,9 @@ public:
lldb::SBBlock
GetBlock ();
lldb::LanguageType
GetLanguage ();
bool
GetDescription (lldb::SBStream &description);

View File

@ -228,6 +228,14 @@ SBCompileUnit::FindSupportFileIndex (uint32_t start_idx, const SBFileSpec &sb_fi
return 0;
}
lldb::LanguageType
SBCompileUnit::GetLanguage ()
{
if (m_opaque_ptr)
return m_opaque_ptr->GetLanguage();
return lldb::eLanguageTypeUnknown;
}
bool
SBCompileUnit::IsValid () const
{

View File

@ -227,5 +227,15 @@ SBFunction::GetBlock ()
return sb_block;
}
lldb::LanguageType
SBFunction::GetLanguage ()
{
if (m_opaque_ptr)
{
if (m_opaque_ptr->GetCompileUnit())
return m_opaque_ptr->GetCompileUnit()->GetLanguage();
}
return lldb::eLanguageTypeUnknown;
}