clang API Documentation
#include "CodeGenFunction.h"
#include "CGObjCRuntime.h"
#include "CodeGenModule.h"
#include "clang/AST/ASTContext.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/Intrinsics.h"
Go to the source code of this file.
Functions | |
static bool | isTrivialFiller (Expr *E) |
Determine if E is a trivial array filler, that is, one that is equivalent to zero-initialization. | |
static Expr * | findPeephole (Expr *op, CastKind kind) |
static bool | isBlockVarRef (const Expr *E) |
static bool | isSimpleZero (const Expr *E, CodeGenFunction &CGF) |
static CharUnits | GetNumNonZeroBytesInInit (const Expr *E, CodeGenFunction &CGF) |
static void | CheckAggExprForMemSetUse (AggValueSlot &Slot, const Expr *E, CodeGenFunction &CGF) |
static void CheckAggExprForMemSetUse | ( | AggValueSlot & | Slot, |
const Expr * | E, | ||
CodeGenFunction & | CGF | ||
) | [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 1327 of file CGExprAgg.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CharUnits::fromQuantity(), clang::CodeGen::AggValueSlot::getAddr(), clang::ASTContext::getBaseElementType(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::getLangOpts(), GetNumNonZeroBytesInInit(), clang::CharUnits::getQuantity(), clang::Expr::getType(), clang::ASTContext::getTypeInfoInChars(), clang::CXXRecordDecl::hasUserDeclaredConstructor(), clang::CodeGen::CodeGenTypeCache::Int8PtrTy, clang::CodeGen::AggValueSlot::isVolatile(), clang::CodeGen::AggValueSlot::isZeroed(), and clang::CodeGen::AggValueSlot::setZeroed().
Referenced by clang::CodeGen::CodeGenFunction::EmitAggExpr().
static Expr* findPeephole | ( | Expr * | op, |
CastKind | kind | ||
) | [static] |
Attempt to look through various unimportant expressions to find a cast of the given kind.
Definition at line 550 of file CGExprAgg.cpp.
References clang::CK_NoOp, and clang::Expr::IgnoreParens().
static CharUnits GetNumNonZeroBytesInInit | ( | const Expr * | E, |
CodeGenFunction & | CGF | ||
) | [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 1273 of file CGExprAgg.cpp.
References clang::Type::getAs(), clang::CodeGen::CodeGenFunction::getContext(), clang::InitListExpr::getInit(), clang::InitListExpr::getNumInits(), clang::TargetInfo::getPointerWidth(), clang::CodeGen::CodeGenFunction::getTarget(), clang::Expr::getType(), clang::ValueDecl::getType(), clang::CodeGen::CodeGenFunction::getTypes(), clang::ASTContext::getTypeSizeInChars(), clang::Expr::IgnoreParens(), clang::Type::isIncompleteArrayType(), clang::Type::isReferenceType(), isSimpleZero(), clang::FieldDecl::isUnnamedBitfield(), clang::CodeGen::CodeGenTypes::isZeroInitializable(), clang::ASTContext::toCharUnitsFromBits(), and clang::CharUnits::Zero().
Referenced by CheckAggExprForMemSetUse().
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 778 of file CGExprAgg.cpp.
References clang::BO_Comma, clang::CK_LValueToRValue, clang::Decl::hasAttr(), and clang::Expr::IgnoreParens().
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 1011 of file CGExprAgg.cpp.
References clang::CK_NullToPointer, clang::Expr::getType(), clang::CodeGen::CodeGenFunction::getTypes(), clang::Expr::IgnoreParens(), and clang::CodeGen::CodeGenTypes::isZeroInitializable().
Referenced by GetNumNonZeroBytesInInit().
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 375 of file CGExprAgg.cpp.