|
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) |
| #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 | ) |
Referenced by clang::CodeGen::CodeGenFunction::EmitCompoundAssignmentLValue(), and clang::CIRGen::CIRGenFunction::emitCompoundAssignmentLValue().
| #define HANDLE_BINOP | ( | OP | ) |
| #define HANDLEBINOP | ( | OP | ) |
Definition at line 909 of file CIRGenExprScalar.cpp.
| #define VISITCOMP | ( | CODE | ) |
Definition at line 1012 of file CIRGenExprScalar.cpp.
|
static |
Check if we can skip the overflow check for Op.
Definition at line 1464 of file CIRGenExprScalar.cpp.
References clang::cast(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), getUnwidenedIntegerType(), clang::isa(), and clang::Type::isUnsignedIntegerType().
|
static |
Emit pointer + index arithmetic.
Definition at line 1508 of file CIRGenExprScalar.cpp.
References clang::cast(), 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::Expr::getExprLoc(), 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 1444 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 2259 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 1458 of file CIRGenExprScalar.cpp.
References getUnwidenedIntegerType().
Definition at line 1433 of file CIRGenExprScalar.cpp.
References clang::Expr::getType(), clang::isa(), and clang::Type::isNullPtrType().