Add APIs on SBFunction and SBCompileUnit to inquire about the language type that...
authorEnrico Granata <egranata@apple.com>
Mon, 17 Nov 2014 23:06:20 +0000 (23:06 +0000)
committerEnrico Granata <egranata@apple.com>
Mon, 17 Nov 2014 23:06:20 +0000 (23:06 +0000)
llvm-svn: 222189

lldb/include/lldb/API/SBCompileUnit.h
lldb/include/lldb/API/SBFunction.h
lldb/scripts/Python/interface/SBCompileUnit.i
lldb/scripts/Python/interface/SBFunction.i
lldb/source/API/SBCompileUnit.cpp
lldb/source/API/SBFunction.cpp

index 95af3d4..e2c2164 100644 (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;
 
index 49a3847..1b0d53d 100644 (file)
@@ -58,6 +58,9 @@ public:
 
     lldb::SBBlock
     GetBlock ();
+    
+    lldb::LanguageType
+    GetLanguage ();
 
     bool
     operator == (const lldb::SBFunction &rhs) const;
index a7e76cb..6147791 100644 (file)
@@ -106,6 +106,9 @@ public:
     lldb::SBTypeList
     GetTypes (uint32_t type_mask = lldb::eTypeClassAny);
     
+     lldb::LanguageType
+     GetLanguage ();
+             
     bool
     GetDescription (lldb::SBStream &description);
     
index 33cc448..d3660af 100644 (file)
@@ -82,6 +82,9 @@ public:
 
     lldb::SBBlock
     GetBlock ();
+    
+    lldb::LanguageType
+    GetLanguage ();
 
     bool
     GetDescription (lldb::SBStream &description);
index 03c2571..5d904ce 100644 (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
 {
index 3d185da..bf5e918 100644 (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;
+}