Add findFunctionInfoList() accessor to FunctionInfoIndex.

Summary:
This allows to query for a function in the map without creating an
entry, allowing to use a const FunctionInfoIndex.

Reviewers: tejohnson

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D14912

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 253953
This commit is contained in:
Mehdi Amini 2015-11-24 06:07:42 +00:00
parent bed60d35ed
commit 1d704cdedf
1 changed files with 5 additions and 0 deletions

View File

@ -194,6 +194,11 @@ public:
return FunctionMap[FuncName];
}
/// Get the list of function info objects for a given function.
const const_funcinfo_iterator findFunctionInfoList(StringRef FuncName) const {
return FunctionMap.find(FuncName);
}
/// Add a function info for a function of the given name.
void addFunctionInfo(StringRef FuncName, std::unique_ptr<FunctionInfo> Info) {
// Update the HasExportedFunctions flag, but only if we had a function