Path: blob/main/contrib/llvm-project/clang/lib/Sema/CheckExprLifetime.h
35233 views
//===- CheckExprLifetime.h ----------------------------------- -*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//===----------------------------------------------------------------------===//6//7// This files implements a statement-local lifetime analysis.8//9//===----------------------------------------------------------------------===//1011#ifndef LLVM_CLANG_SEMA_CHECK_EXPR_LIFETIME_H12#define LLVM_CLANG_SEMA_CHECK_EXPR_LIFETIME_H1314#include "clang/AST/Expr.h"15#include "clang/Sema/Initialization.h"16#include "clang/Sema/Sema.h"1718namespace clang::sema {1920/// Describes an entity that is being assigned.21struct AssignedEntity {22// The left-hand side expression of the assignment.23Expr *LHS = nullptr;24};2526/// Check that the lifetime of the given expr (and its subobjects) is27/// sufficient for initializing the entity, and perform lifetime extension28/// (when permitted) if not.29void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity,30Expr *Init);3132/// Check that the lifetime of the given expr (and its subobjects) is33/// sufficient for assigning to the entity.34void checkExprLifetime(Sema &SemaRef, const AssignedEntity &Entity, Expr *Init);3536} // namespace clang::sema3738#endif // LLVM_CLANG_SEMA_CHECK_EXPR_LIFETIME_H394041