|
clang 22.0.0git
|
#include "CGCXXABI.h"#include "CGCleanup.h"#include "CGDebugInfo.h"#include "CGHLSLRuntime.h"#include "CGObjCRuntime.h"#include "CGOpenMPRuntime.h"#include "CGRecordLayout.h"#include "CodeGenFunction.h"#include "CodeGenModule.h"#include "ConstantEmitter.h"#include "TargetInfo.h"#include "TrapReasonBuilder.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/DiagnosticTrap.h"#include "clang/Basic/TargetInfo.h"#include "llvm/ADT/APFixedPoint.h"#include "llvm/ADT/ScopeExit.h"#include "llvm/IR/Argument.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/GEPNoWrapFlags.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 *, SanitizerKind::SanitizerOrdinal > > | 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 *, SanitizerKind::SanitizerOrdinal > > | EmitIntegerSignChangeCheckHelper (Value *Src, QualType SrcType, Value *Dst, QualType DstType, CGBuilderTy &Builder) |
| static std::pair< ScalarExprEmitter::ImplicitConversionCheckKind, std::pair< llvm::Value *, SanitizerKind::SanitizerOrdinal > > | EmitBitfieldTruncationCheckHelper (Value *Src, QualType SrcType, Value *Dst, QualType DstType, CGBuilderTy &Builder) |
| static std::pair< ScalarExprEmitter::ImplicitConversionCheckKind, std::pair< llvm::Value *, SanitizerKind::SanitizerOrdinal > > | 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 bool | isDeclRefKnownNonNull (CodeGenFunction &CGF, const ValueDecl *D) |
| static bool | isLValueKnownNonNull (CodeGenFunction &CGF, const Expr *E) |
| static Value * | EmitHLSLElementwiseCast (CodeGenFunction &CGF, LValue SrcVal, QualType DestTy, SourceLocation Loc) |
| 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) |
| BO_Add/BO_Sub are handled by EmitPointerWithAlignment to preserve alignment information. | |
| 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 900 of file CGExprScalar.cpp.
| #define VISITCOMP | ( | CODE, | |
| UI, | |||
| SI, | |||
| FP, | |||
| SIG ) |
Definition at line 928 of file CGExprScalar.cpp.
| enum IntrinsicType |
| Enumerator | |
|---|---|
| VCMPEQ | |
| VCMPGT | |
Definition at line 4907 of file CGExprScalar.cpp.
|
static |
Definition at line 4373 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenModule::getIntrinsic(), clang::Value::getType(), and clang::isa().
Referenced by tryEmitFMulAdd().
|
static |
Definition at line 5776 of file CGExprScalar.cpp.
|
static |
Definition at line 2994 of file CGExprScalar.cpp.
References clang::Expr::getType().
|
static |
Definition at line 5798 of file CGExprScalar.cpp.
References clang::Value::getType().
|
static |
Definition at line 1373 of file CGExprScalar.cpp.
References EmitIsNegativeTestHelper().
Referenced by clang::CodeGen::CodeGenFunction::EmitBitfieldConversionCheck().
|
static |
Definition at line 1346 of file CGExprScalar.cpp.
References clang::Value::getType(), and clang::Type::isSignedIntegerOrEnumerationType().
Referenced by clang::CodeGen::CodeGenFunction::EmitBitfieldConversionCheck().
|
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 6014 of file CGExprScalar.cpp.
References clang::cast(), clang::CodeGen::CodeGenModule::getDataLayout(), clang::CodeGen::CodeGenModule::getIntrinsic(), clang::Value::getType(), clang::isa(), and clang::Zero.
|
static |
Definition at line 2401 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CreateIRTemp(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::CodeGenFunction::EmitLoadOfLValue(), clang::CodeGen::CodeGenFunction::EmitScalarConversion(), clang::CodeGen::CodeGenFunction::FlattenAccessAndTypeLValue(), clang::Type::getAs(), clang::CodeGen::RValue::getScalarVal(), clang::Type::isBuiltinType(), clang::CodeGen::RValue::isScalar(), and V.
|
static |
Definition at line 1205 of file CGExprScalar.cpp.
References EmitIsNegativeTestHelper(), clang::Value::getType(), clang::isa(), and clang::Type::isSignedIntegerOrEnumerationType().
|
static |
Definition at line 1077 of file CGExprScalar.cpp.
References clang::Value::getType(), clang::isa(), and clang::Type::isSignedIntegerOrEnumerationType().
|
static |
Definition at line 1186 of file CGExprScalar.cpp.
References clang::Type::isSignedIntegerOrEnumerationType(), V, and clang::Zero.
Referenced by EmitBitfieldSignChangeCheckHelper(), and EmitIntegerSignChangeCheckHelper().
|
static |
BO_Add/BO_Sub are handled by EmitPointerWithAlignment to preserve alignment information.
This function is used for BO_AddAssign/BO_SubAssign.
Definition at line 4227 of file CGExprScalar.cpp.
References clang::cast(), clang::CodeGen::CodeGenFunction::EmitPointerArithmetic(), clang::ast_matchers::expr, and clang::Value::getType().
|
static |
Definition at line 2141 of file CGExprScalar.cpp.
References clang::C.
|
static |
Definition at line 4909 of file CGExprScalar.cpp.
References VCMPEQ.
Definition at line 2133 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 5547 of file CGExprScalar.cpp.
References clang::CodeGen::CodeGenFunction::getContext(), clang::Expr::IgnoreParens(), and clang::Expr::isEvaluatable().
|
static |
Definition at line 2333 of file CGExprScalar.cpp.
References clang::ValueDecl::isWeak().
Referenced by isLValueKnownNonNull().
|
static |
Definition at line 2337 of file CGExprScalar.cpp.
References clang::UnaryOperator::getOpcode(), clang::UnaryOperator::getSubExpr(), clang::Expr::IgnoreParens(), clang::isa(), isDeclRefKnownNonNull(), and clang::CodeGen::CodeGenFunction::isPointerKnownNonNull().
Referenced by clang::CodeGen::CodeGenFunction::isPointerKnownNonNull().
|
static |
For the purposes of overflow pattern exclusion, does this match the "while(i--)" pattern?
Definition at line 3033 of file CGExprScalar.cpp.
References clang::ASTContext::getLangOpts(), clang::ASTContext::getParentMapContext(), clang::ParentMapContext::getParents(), clang::LangOptions::isOverflowPatternExcluded(), and clang::LangOptionsBase::PostDecrInWhile.
|
static |
Definition at line 1113 of file CGExprScalar.cpp.
References clang::Type::isIntegerType().
Referenced by clang::CodeGen::CodeGenFunction::EmitBitfieldConversionCheck().
|
static |
Definition at line 4408 of file CGExprScalar.cpp.
References buildFMulAdd(), and clang::cast().