Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add findModulesByName(std::string const&) #1552

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions symtabAPI/doc/API/Symtab/Symtab.tex
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ \subsubsection{Module lookup}
This method searches for a module with name \code{name}. If the module exists returns \code{true} with \code{ret} set to the module handle; otherwise returns \code{false} with \code{ret} set to \code{NULL}.
}

\begin{apient}
std::vector<Module*> findModulesByName(std::string const& name) const
\end{apient}
\apidesc{
Retrieve all modules with name \code{name}.
}

\begin{apient}
Module* findModuleByOffset(Offset offset) const
\end{apient}
Expand Down
1 change: 1 addition & 0 deletions symtabAPI/h/Symtab.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class SYMTAB_EXPORT Symtab : public LookupInterface,
/*[[deprecated]]*/ bool findModuleByOffset(Module *& ret, Offset off);
Module* findModuleByOffset(Offset offset) const;
bool findModuleByName(Module *&ret, const std::string name);
std::vector<Module*> findModulesByName(std::string const& name) const;
Module *getDefaultModule() const;

// Region
Expand Down
4 changes: 4 additions & 0 deletions symtabAPI/src/Symtab-lookup.C
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,10 @@ bool Symtab::findModuleByName(Module *&ret, const std::string name)
return false;
}

std::vector<Module*> Symtab::findModulesByName(std::string const& name) const {
return impl->modules.find(name);
}

bool Symtab::getAllRegions(std::vector<Region *>&ret)
{
if (regions_.size() > 0)
Expand Down