forked from OSchip/llvm-project
Adding the ability to get the language from a mangled name. This isn't used in the SVN LLDB, but will be used in another codebase based on the SVN LLDB.
llvm-svn: 226962
This commit is contained in:
parent
0b9858dca5
commit
94976f70af
|
@ -290,6 +290,25 @@ public:
|
|||
void
|
||||
SetValue (const ConstString &name);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
/// Get the language only if it is definitive what the language is from
|
||||
/// the mangling.
|
||||
///
|
||||
/// For a mangled name to have a language it must have both a mangled
|
||||
/// and a demangled name and it must be definitive from the mangling
|
||||
/// what the language is.
|
||||
///
|
||||
/// Standard C function names will return eLanguageTypeUnknown because
|
||||
/// they aren't mangled and it isn't clear what language the name
|
||||
/// represents (there will be no mangled name).
|
||||
///
|
||||
/// @return
|
||||
/// The language for the mangled/demangled name, eLanguageTypeUnknown
|
||||
/// if there is no mangled or demangled counterpart.
|
||||
//----------------------------------------------------------------------
|
||||
lldb::LanguageType
|
||||
GetLanguage ();
|
||||
|
||||
private:
|
||||
//----------------------------------------------------------------------
|
||||
/// Mangled member variables.
|
||||
|
|
|
@ -5352,6 +5352,21 @@ Mangled::MemorySize () const
|
|||
return m_mangled.MemorySize() + m_demangled.MemorySize();
|
||||
}
|
||||
|
||||
lldb::LanguageType
|
||||
Mangled::GetLanguage ()
|
||||
{
|
||||
ConstString mangled = GetMangledName();
|
||||
if (mangled)
|
||||
{
|
||||
if (GetDemangledName())
|
||||
{
|
||||
if (cstring_is_mangled(mangled.GetCString()))
|
||||
return lldb::eLanguageTypeC_plus_plus;
|
||||
}
|
||||
}
|
||||
return lldb::eLanguageTypeUnknown;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Dump OBJ to the supplied stream S.
|
||||
//----------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue