clang 20.0.0git
|
#include "CGCXXABI.h"
#include "CGCleanup.h"
#include "CGDebugInfo.h"
#include "CGObjCRuntime.h"
#include "CGOpenMPRuntime.h"
#include "CGRecordLayout.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/DeclObjC.h"
#include "clang/AST/Expr.h"
#include "clang/AST/ParentMapContext.h"
#include "clang/AST/RecordLayout.h"
#include "clang/AST/StmtVisitor.h"
#include "clang/Basic/CodeGenOptions.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/APFixedPoint.h"
#include "llvm/IR/CFG.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/FixedPointBuilder.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GetElementPtrTypeIterator.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsPowerPC.h"
#include "llvm/IR/MatrixBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/TypeSize.h"
#include <cstdarg>
#include <optional>
Go to the source code of this file.
Classes | |
struct | GEPOffsetAndOverflow |
Namespaces | |
namespace | llvm |
Diagnostic wrappers for TextAPI types for error reporting. | |
Macros | |
#define | HANDLEBINOP(OP) |
#define | VISITCOMP(CODE, UI, SI, FP, SIG) |
#define | HANDLE_BINOP(OP) |
#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 bool | PromotionIsPotentiallyEligibleForImplicitIntegerConversionCheck (QualType SrcType, QualType DstType) |
static llvm::Value * | EmitIsNegativeTestHelper (Value *V, QualType VType, const char *Name, CGBuilderTy &Builder) |
static std::pair< ScalarExprEmitter::ImplicitConversionCheckKind, std::pair< llvm::Value *, SanitizerMask > > | EmitIntegerSignChangeCheckHelper (Value *Src, QualType SrcType, Value *Dst, QualType DstType, CGBuilderTy &Builder) |
static std::pair< ScalarExprEmitter::ImplicitConversionCheckKind, std::pair< llvm::Value *, SanitizerMask > > | EmitBitfieldTruncationCheckHelper (Value *Src, QualType SrcType, Value *Dst, QualType DstType, CGBuilderTy &Builder) |
static std::pair< ScalarExprEmitter::ImplicitConversionCheckKind, std::pair< llvm::Value *, SanitizerMask > > | EmitBitfieldSignChangeCheckHelper (Value *Src, QualType SrcType, Value *Dst, QualType DstType, CGBuilderTy &Builder) |
static int | getMaskElt (llvm::ShuffleVectorInst *SVI, unsigned Idx, unsigned Off) |
static int | getAsInt32 (llvm::ConstantInt *C, llvm::Type *I32Ty) |
static BinOpInfo | createBinOpInfoFromIncDec (const UnaryOperator *E, llvm::Value *InVal, bool IsInc, FPOptions FPFeatures) |
static bool | matchesPostDecrInWhile (const UnaryOperator *UO, bool isInc, bool isPre, ASTContext &Ctx) |
For the purposes of overflow pattern exclusion, does this match the "while(i--)" pattern? | |
static Value * | emitPointerArithmetic (CodeGenFunction &CGF, const BinOpInfo &op, bool isSubtraction) |
Emit pointer + index arithmetic. | |
static Value * | buildFMulAdd (llvm::Instruction *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. | |
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="") |
static GEPOffsetAndOverflow | EmitGEPOffsetInBytes (Value *BasePtr, Value *GEPVal, llvm::LLVMContext &VMContext, CodeGenModule &CGM, CGBuilderTy &Builder) |
Evaluate given GEPVal, which is either an inbounds GEP, or a constant, and compute the total offset it applies from it's base pointer BasePtr. | |
#define COMPOUND_OP | ( | Op | ) |
#define HANDLE_BINOP | ( | OP | ) |
#define HANDLEBINOP | ( | OP | ) |
Definition at line 867 of file CGExprScalar.cpp.
#define VISITCOMP | ( | CODE, | |
UI, | |||
SI, | |||
FP, | |||
SIG | |||
) |
Definition at line 894 of file CGExprScalar.cpp.
enum IntrinsicType |
Enumerator | |
---|---|
VCMPEQ | |
VCMPGT |
Definition at line 4582 of file CGExprScalar.cpp.
|
static |
Definition at line 4058 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenModule::getIntrinsic(), and clang::Value::getType().
Referenced by tryEmitFMulAdd().
|
static |
Definition at line 5421 of file CGExprScalar.cpp.
|
static |
Definition at line 2745 of file CGExprScalar.cpp.
References E, and clang::Expr::getType().
|
static |
Definition at line 5443 of file CGExprScalar.cpp.
References clang::Value::getType().
|
static |
Definition at line 1303 of file CGExprScalar.cpp.
References EmitIsNegativeTestHelper().
|
static |
Definition at line 1277 of file CGExprScalar.cpp.
References clang::Value::getType(), and clang::Type::isSignedIntegerOrEnumerationType().
|
static |
Evaluate given GEPVal, which is either an inbounds GEP, or a constant, and compute the total offset it applies from it's base pointer BasePtr.
Returns offset in bytes and a boolean flag whether an overflow happened during evaluation.
Return the result of the given binary operation.
Definition at line 5658 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::CodeGenModule::getIntrinsic(), and clang::Value::getType().
|
static |
Definition at line 1152 of file CGExprScalar.cpp.
References EmitIsNegativeTestHelper(), clang::Value::getType(), and clang::Type::isSignedIntegerOrEnumerationType().
|
static |
Definition at line 1041 of file CGExprScalar.cpp.
References clang::Value::getType(), and clang::Type::isSignedIntegerOrEnumerationType().
|
static |
Definition at line 1133 of file CGExprScalar.cpp.
References clang::Type::isSignedIntegerOrEnumerationType(), and V.
Referenced by EmitBitfieldSignChangeCheckHelper(), and EmitIntegerSignChangeCheckHelper().
|
static |
Emit pointer + index arithmetic.
Definition at line 3935 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::Type::castAs(), clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::ConvertTypeForMem(), clang::CodeGen::CGBuilderTy::CreateGEP(), 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(), getPointeeType(), clang::CodeGen::CodeGenModule::getSize(), clang::Expr::getType(), clang::Value::getType(), clang::ASTContext::getTypeSizeInChars(), clang::CodeGen::CodeGenFunction::getVLASize(), clang::SanitizerSet::has(), clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::Type::isFunctionType(), clang::BinaryOperator::isNullPointerArithmeticExtension(), clang::Type::isSignedIntegerOrEnumerationType(), clang::LangOptions::isSignedOverflowDefined(), clang::Type::isVoidType(), clang::CodeGen::CodeGenFunction::VlaSizePair::NumElts, clang::ast_matchers::pointerType, and clang::CodeGen::CodeGenFunction::SanOpts.
|
static |
Definition at line 2034 of file CGExprScalar.cpp.
References clang::C.
|
static |
Definition at line 4584 of file CGExprScalar.cpp.
References VCMPEQ.
Definition at line 2026 of file CGExprScalar.cpp.
|
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 5195 of file CGExprScalar.cpp.
References E, clang::CodeGen::CodeGenFunction::getContext(), clang::Expr::IgnoreParens(), and clang::Expr::isEvaluatable().
|
static |
For the purposes of overflow pattern exclusion, does this match the "while(i--)" pattern?
Definition at line 2783 of file CGExprScalar.cpp.
References clang::ASTContext::getLangOpts(), clang::ASTContext::getParentMapContext(), clang::ParentMapContext::getParents(), clang::LangOptions::isOverflowPatternExcluded(), Parent, and clang::LangOptionsBase::PostDecrInWhile.
|
static |
Definition at line 1077 of file CGExprScalar.cpp.
References clang::Type::isIntegerType().
|
static |
Definition at line 4093 of file CGExprScalar.cpp.
References buildFMulAdd().