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