public:
FunctionInfoIndex() = default;
- ~FunctionInfoIndex() = default;
// Disable the copy constructor and assignment operators, so
// no unexpected copying/moving occurs.
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) {
FunctionMap[FuncName].push_back(std::move(Info));
return ModulePathStringTable.insert(std::make_pair(ModPath, ModId))
.first->first();
}
+
+ /// Check if the given Module has any functions available for exporting
+ /// in the index. We consider any module present in the ModulePathStringTable
+ /// to have exported functions.
+ bool hasExportedFunctions(const Module &M) const {
+ return ModulePathStringTable.count(M.getModuleIdentifier());
+ }
};
} // End llvm namespace