clang 22.0.0git
|
#include "CIRGenFunction.h"
#include "CIRGenValue.h"
#include "clang/AST/Expr.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/CIR/MissingFeatures.h"
#include "mlir/IR/Location.h"
#include "mlir/IR/Value.h"
#include <cassert>
#include <utility>
Go to the source code of this file.
Macros | |
#define | HANDLEBINOP(OP) |
#define | VISITCOMP(CODE) mlir::Value VisitBin##CODE(const BinaryOperator *E) { return emitCmp(E); } |
#define | HANDLE_BINOP(OP) |
#define | COMPOUND_OP(Op) |
Functions | |
static bool | mustVisitNullValue (const Expr *e) |
static std::optional< QualType > | getUnwidenedIntegerType (const ASTContext &astContext, const Expr *e) |
If e is a widened promoted integer, get its base (unpromoted) type. | |
static bool | isWidenedIntegerOp (const ASTContext &astContext, const Expr *e) |
Check if e is a widened promoted integer. | |
static bool | canElideOverflowCheck (const ASTContext &astContext, const BinOpInfo &op) |
Check if we can skip the overflow check for Op . | |
static mlir::Value | emitPointerArithmetic (CIRGenFunction &cgf, const BinOpInfo &op, bool isSubtraction) |
Emit pointer + index arithmetic. | |
static bool | isCheapEnoughToEvaluateUnconditionally (const Expr *e, CIRGenFunction &cgf) |
Return true if the specified expression is cheap enough and side-effect-free enough to evaluate unconditionally instead of conditionally. | |
#define COMPOUND_OP | ( | Op | ) |
#define HANDLE_BINOP | ( | OP | ) |
#define HANDLEBINOP | ( | OP | ) |
Definition at line 870 of file CIRGenExprScalar.cpp.
#define VISITCOMP | ( | CODE | ) | mlir::Value VisitBin##CODE(const BinaryOperator *E) { return emitCmp(E); } |
Definition at line 972 of file CIRGenExprScalar.cpp.
|
static |
Check if we can skip the overflow check for Op
.
Definition at line 1385 of file CIRGenExprScalar.cpp.
References clang::ASTContext::getTypeSize(), getUnwidenedIntegerType(), and clang::Type::isUnsignedIntegerType().
|
static |
Emit pointer + index arithmetic.
Definition at line 1429 of file CIRGenExprScalar.cpp.
References clang::CIRGen::CIRGenFunction::cgm, cir::CIRBaseBuilderTy::createIntToPtr(), clang::CIRGen::CIRGenBuilderTy::createNeg(), clang::CIRGen::CIRGenModule::errorNYI(), clang::ast_matchers::expr, clang::Type::getAs(), clang::ASTContext::getAsVariableArrayType(), clang::CIRGen::CIRGenFunction::getBuilder(), clang::CIRGen::CIRGenFunction::getContext(), clang::CIRGen::CIRGenFunction::getLoc(), clang::Expr::getType(), clang::Type::isFunctionType(), clang::BinaryOperator::isNullPointerArithmeticExtension(), clang::Type::isVoidType(), clang::ast_matchers::pointerType, and cir::MissingFeatures::sanitizers().
Referenced by EmitPointerWithAlignment().
|
static |
If e
is a widened promoted integer, get its base (unpromoted) type.
Definition at line 1365 of file CIRGenExprScalar.cpp.
References clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::Expr::IgnoreImpCasts(), and clang::ASTContext::isPromotableIntegerType().
Referenced by canElideOverflowCheck(), and isWidenedIntegerOp().
|
static |
Return true if the specified expression is cheap enough and side-effect-free enough to evaluate unconditionally instead of conditionally.
This is used to convert control flow into selects in some cases. TODO(cir): can be shared with LLVM codegen.
Definition at line 2121 of file CIRGenExprScalar.cpp.
References clang::CIRGen::CIRGenFunction::getContext(), clang::Expr::IgnoreParens(), and clang::Expr::isEvaluatable().
|
static |
Check if e
is a widened promoted integer.
Definition at line 1379 of file CIRGenExprScalar.cpp.
References getUnwidenedIntegerType().
Definition at line 1354 of file CIRGenExprScalar.cpp.
References clang::Expr::getType(), and clang::Type::isNullPtrType().