mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-29 22:21:51 +00:00
Added symbol table access through the module for now. We might need to expose
a SBSymtab class, but for now, we expose the symbols through the module. llvm-svn: 121112
This commit is contained in:
1 parent
0d71c4f564
commit
bbdabce2f7
4 files changed
+49
-1
No files matched your search
@@ -181,3 +181,36 @@ SBModule::GetDescription (SBStream &description)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t
|
||||
SBModule::GetNumSymbols ()
|
||||
{
|
||||
if (m_opaque_sp)
|
||||
{
|
||||
ObjectFile *obj_file = m_opaque_sp->GetObjectFile();
|
||||
if (obj_file)
|
||||
{
|
||||
Symtab *symtab = obj_file->GetSymtab();
|
||||
if (symtab)
|
||||
return symtab->GetNumSymbols();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
SBSymbol
|
||||
SBModule::GetSymbolAtIndex (size_t idx)
|
||||
{
|
||||
SBSymbol sb_symbol;
|
||||
if (m_opaque_sp)
|
||||
{
|
||||
ObjectFile *obj_file = m_opaque_sp->GetObjectFile();
|
||||
if (obj_file)
|
||||
{
|
||||
Symtab *symtab = obj_file->GetSymtab();
|
||||
if (symtab)
|
||||
sb_symbol.SetSymbol(symtab->SymbolAtIndex (idx));
|
||||
}
|
||||
}
|
||||
return sb_symbol;
|
||||
}
|
||||
Reference in new issue
Block a user