clang  14.0.0git
Enumerations | Functions
CGExprAgg.cpp File Reference
#include "CGCXXABI.h"
#include "CGObjCRuntime.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "ConstantEmitter.h"
#include "TargetInfo.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Attr.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/StmtVisitor.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
Include dependency graph for CGExprAgg.cpp:

Go to the source code of this file.

Enumerations

enum  CompareKind { CK_Less, CK_Greater, CK_Equal }
 

Functions

static bool isTrivialFiller (Expr *E)
 Determine if E is a trivial array filler, that is, one that is equivalent to zero-initialization. More...
 
static ExprfindPeephole (Expr *op, CastKind kind, const ASTContext &ctx)
 Attempt to look through various unimportant expressions to find a cast of the given kind. More...
 
static llvm::ValueEmitCompare (CGBuilderTy &Builder, CodeGenFunction &CGF, const BinaryOperator *E, llvm::Value *LHS, llvm::Value *RHS, CompareKind Kind, const char *NameSuffix="")
 
static bool isBlockVarRef (const Expr *E)
 Is the value of the given expression possibly a reference to or into a __block variable? More...
 
static bool castPreservesZero (const CastExpr *CE)
 Determine whether the given cast kind is known to always convert values with all zero bits in their value representation to values with all zero bits in their value representation. More...
 
static bool isSimpleZero (const Expr *E, CodeGenFunction &CGF)
 isSimpleZero - If emitting this value will obviously just cause a store of zero to memory, return true. More...
 
static CharUnits GetNumNonZeroBytesInInit (const Expr *E, CodeGenFunction &CGF)
 GetNumNonZeroBytesInInit - Get an approximate count of the number of non-zero bytes that will be stored when outputting the initializer for the specified initializer expression. More...
 
static void CheckAggExprForMemSetUse (AggValueSlot &Slot, const Expr *E, CodeGenFunction &CGF)
 CheckAggExprForMemSetUse - If the initializer is large and has a lot of zeros in it, emit a memset and avoid storing the individual zeros. More...
 

Enumeration Type Documentation

◆ CompareKind

Enumerator
CK_Less 
CK_Greater 
CK_Equal 

Definition at line 948 of file CGExprAgg.cpp.

Function Documentation

◆ castPreservesZero()

static bool castPreservesZero ( const CastExpr CE)
static

Determine whether the given cast kind is known to always convert values with all zero bits in their value representation to values with all zero bits in their value representation.

Definition at line 1397 of file CGExprAgg.cpp.

References clang::CastExpr::getCastKind().

Referenced by isSimpleZero().

◆ CheckAggExprForMemSetUse()

static void CheckAggExprForMemSetUse ( AggValueSlot Slot,
const Expr E,
CodeGenFunction CGF 
)
static

◆ EmitCompare()

static llvm::Value* EmitCompare ( CGBuilderTy Builder,
CodeGenFunction CGF,
const BinaryOperator E,
llvm::Value LHS,
llvm::Value RHS,
CompareKind  Kind,
const char *  NameSuffix = "" 
)
static

Definition at line 954 of file CGExprAgg.cpp.

◆ findPeephole()

static Expr* findPeephole ( Expr op,
CastKind  kind,
const ASTContext ctx 
)
static

Attempt to look through various unimportant expressions to find a cast of the given kind.

Definition at line 689 of file CGExprAgg.cpp.

References clang::Expr::IgnoreParenNoopCasts().

◆ GetNumNonZeroBytesInInit()

static CharUnits GetNumNonZeroBytesInInit ( const Expr E,
CodeGenFunction CGF 
)
static

◆ isBlockVarRef()

static bool isBlockVarRef ( const Expr E)
static

Is the value of the given expression possibly a reference to or into a __block variable?

Definition at line 1099 of file CGExprAgg.cpp.

References clang::cast(), clang::Decl::hasAttr(), and clang::Expr::IgnoreParens().

◆ isSimpleZero()

static bool isSimpleZero ( const Expr E,
CodeGenFunction CGF 
)
static

isSimpleZero - If emitting this value will obviously just cause a store of zero to memory, return true.

This can return false if uncertain, so it just handles simple cases.

Definition at line 1492 of file CGExprAgg.cpp.

References castPreservesZero(), clang::CodeGen::CodeGenFunction::getContext(), clang::Expr::getType(), clang::CodeGen::CodeGenFunction::getTypes(), clang::Expr::HasSideEffects(), clang::Expr::IgnoreParens(), clang::CodeGen::CodeGenTypes::isPointerZeroInitializable(), and clang::CodeGen::CodeGenTypes::isZeroInitializable().

Referenced by GetNumNonZeroBytesInInit().

◆ isTrivialFiller()

static bool isTrivialFiller ( Expr E)
static

Determine if E is a trivial array filler, that is, one that is equivalent to zero-initialization.

Definition at line 451 of file CGExprAgg.cpp.