clang 22.0.0git
CIRGenExprCXX.cpp
Go to the documentation of this file.
1//===--- CIRGenExprCXX.cpp - Emit CIR Code for C++ expressions ------------===//
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 contains code dealing with code generation of C++ expressions
10//
11//===----------------------------------------------------------------------===//
12
13#include "CIRGenFunction.h"
14#include "clang/AST/ExprCXX.h"
15
16using namespace clang;
17using namespace clang::CIRGen;
18
21 QualType destroyedType = expr->getDestroyedType();
22 if (destroyedType.hasStrongOrWeakObjCLifetime()) {
24 cgm.errorNYI(expr->getExprLoc(),
25 "emitCXXPseudoDestructorExpr: Objective-C lifetime is NYI");
26 } else {
27 // C++ [expr.pseudo]p1:
28 // The result shall only be used as the operand for the function call
29 // operator (), and the result of such a call has type void. The only
30 // effect is the evaluation of the postfix-expression before the dot or
31 // arrow.
32 emitIgnoredExpr(expr->getBase());
33 }
34
35 return RValue::get(nullptr);
36}
Defines the clang::Expr interface and subclasses for C++ expressions.
void emitIgnoredExpr(const clang::Expr *e)
Emit code to compute the specified expression, ignoring the result.
RValue emitCXXPseudoDestructorExpr(const CXXPseudoDestructorExpr *expr)
DiagnosticBuilder errorNYI(SourceLocation, llvm::StringRef)
Helpers to emit "not yet implemented" error diagnostics.
This trivial value class is used to represent the result of an expression that is evaluated.
Definition: CIRGenValue.h:33
static RValue get(mlir::Value v)
Definition: CIRGenValue.h:82
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
Definition: ExprCXX.h:2739
A (possibly-)qualified type.
Definition: TypeBase.h:937
bool hasStrongOrWeakObjCLifetime() const
Definition: TypeBase.h:1446
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
The JSON file list parser is used to communicate input to InstallAPI.
static bool objCLifetime()