clang
9.0.0
|
#include "CGCXXABI.h"
#include "CGCleanup.h"
#include "CGDebugInfo.h"
#include "CGObjCRuntime.h"
#include "CodeGenFunction.h"
#include "CodeGenModule.h"
#include "ConstantEmitter.h"
#include "TargetInfo.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/Basic/FixedPoint.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/Optional.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include <cstdarg>
Go to the source code of this file.
Macros | |
#define | HANDLEBINOP(OP) |
#define | VISITCOMP(CODE, UI, SI, FP) |
#define | COMPOUND_OP(Op) |
Enumerations | |
enum | IntrinsicType { VCMPEQ, VCMPGT } |
Functions | |
static std::pair< ScalarExprEmitter::ImplicitConversionCheckKind, std::pair< llvm::Value *, SanitizerMask > > | EmitIntegerTruncationCheckHelper (Value *Src, QualType SrcType, Value *Dst, QualType DstType, CGBuilderTy &Builder) |
static std::pair< ScalarExprEmitter::ImplicitConversionCheckKind, std::pair< llvm::Value *, SanitizerMask > > | EmitIntegerSignChangeCheckHelper (Value *Src, QualType SrcType, Value *Dst, QualType DstType, CGBuilderTy &Builder) |
static llvm::Constant * | getMaskElt (llvm::ShuffleVectorInst *SVI, unsigned Idx, unsigned Off, llvm::Type *I32Ty) |
static llvm::Constant * | getAsInt32 (llvm::ConstantInt *C, llvm::Type *I32Ty) |
static BinOpInfo | createBinOpInfoFromIncDec (const UnaryOperator *E, llvm::Value *InVal, bool IsInc) |
static Value * | emitPointerArithmetic (CodeGenFunction &CGF, const BinOpInfo &op, bool isSubtraction) |
Emit pointer + index arithmetic. More... | |
static Value * | buildFMulAdd (llvm::BinaryOperator *MulOp, Value *Addend, const CodeGenFunction &CGF, CGBuilderTy &Builder, bool negMul, bool negAdd) |
static Value * | tryEmitFMulAdd (const BinOpInfo &op, const CodeGenFunction &CGF, CGBuilderTy &Builder, bool isSub=false) |
static llvm::Intrinsic::ID | GetIntrinsic (IntrinsicType IT, BuiltinType::Kind ElemKind) |
static bool | isCheapEnoughToEvaluateUnconditionally (const Expr *E, CodeGenFunction &CGF) |
isCheapEnoughToEvaluateUnconditionally - Return true if the specified expression is cheap enough and side-effect-free enough to evaluate unconditionally instead of conditionally. More... | |
static Value * | ConvertVec3AndVec4 (CGBuilderTy &Builder, CodeGenFunction &CGF, Value *Src, unsigned NumElementsDst) |
static Value * | createCastsForTypeOfSameSize (CGBuilderTy &Builder, const llvm::DataLayout &DL, Value *Src, llvm::Type *DstTy, StringRef Name="") |
#define COMPOUND_OP | ( | Op | ) |
Referenced by clang::CodeGen::CodeGenFunction::EmitCompoundAssignmentLValue().
#define HANDLEBINOP | ( | OP | ) |
Definition at line 773 of file CGExprScalar.cpp.
#define VISITCOMP | ( | CODE, | |
UI, | |||
SI, | |||
FP | |||
) |
Definition at line 796 of file CGExprScalar.cpp.
enum IntrinsicType |
Enumerator | |
---|---|
VCMPEQ | |
VCMPGT |
Definition at line 3673 of file CGExprScalar.cpp.
|
static |
Definition at line 3269 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::CGM, and clang::CodeGen::CodeGenModule::getIntrinsic().
Referenced by tryEmitFMulAdd().
|
static |
Definition at line 4319 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenTypeCache::Int32Ty.
|
static |
Definition at line 2310 of file CGExprScalar.cpp.
References clang::Expr::getType().
|
static |
Definition at line 4348 of file CGExprScalar.cpp.
|
static |
Definition at line 1024 of file CGExprScalar.cpp.
References clang::Type::isSignedIntegerOrEnumerationType(), and clang::CodeGen::Type.
|
static |
Definition at line 936 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::EmitCheck(), clang::CodeGen::CodeGenFunction::EmitCheckSourceLocation(), clang::CodeGen::CodeGenFunction::EmitCheckTypeDescriptor(), clang::SanitizerSet::has(), clang::SanitizerSet::hasOneOf(), clang::Type::isBooleanType(), clang::Type::isIntegerType(), clang::Type::isSignedIntegerOrEnumerationType(), clang::CodeGen::CodeGenFunction::SanOpts, and clang::CodeGen::Type.
|
static |
Emit pointer + index arithmetic.
Definition at line 3148 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::Type::castAs(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CodeGenFunction::EmitBoundsCheck(), clang::CodeGen::CodeGenFunction::EmitCheckedInBoundsGEP(), clang::ast_matchers::expr, clang::Type::getAs(), clang::ASTContext::getAsVariableArrayType(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::BinaryOperator::getLHS(), clang::PointerType::getPointeeType(), clang::BinaryOperator::getRHS(), clang::CodeGen::CodeGenModule::getSize(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInChars(), clang::CodeGen::CodeGenFunction::getVLASize(), clang::SanitizerSet::has(), clang::Type::isFunctionType(), clang::BinaryOperator::isNullPointerArithmeticExtension(), clang::Type::isSignedIntegerOrEnumerationType(), clang::LangOptions::isSignedOverflowDefined(), clang::Type::isVoidType(), clang::CodeGen::CodeGenFunction::VlaSizePair::NumElts, clang::ast_matchers::pointerType, result, clang::CodeGen::CodeGenFunction::SanOpts, and clang::CodeGen::CodeGenTypeCache::VoidPtrTy.
Referenced by tryEmitFMulAdd().
|
static |
Definition at line 1758 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::ErrorUnsupported(), clang::InitListExpr::getInit(), getMaskElt(), clang::InitListExpr::getNumInits(), clang::Expr::getType(), clang::InitListExpr::hadArrayRangeDesignator(), i, clang::CodeGen::CodeGenTypeCache::Int32Ty, Offset, clang::CodeGen::Type, and V.
|
static |
Definition at line 3675 of file CGExprScalar.cpp.
References clang::prec::And, clang::CodeGen::CodeGenFunction::ConditionalEvaluation::begin(), clang::ASTContext::BoolTy, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConstantFoldsToSimpleInteger(), clang::CodeGen::CodeGenFunction::ContainsLabel(), clang::Create(), clang::CodeGen::ApplyDebugLocation::CreateArtificial(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::ApplyDebugLocation::CreateEmpty(), clang::CodeGen::CodeGenFunction::EmitARCStoreAutoreleasing(), clang::CodeGen::CodeGenFunction::EmitARCStoreStrong(), clang::CodeGen::CodeGenFunction::EmitARCStoreUnsafeUnretained(), clang::CodeGen::CodeGenFunction::EmitARCStoreWeak(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), EmitCompare(), clang::CodeGen::CodeGenFunction::EmitComplexExpr(), clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(), clang::CodeGen::CGCXXABI::EmitMemberPointerComparison(), clang::CodeGen::CodeGenFunction::EmitNullabilityCheck(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitStoreThroughBitfieldLValue(), clang::CodeGen::CodeGenFunction::EmitStoreThroughLValue(), clang::CodeGen::CodeGenFunction::ConditionalEvaluation::end(), clang::CodeGen::CodeGenFunction::EnsureInsertPoint(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::CodeGen::RValue::get(), clang::Type::getAs(), clang::CodeGen::CodeGenModule::getCodeGenOpts(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::getCurrentProfileCount(), clang::CodeGen::CodeGenModule::getCXXABI(), clang::BinaryOperator::getExprLoc(), clang::CodeGen::CodeGenModule::getIntrinsic(), clang::BuiltinType::getKind(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::BinaryOperator::getLHS(), clang::QualType::getObjCLifetime(), clang::BinaryOperator::getOpcode(), clang::CodeGen::CodeGenFunction::getProfileCount(), clang::BinaryOperator::getRHS(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::hasSignedIntegerRepresentation(), clang::CodeGen::CodeGenFunction::incrementProfileCounter(), clang::Type::isAnyComplexType(), clang::Type::isRealFloatingType(), clang::Type::isVectorType(), clang::CodeGen::LValue::isVolatileQualified(), clang::QualType::mayBeDynamicClass(), clang::Qualifiers::OCL_Autoreleasing, clang::Qualifiers::OCL_ExplicitNone, clang::Qualifiers::OCL_None, clang::Qualifiers::OCL_Strong, clang::Qualifiers::OCL_Weak, clang::CodeGen::CodeGenFunction::TCK_Store, clang::CodeGen::Type, and VCMPEQ.
|
static |
Definition at line 1750 of file CGExprScalar.cpp.
Referenced by getAsInt32().
|
static |
isCheapEnoughToEvaluateUnconditionally - 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.
Definition at line 4129 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::ConditionalEvaluation::begin(), clang::CodeGen::CodeGenFunction::ConstantFoldsToSimpleInteger(), clang::CodeGen::CodeGenFunction::ContainsLabel(), clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::EmitBlockLiteral(), clang::CodeGen::CodeGenFunction::EmitBranchOnBoolExpr(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitVAArg(), clang::CodeGen::CodeGenFunction::EmitVariablyModifiedType(), clang::CodeGen::CodeGenFunction::ConditionalEvaluation::end(), clang::CodeGen::CodeGenFunction::ErrorUnsupported(), clang::CodeGen::CodeGenFunction::EvaluateExprAsBool(), clang::ChooseExpr::getChosenSubExpr(), clang::AbstractConditionalOperator::getCond(), clang::CodeGen::CodeGenFunction::getContext(), clang::AbstractConditionalOperator::getFalseExpr(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::CodeGen::CodeGenFunction::getProfileCount(), clang::AbstractConditionalOperator::getTrueExpr(), clang::Expr::getType(), clang::Expr::IgnoreParens(), clang::CodeGen::CodeGenFunction::incrementProfileCounter(), clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::CodeGen::Address::invalid(), clang::Expr::isEvaluatable(), clang::CodeGen::Address::isValid(), clang::Type::isVariablyModifiedType(), clang::Type::isVectorType(), clang::Type::isVoidType(), tmp, and clang::CodeGen::Type.
|
static |
Definition at line 3302 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::Builder, buildFMulAdd(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CodeGenFunction::EmitBlock(), emitPointerArithmetic(), clang::ast_matchers::expr, clang::ASTContext::getAsVariableArrayType(), clang::FixedPointSemantics::getCommonSemantics(), clang::CodeGen::CodeGenFunction::getContext(), clang::ASTContext::getFixedPointSemantics(), clang::CodeGen::CodeGenFunction::getLangOpts(), clang::BinaryOperator::getLHS(), clang::Type::getPointeeType(), clang::CodeGen::CodeGenModule::getSize(), clang::Expr::getType(), clang::ASTContext::getTypeSizeInChars(), clang::CodeGen::CodeGenFunction::getVLASize(), clang::SanitizerSet::has(), clang::CharUnits::isOne(), clang::LangOptions::isSignedOverflowDefined(), clang::CodeGen::CodeGenFunction::IsSubtraction, clang::CodeGen::CodeGenFunction::NotSubtraction, clang::CharUnits::One(), clang::CodeGen::CodeGenTypeCache::PtrDiffTy, clang::CodeGen::CodeGenFunction::SanOpts, clang::LangOptions::SOB_Defined, clang::LangOptions::SOB_Trapping, clang::LangOptions::SOB_Undefined, and clang::CodeGen::CodeGenFunction::VlaSizePair::Type.