return SymVector[V.Idx]->body();
}
-// Returns a list of defined symbols that match with a given pattern.
-template <class ELFT>
-std::vector<SymbolBody *> SymbolTable<ELFT>::findAll(StringRef GlobPat) {
- std::vector<SymbolBody *> Res;
- StringMatcher M({GlobPat});
- for (Symbol *Sym : SymVector) {
- SymbolBody *B = Sym->body();
- StringRef Name = B->getName();
- if (!B->isUndefined() && M.match(Name))
- Res.push_back(B);
- }
- return Res;
-}
-
template <class ELFT>
void SymbolTable<ELFT>::addLazyArchive(ArchiveFile *F,
const object::Archive::Symbol Sym) {
template <class ELFT>
std::vector<SymbolBody *> SymbolTable<ELFT>::findAll(SymbolVersion Ver) {
+ std::vector<SymbolBody *> Res;
+ StringMatcher M({Ver.Name});
+
if (Ver.IsExternCpp) {
initDemangledSyms();
- std::vector<SymbolBody *> Res;
- StringMatcher M({Ver.Name});
for (auto &P : *DemangledSyms)
if (M.match(P.first()))
for (SymbolBody *Body : P.second)
Res.push_back(Body);
return Res;
}
- return findAll(Ver.Name);
+
+ for (Symbol *Sym : SymVector) {
+ SymbolBody *B = Sym->body();
+ StringRef Name = B->getName();
+ if (!B->isUndefined() && M.match(Name))
+ Res.push_back(B);
+ }
+ return Res;
}
// If there's only one anonymous version definition in a version
std::vector<InputSectionBase<ELFT> *> Sections;
private:
- std::vector<SymbolBody *> findAll(StringRef GlobPat);
std::pair<Symbol *, bool> insert(StringRef Name);
std::pair<Symbol *, bool> insert(StringRef Name, uint8_t Type,
uint8_t Visibility, bool CanOmitFromDynSym,