================ @@ -0,0 +1,36 @@ +//===- UnsafeBufferUsageExtractor.h -----------------------------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +#ifndef LLVM_CLANG_ANALYSIS_SCALABLE_ANALYSES_UNSAFEBUFFERUSAGE_EXTRACTOR_H +#define LLVM_CLANG_ANALYSIS_SCALABLE_ANALYSES_UNSAFEBUFFERUSAGE_EXTRACTOR_H + +#include "clang/Analysis/Scalable/Analyses/UnsafeBufferUsage/UnsafeBufferUsage.h" +#include "clang/Analysis/Scalable/Analyses/UnsafeBufferUsage/UnsafeBufferUsageBuilder.h" +#include "clang/Analysis/Scalable/TUSummary/TUSummaryExtractor.h" +#include "llvm/Support/Error.h" +#include <memory> + +namespace clang::ssaf { +class UnsafeBufferUsageTUSummaryExtractor : public TUSummaryExtractor { + + UnsafeBufferUsageTUSummaryBuilder &getBuilder() { + return static_cast<UnsafeBufferUsageTUSummaryBuilder &>(SummaryBuilder); + } + +public: + explicit UnsafeBufferUsageTUSummaryExtractor( + UnsafeBufferUsageTUSummaryBuilder &Builder) + : TUSummaryExtractor(Builder) {} + + // FIXME: need some general traversal in the Base class + std::unique_ptr<UnsafeBufferUsageEntitySummary> + extractEntitySummary(EntityId Contributor, const Decl *ContributorDefn, ---------------- steakhal wrote:
I agree with both statements: - One should use an `ASTConsumer` and implement the `HandleTranslationUnit`. - We will need an error channel so that extractors can communicate errors, because `HandleTranslationUnit` doesn't have a return type capable describing this. But let's leave this for a separate discussion, and we can just drop the errors for now. https://github.com/llvm/llvm-project/pull/182941 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
