clang 23.0.0git
UnsafeBufferUsageExtractor.h
Go to the documentation of this file.
1//===- UnsafeBufferUsageExtractor.h -----------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8#ifndef LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_UNSAFEBUFFERUSAGE_UNSAFEBUFFERUSAGEBUILDER_H
9#define LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_UNSAFEBUFFERUSAGE_UNSAFEBUFFERUSAGEBUILDER_H
10
16#include "llvm/Support/Error.h"
17#include <memory>
18
19namespace clang::ssaf {
21public:
24
25 static EntityPointerLevel buildEntityPointerLevel(EntityId Entity,
26 unsigned PointerLevel) {
27 return {Entity, PointerLevel};
28 }
29
30 EntityId addEntity(EntityName EN) { return SummaryBuilder.addEntity(EN); }
31
32 std::unique_ptr<UnsafeBufferUsageEntitySummary>
33 extractEntitySummary(const Decl *Contributor, ASTContext &Ctx,
34 llvm::Error &Error);
35
36 void HandleTranslationUnit(ASTContext &Ctx) override;
37};
38} // namespace clang::ssaf
39
40#endif // LLVM_CLANG_SCALABLESTATICANALYSISFRAMEWORK_ANALYSES_UNSAFEBUFFERUSAGE_UNSAFEBUFFERUSAGEBUILDER_H
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition ASTContext.h:226
Decl - This represents one declaration (or definition), e.g.
Definition DeclBase.h:86
Lightweight opaque handle representing an entity in an EntityIdTable.
Definition EntityId.h:31
Uniquely identifies an entity in a program.
Definition EntityName.h:28
TUSummaryExtractor(TUSummaryBuilder &Builder)
static EntityPointerLevel buildEntityPointerLevel(EntityId Entity, unsigned PointerLevel)
void HandleTranslationUnit(ASTContext &Ctx) override
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been par...
std::unique_ptr< UnsafeBufferUsageEntitySummary > extractEntitySummary(const Decl *Contributor, ASTContext &Ctx, llvm::Error &Error)