clang 20.0.0git
CheckExprLifetime.h
Go to the documentation of this file.
1//===- CheckExprLifetime.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// This files implements a statement-local lifetime analysis.
9//
10//===----------------------------------------------------------------------===//
11
12#ifndef LLVM_CLANG_SEMA_CHECK_EXPR_LIFETIME_H
13#define LLVM_CLANG_SEMA_CHECK_EXPR_LIFETIME_H
14
15#include "clang/AST/Expr.h"
17#include "clang/Sema/Sema.h"
18
19namespace clang::sema {
20
21/// Describes an entity that is being assigned.
23 // The left-hand side expression of the assignment.
24 Expr *LHS = nullptr;
25};
26
27/// Check that the lifetime of the given expr (and its subobjects) is
28/// sufficient for initializing the entity, and perform lifetime extension
29/// (when permitted) if not.
30void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity,
31 Expr *Init);
32
33/// Check that the lifetime of the given expr (and its subobjects) is
34/// sufficient for assigning to the entity.
35void checkExprLifetime(Sema &SemaRef, const AssignedEntity &Entity, Expr *Init);
36
37} // namespace clang::sema
38
39#endif // LLVM_CLANG_SEMA_CHECK_EXPR_LIFETIME_H
This represents one expression.
Definition: Expr.h:110
Describes an entity that is being initialized.
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:535
void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity, Expr *Init)
Check that the lifetime of the given expr (and its subobjects) is sufficient for initializing the ent...
Describes an entity that is being assigned.