================ @@ -45,18 +46,21 @@ void CalleeNamespaceCheck::check(const MatchFinder::MatchResult &Result) { if (FuncDecl->getBuiltinID() != 0) return; - // If the outermost namespace of the function is __llvm_libc, we're good. + // If the outermost namespace of the function is a macro that starts with + // __llvm_libc, we're good. const auto *NS = dyn_cast<NamespaceDecl>(getOutermostNamespace(FuncDecl)); - if (NS && NS->getName() == "__llvm_libc") + if (NS && Result.SourceManager->isMacroBodyExpansion(NS->getLocation()) && + NS->getName().starts_with(RequiredNamespaceStart)) ---------------- michaelrj-google wrote:
Yes, the plan for the namespace macro is for it to start with `__llvm_libc` and then be followed by user defined information. By default the `LIBC_NAMESPACE` macro is set to `__llvm_libc_${LLVM_VERSION_MAJOR}_${LLVM_VERSION_MINOR}_${LLVM_VERSION_PATCH}_${LLVM_VERSION_SUFFIX}`. https://github.com/llvm/llvm-project/pull/68134 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits