Skip to content

Commit

Permalink
Add symtabAPI/src/indexed_symbols.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent f448335 commit 9518eb9
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/symtabAPI/developer/API.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ SymtabAPI
emitWin.h
Function.h
indexed_modules.h
indexed_symbols.h
LineInformation.h
LinkMap.h
Module.h
Expand Down
52 changes: 52 additions & 0 deletions docs/symtabAPI/developer/indexed_symbols.h.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.. _`sec-dev:indexed_symbols.h`:

indexed_symbols.h
#################

.. cpp:namespace:: Dyninst::SymtabAPI::dev

.. cpp:struct:: indexed_symbols

.. cpp:type:: Dyninst::dyn_c_hash_map<st::Symbol *, Dyninst::Offset> master_t
.. cpp:type:: std::vector<st::Symbol *> symvec_t
.. cpp:type:: Dyninst::dyn_c_hash_map<Dyninst::Offset, symvec_t> by_offset_t
.. cpp:type:: Dyninst::dyn_c_hash_map<std::string, symvec_t> by_name_t
.. cpp:member:: master_t master
.. cpp:member:: by_offset_t by_offset
.. cpp:member:: by_name_t by_mangled
.. cpp:member:: by_name_t by_pretty
.. cpp:member:: by_name_t by_typed

.. cpp:function:: bool insert(st::Symbol *s)

Only inserts if not present. Returns whether it inserted. Operations on the indexed_symbols compound table.

.. cpp:function:: void clear()

Clears the table. Do not use in parallel.

.. cpp:function:: void erase(st::Symbol *s)

Erases Symbols from the table. Do not use in parallel.

.. cpp:function:: iterator begin()
.. cpp:function:: iterator end()

.. cpp:class:: indexed_symbols::iterator


Iterator for the symbols. Do not use in parallel.

.. cpp:member:: private master_t::iterator m
.. cpp:type:: iterator_category = std::forward_iterator_tag
.. cpp:type:: value_type = st::Symbol *
.. cpp:type:: difference_type = std::ptrdiff_t
.. cpp:type:: pointer = value_type *
.. cpp:type:: reference = value_type &
.. cpp:function:: iterator(master_t::iterator i)
.. cpp:function:: bool operator==(const iterator &x) const
.. cpp:function:: bool operator!=(const iterator &x) const
.. cpp:function:: st::Symbol *const &operator*() const
.. cpp:function:: st::Symbol *const *operator->() const
.. cpp:function:: iterator &operator++()
.. cpp:function:: iterator operator++(int)
5 changes: 0 additions & 5 deletions symtabAPI/src/indexed_symbols.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ struct indexed_symbols {
by_name_t by_pretty;
by_name_t by_typed;

// Only inserts if not present. Returns whether it inserted.
// Operations on the indexed_symbols compound table.
bool insert(st::Symbol *s) {
Dyninst::Offset o = s->getOffset();
master_t::accessor a;
Expand Down Expand Up @@ -54,7 +52,6 @@ struct indexed_symbols {
return false;
}

// Clears the table. Do not use in parallel.
void clear() {
master.clear();
by_offset.clear();
Expand All @@ -63,7 +60,6 @@ struct indexed_symbols {
by_typed.clear();
}

// Erases Symbols from the table. Do not use in parallel.
void erase(st::Symbol *s) {
if (master.erase(s)) {
{
Expand Down Expand Up @@ -97,7 +93,6 @@ struct indexed_symbols {
}
}

// Iterator for the symbols. Do not use in parallel.
class iterator {
master_t::iterator m;

Expand Down

0 comments on commit 9518eb9

Please sign in to comment.