clang
22.0.0git
include
clang
AST
InferAlloc.h
Go to the documentation of this file.
1
//===--- InferAlloc.h - Allocation type inference ---------------*- 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
//
9
// This file defines interfaces for allocation-related type inference.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef LLVM_CLANG_AST_INFERALLOC_H
14
#define LLVM_CLANG_AST_INFERALLOC_H
15
16
#include "
clang/AST/ASTContext.h
"
17
#include "
clang/AST/Expr.h
"
18
#include "llvm/Support/AllocToken.h"
19
#include <optional>
20
21
namespace
clang
{
22
namespace
infer_alloc
{
23
24
/// Infer the possible allocated type from an allocation call expression.
25
QualType
inferPossibleType
(
const
CallExpr
*E,
const
ASTContext
&Ctx,
26
const
CastExpr
*CastE);
27
28
/// Get the information required for construction of an allocation token ID.
29
std::optional<llvm::AllocTokenMetadata>
30
getAllocTokenMetadata
(
QualType
T
,
const
ASTContext
&Ctx);
31
32
}
// namespace infer_alloc
33
}
// namespace clang
34
35
#endif
// LLVM_CLANG_AST_INFERALLOC_H
ASTContext.h
Defines the clang::ASTContext interface.
Expr.h
clang::ASTContext
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Definition
ASTContext.h:220
clang::CallExpr
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition
Expr.h:2877
clang::CastExpr
CastExpr - Base class for type casts, including both implicit casts (ImplicitCastExpr) and explicit c...
Definition
Expr.h:3610
clang::QualType
A (possibly-)qualified type.
Definition
TypeBase.h:937
clang::infer_alloc
Definition
InferAlloc.h:22
clang::infer_alloc::getAllocTokenMetadata
std::optional< llvm::AllocTokenMetadata > getAllocTokenMetadata(QualType T, const ASTContext &Ctx)
Get the information required for construction of an allocation token ID.
Definition
InferAlloc.cpp:182
clang::infer_alloc::inferPossibleType
QualType inferPossibleType(const CallExpr *E, const ASTContext &Ctx, const CastExpr *CastE)
Infer the possible allocated type from an allocation call expression.
Definition
InferAlloc.cpp:163
clang
The JSON file list parser is used to communicate input to InstallAPI.
Definition
CalledOnceCheck.h:17
clang::T
const FunctionProtoType * T
Definition
RecursiveASTVisitor.h:1414
Generated on
for clang by
1.14.0