31 isInAbseilFile, AST_POLYMORPHIC_SUPPORTED_TYPES(Decl, Stmt, TypeLoc,
32 NestedNameSpecifierLoc)) {
33 auto &SourceManager = Finder->getASTContext().getSourceManager();
34 SourceLocation Loc = SourceManager.getSpellingLoc(Node.getBeginLoc());
37 OptionalFileEntryRef FileEntry =
38 SourceManager.getFileEntryRefForID(SourceManager.getFileID(Loc));
43 StringRef Path = FileEntry->getName();
44 static constexpr llvm::StringLiteral AbslPrefix(
"absl/");
45 size_t PrefixPosition = Path.find(AbslPrefix);
46 if (PrefixPosition == StringRef::npos)
48 Path = Path.drop_front(PrefixPosition + AbslPrefix.size());
49 static constexpr llvm::StringLiteral AbseilLibraries[] = {
50 "algorithm",
"base",
"container",
"debugging",
"flags",
51 "hash",
"iterator",
"memory",
"meta",
"numeric",
52 "profiling",
"random",
"status",
"strings",
"synchronization",
53 "time",
"types",
"utility"};
54 return llvm::any_of(AbseilLibraries, [&](llvm::StringLiteral Library) {
55 return Path.starts_with(Library);