clang 22.0.0git
|
#include "CGCXXABI.h"
#include "CGDebugInfo.h"
#include "CGHLSLRuntime.h"
#include "CGObjCRuntime.h"
#include "CGRecordLayout.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "ConstantEmitter.h"
#include "EHScopeStack.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/Instruction.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/Intrinsics.h"
Go to the source code of this file.
Namespaces | |
namespace | llvm |
Diagnostic wrappers for TextAPI types for error reporting. |
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. | |
static void | EmitHLSLScalarElementwiseAndSplatCasts (CodeGenFunction &CGF, LValue DestVal, llvm::Value *SrcVal, QualType SrcTy, SourceLocation Loc) |
static void | EmitHLSLElementwiseCast (CodeGenFunction &CGF, LValue DestVal, LValue SrcVal, SourceLocation Loc) |
static Expr * | findPeephole (Expr *op, CastKind kind, const ASTContext &ctx) |
Attempt to look through various unimportant expressions to find a cast of the given kind. | |
static llvm::Value * | EmitCompare (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? | |
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. | |
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. | |
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. | |
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. |
Variables | |
cl::opt< bool > | llvm::EnableSingleByteCoverage |
enum CompareKind |
Enumerator | |
---|---|
CK_Less | |
CK_Greater | |
CK_Equal |
Definition at line 1079 of file CGExprAgg.cpp.
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 1517 of file CGExprAgg.cpp.
References clang::CastExpr::getCastKind().
Referenced by isSimpleZero().
|
static |
CheckAggExprForMemSetUse - If the initializer is large and has a lot of zeros in it, emit a memset and avoid storing the individual zeros.
Definition at line 2124 of file CGExprAgg.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::cast(), clang::CodeGen::CGBuilderTy::CreateMemSet(), clang::CharUnits::fromQuantity(), clang::CodeGen::AggValueSlot::getAddress(), clang::Type::getAsCanonical(), clang::ASTContext::getBaseElementType(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::getLangOpts(), GetNumNonZeroBytesInInit(), clang::CodeGen::AggValueSlot::getPreferredSize(), clang::Expr::getType(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::CodeGen::Address::isValid(), clang::CodeGen::AggValueSlot::isVolatile(), clang::CodeGen::AggValueSlot::isZeroed(), clang::CodeGen::AggValueSlot::setZeroed(), and clang::CodeGen::Address::withElementType().
Referenced by clang::CodeGen::CodeGenFunction::EmitAggExpr().
|
static |
Definition at line 1085 of file CGExprAgg.cpp.
References clang::CodeGen::CodeGenFunction::CGM, CK_Equal, CK_Greater, CK_Less, clang::CodeGen::CGCXXABI::EmitMemberPointerComparison(), clang::Type::getAs(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::BinaryOperator::getLHS(), clang::Expr::getType(), clang::Type::hasFloatingRepresentation(), clang::Type::hasSignedIntegerRepresentation(), clang::Type::isIntegralOrEnumerationType(), and clang::Type::isPointerType().
|
static |
Definition at line 524 of file CGExprAgg.cpp.
References clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::CodeGen::CodeGenFunction::FlattenAccessAndTypeLValue(), clang::CodeGen::RValue::get(), clang::CodeGen::RValue::getScalarVal(), and clang::CodeGen::RValue::isScalar().
|
static |
Definition at line 493 of file CGExprAgg.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::CodeGen::CodeGenFunction::FlattenAccessAndTypeLValue(), clang::CodeGen::RValue::get(), clang::Type::getAs(), and isVector().
|
static |
Attempt to look through various unimportant expressions to find a cast of the given kind.
Definition at line 786 of file CGExprAgg.cpp.
References clang::Expr::IgnoreParenNoopCasts().
|
static |
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.
Definition at line 2062 of file CGExprAgg.cpp.
References clang::Default, clang::RecordDecl::fields(), clang::Type::getAsCanonical(), clang::CodeGen::CodeGenFunction::getContext(), clang::RecordDecl::getDefinitionOrSelf(), clang::InitListExpr::getInit(), clang::InitListExpr::getNumInits(), GetNumNonZeroBytesInInit(), clang::TargetInfo::getPointerWidth(), clang::CodeGen::CodeGenFunction::getTarget(), clang::Expr::getType(), clang::CodeGen::CodeGenFunction::getTypes(), clang::ASTContext::getTypeSizeInChars(), clang::Expr::IgnoreParenNoopCasts(), isSimpleZero(), clang::InitListExpr::isTransparent(), clang::CodeGen::CodeGenTypes::isZeroInitializable(), clang::ASTContext::toCharUnitsFromBits(), and clang::CharUnits::Zero().
Referenced by CheckAggExprForMemSetUse(), and GetNumNonZeroBytesInInit().
Is the value of the given expression possibly a reference to or into a __block variable?
Definition at line 1230 of file CGExprAgg.cpp.
References clang::cast(), clang::Expr::IgnoreParens(), and isBlockVarRef().
Referenced by isBlockVarRef().
|
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 1616 of file CGExprAgg.cpp.
References castPreservesZero(), clang::CodeGen::CodeGenFunction::getContext(), clang::Expr::getType(), clang::CodeGen::CodeGenFunction::getTypes(), clang::Expr::HasSideEffects(), clang::Expr::IgnoreParens(), clang::isa(), clang::CodeGen::CodeGenTypes::isPointerZeroInitializable(), and clang::CodeGen::CodeGenTypes::isZeroInitializable().
Referenced by GetNumNonZeroBytesInInit().
Determine if E is a trivial array filler, that is, one that is equivalent to zero-initialization.
Definition at line 470 of file CGExprAgg.cpp.
References clang::isa(), and isTrivialFiller().