Export the ability to see if a symbol is externally visible and also if the symbol was synthetically added to the symbol table (the symbol was not part of the symbol table itself but came from another section).



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153893 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/lldb/API/SBSymbol.h b/include/lldb/API/SBSymbol.h
index 6315794..ddfff27 100644
--- a/include/lldb/API/SBSymbol.h
+++ b/include/lldb/API/SBSymbol.h
@@ -64,6 +64,20 @@
     bool
     GetDescription (lldb::SBStream &description);
 
+    //----------------------------------------------------------------------
+    // Returns true if the symbol is externally visible in the module that
+    // it is defined in
+    //----------------------------------------------------------------------
+    bool
+    IsExternal();
+
+    //----------------------------------------------------------------------
+    // Returns true if the symbol was synthetically generated from something
+    // other than the actual symbol table itself in the object file.
+    //----------------------------------------------------------------------
+    bool
+    IsSynthetic();
+
 protected:
 
     lldb_private::Symbol *
diff --git a/scripts/Python/interface/SBSymbol.i b/scripts/Python/interface/SBSymbol.i
index 0b5342a..4995c4f 100644
--- a/scripts/Python/interface/SBSymbol.i
+++ b/scripts/Python/interface/SBSymbol.i
@@ -52,7 +52,13 @@
 
     bool
     GetDescription (lldb::SBStream &description);
-    
+
+    bool
+    IsExternal();
+
+    bool
+    IsSynthetic();
+
     %pythoncode %{
         def get_instructions_from_current_target (self):
             return self.GetInstructions (target)
@@ -77,6 +83,13 @@
         
         __swig_getmethods__["instructions"] = get_instructions_from_current_target
         if _newclass: x = property(get_instructions_from_current_target, None)
+
+        __swig_getmethods__["external"] = IsExternal
+        if _newclass: x = property(IsExternal, None)
+
+        __swig_getmethods__["synthetic"] = IsSynthetic
+        if _newclass: x = property(IsSynthetic, None)
+
         
     %}
 
diff --git a/source/API/SBSymbol.cpp b/source/API/SBSymbol.cpp
index 4a89567..9b82f36 100644
--- a/source/API/SBSymbol.cpp
+++ b/source/API/SBSymbol.cpp
@@ -199,3 +199,20 @@
         return m_opaque_ptr->GetType();
     return eSymbolTypeInvalid;
 }
+
+bool
+SBSymbol::IsExternal()
+{
+    if (m_opaque_ptr)
+        return m_opaque_ptr->IsExternal();
+    return false;
+}
+
+bool
+SBSymbol::IsSynthetic()
+{
+    if (m_opaque_ptr)
+        return m_opaque_ptr->IsSynthetic();
+    return false;
+}
+