|
clang
3.8.0
|
#include "CodeGenFunction.h"#include "CGCXXABI.h"#include "CGObjCRuntime.h"#include "CodeGenModule.h"#include "TargetInfo.h"#include "clang/AST/ASTContext.h"#include "clang/AST/Decl.h"#include "clang/Basic/TargetBuiltins.h"#include "clang/Basic/TargetInfo.h"#include "clang/CodeGen/CGFunctionInfo.h"#include "llvm/ADT/StringExtras.h"#include "llvm/IR/CallSite.h"#include "llvm/IR/DataLayout.h"#include "llvm/IR/InlineAsm.h"#include "llvm/IR/Intrinsics.h"#include <sstream>Go to the source code of this file.
Macros | |
| #define | NEONMAP0(NameBase) { #NameBase, NEON::BI__builtin_neon_ ## NameBase, 0, 0, 0 } |
| #define | NEONMAP1(NameBase, LLVMIntrinsic, TypeModifier) |
| #define | NEONMAP2(NameBase, LLVMIntrinsic, AltLLVMIntrinsic, TypeModifier) |
| #define | INTRINSIC_X86_XSAVE_ID(NAME) |
| #define | INTRINSIC_WITH_CC(NAME) |
Enumerations | |
| enum | { AddRetType = (1 << 0), Add1ArgType = (1 << 1), Add2ArgTypes = (1 << 2), VectorizeRetType = (1 << 3), VectorizeArgTypes = (1 << 4), InventFloatType = (1 << 5), UnsignedAlts = (1 << 6), Use64BitVectors = (1 << 7), Use128BitVectors = (1 << 8), Vectorize1ArgType = Add1ArgType | VectorizeArgTypes, VectorRet = AddRetType | VectorizeRetType, VectorRetGetArgs01, FpCmpzModifiers } |
Functions | |
| static Value * | EmitToInt (CodeGenFunction &CGF, llvm::Value *V, QualType T, llvm::IntegerType *IntType) |
| Emit the conversions required to turn the given value into an integer of the given size. More... | |
| static Value * | EmitFromInt (CodeGenFunction &CGF, llvm::Value *V, QualType T, llvm::Type *ResultType) |
| static Value * | MakeBinaryAtomicValue (CodeGenFunction &CGF, llvm::AtomicRMWInst::BinOp Kind, const CallExpr *E) |
| Utility to insert an atomic instruction based on Instrinsic::ID and the expression node. More... | |
| static Value * | EmitNontemporalStore (CodeGenFunction &CGF, const CallExpr *E) |
| static Value * | EmitNontemporalLoad (CodeGenFunction &CGF, const CallExpr *E) |
| static RValue | EmitBinaryAtomic (CodeGenFunction &CGF, llvm::AtomicRMWInst::BinOp Kind, const CallExpr *E) |
| static RValue | EmitBinaryAtomicPost (CodeGenFunction &CGF, llvm::AtomicRMWInst::BinOp Kind, const CallExpr *E, Instruction::BinaryOps Op, bool Invert=false) |
| Utility to insert an atomic instruction based Instrinsic::ID and the expression node, where the return value is the result of the operation. More... | |
| static Value * | MakeAtomicCmpXchgValue (CodeGenFunction &CGF, const CallExpr *E, bool ReturnBool) |
| Utility to insert an atomic cmpxchg instruction. More... | |
| static Value * | EmitFAbs (CodeGenFunction &CGF, Value *V) |
| EmitFAbs - Emit a call to .fabs(). More... | |
| static Value * | EmitSignBit (CodeGenFunction &CGF, Value *V) |
| Emit the computation of the sign bit for a floating point value. More... | |
| static RValue | emitLibraryCall (CodeGenFunction &CGF, const FunctionDecl *Fn, const CallExpr *E, llvm::Value *calleeValue) |
| static llvm::Value * | EmitOverflowIntrinsic (CodeGenFunction &CGF, const llvm::Intrinsic::ID IntrinsicID, llvm::Value *X, llvm::Value *Y, llvm::Value *&Carry) |
| Emit a call to llvm. More... | |
| static WidthAndSignedness | getIntegerWidthAndSignedness (const clang::ASTContext &context, const clang::QualType Type) |
| static struct WidthAndSignedness | EncompassingIntegerType (ArrayRef< struct WidthAndSignedness > Types) |
| static bool | areBOSTypesCompatible (int From, int To) |
Checks if using the result of __builtin_object_size(p, From) in place of __builtin_object_size(p, To) is correct. More... | |
| static llvm::Value * | getDefaultBuiltinObjectSizeResult (unsigned Type, llvm::IntegerType *ResType) |
| static Value * | EmitTargetArchBuiltinExpr (CodeGenFunction *CGF, unsigned BuiltinID, const CallExpr *E, llvm::Triple::ArchType Arch) |
| static llvm::VectorType * | GetNeonType (CodeGenFunction *CGF, NeonTypeFlags TypeFlags, bool V1Ty=false) |
| static llvm::VectorType * | GetFloatNeonType (CodeGenFunction *CGF, NeonTypeFlags IntTypeFlags) |
| static const NeonIntrinsicInfo * | findNeonIntrinsicInMap (ArrayRef< NeonIntrinsicInfo > IntrinsicMap, unsigned BuiltinID, bool &MapProvenSorted) |
| static Value * | EmitCommonNeonSISDBuiltinExpr (CodeGenFunction &CGF, const NeonIntrinsicInfo &SISDInfo, SmallVectorImpl< Value * > &Ops, const CallExpr *E) |
| static Value * | packTBLDVectorList (CodeGenFunction &CGF, ArrayRef< Value * > Ops, Value *ExtOp, Value *IndexOp, llvm::Type *ResTy, unsigned IntID, const char *Name) |
| static Value * | EmitSpecialRegisterBuiltin (CodeGenFunction &CGF, const CallExpr *E, llvm::Type *RegisterType, llvm::Type *ValueType, bool IsRead) |
| static bool | HasExtraNeonArgument (unsigned BuiltinID) |
| Return true if BuiltinID is an overloaded Neon intrinsic with an extra argument that specifies the vector type. More... | |
| static Value * | EmitAArch64TblBuiltinExpr (CodeGenFunction &CGF, unsigned BuiltinID, const CallExpr *E, SmallVectorImpl< Value * > &Ops) |
| static Value * | emitUnaryFPBuiltin (CodeGenFunction &CGF, const CallExpr *E, unsigned IntrinsicID) |
| static Value * | emitTernaryFPBuiltin (CodeGenFunction &CGF, const CallExpr *E, unsigned IntrinsicID) |
| static Value * | emitFPIntBuiltin (CodeGenFunction &CGF, const CallExpr *E, unsigned IntrinsicID) |
| static Value * | EmitSystemZIntrinsicWithCC (CodeGenFunction &CGF, unsigned IntrinsicID, const CallExpr *E) |
| Handle a SystemZ function in which the final argument is a pointer to an int that receives the post-instruction CC value. More... | |
Variables | |
| static const NeonIntrinsicInfo | ARMSIMDIntrinsicMap [] |
| static const NeonIntrinsicInfo | AArch64SIMDIntrinsicMap [] |
| static const NeonIntrinsicInfo | AArch64SISDIntrinsicMap [] |
| static bool | NEONSIMDIntrinsicsProvenSorted = false |
| static bool | AArch64SIMDIntrinsicsProvenSorted = false |
| static bool | AArch64SISDIntrinsicsProvenSorted = false |
| #define INTRINSIC_WITH_CC | ( | NAME | ) |
Referenced by clang::CodeGen::CodeGenFunction::EmitSystemZBuiltinExpr().
| #define INTRINSIC_X86_XSAVE_ID | ( | NAME | ) |
Referenced by clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr().
| #define NEONMAP0 | ( | NameBase | ) | { #NameBase, NEON::BI__builtin_neon_ ## NameBase, 0, 0, 0 } |
Definition at line 2254 of file CGBuiltin.cpp.
| #define NEONMAP1 | ( | NameBase, | |
| LLVMIntrinsic, | |||
| TypeModifier | |||
| ) |
Definition at line 2257 of file CGBuiltin.cpp.
| #define NEONMAP2 | ( | NameBase, | |
| LLVMIntrinsic, | |||
| AltLLVMIntrinsic, | |||
| TypeModifier | |||
| ) |
Definition at line 2261 of file CGBuiltin.cpp.
| anonymous enum |
Definition at line 2215 of file CGBuiltin.cpp.
|
static |
Checks if using the result of __builtin_object_size(p, From) in place of __builtin_object_size(p, To) is correct.
Definition at line 347 of file CGBuiltin.cpp.
|
static |
Definition at line 4151 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitNeonCall(), clang::CallExpr::getArg(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenModule::getIntrinsic(), GetNeonType(), clang::CallExpr::getNumArgs(), clang::Expr::isIntegerConstantExpr(), and packTBLDVectorList().
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr().
|
static |
Definition at line 136 of file CGBuiltin.cpp.
References clang::CodeGen::RValue::get(), and MakeBinaryAtomicValue().
|
static |
Utility to insert an atomic instruction based Instrinsic::ID and the expression node, where the return value is the result of the operation.
Definition at line 145 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateBitCast(), EmitFromInt(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), EmitToInt(), clang::CodeGen::RValue::get(), clang::CallExpr::getArg(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::getLLVMContext(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isPointerType(), clang::Result, and clang::CodeGen::Type.
|
static |
Definition at line 2862 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CodeGenFunction::EmitNeonCall(), clang::CallExpr::getArg(), clang::Expr::getType(), clang::CodeGen::CodeGenFunction::LookupNeonLLVMIntrinsic(), Modifier, clang::CodeGen::CodeGenTypeCache::SizeTy, and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr().
|
static |
EmitFAbs - Emit a call to .fabs().
Definition at line 223 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, fabs, and clang::CodeGen::CodeGenModule::getIntrinsic().
Referenced by clang::CodeGen::CodeGenFunction::EmitBuiltinExpr().
|
static |
Definition at line 6877 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CallExpr::getArg(), and clang::CodeGen::CodeGenModule::getIntrinsic().
Referenced by clang::CodeGen::CodeGenFunction::EmitAMDGPUBuiltinExpr().
|
static |
Definition at line 72 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, and clang::CodeGen::CodeGenFunction::EmitFromMemory().
Referenced by EmitBinaryAtomicPost(), MakeAtomicCmpXchgValue(), and MakeBinaryAtomicValue().
|
static |
Definition at line 261 of file CGBuiltin.cpp.
References E, clang::CodeGen::CodeGenFunction::EmitCall(), clang::CallExpr::getCallee(), and clang::Expr::getType().
|
static |
Definition at line 128 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::EmitLoadOfScalar(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CallExpr::getArg(), clang::Expr::getExprLoc(), clang::Expr::getType(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), and clang::CodeGen::LValue::setNontemporal().
|
static |
Definition at line 114 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CodeGen::CodeGenFunction::EmitStoreOfScalar(), clang::CodeGen::CodeGenFunction::EmitToMemory(), clang::CallExpr::getArg(), clang::Expr::getType(), clang::CodeGen::CodeGenFunction::MakeNaturalAlignAddrLValue(), and clang::CodeGen::LValue::setNontemporal().
|
static |
Emit a call to llvm.
{sadd,uadd,ssub,usub,smul,umul}.with.overflow.* depending on IntrinsicID.
Definition at line 276 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenModule::getIntrinsic(), and X.
|
static |
Emit the computation of the sign bit for a floating point value.
Returns the i1 sign bit value.
Definition at line 232 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, AttributeLangSupport::C, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateBitCast(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::CodeGen::CodeGenFunction::getTarget(), clang::TargetInfo::isBigEndian(), and clang::CodeGen::Type.
|
static |
Definition at line 3452 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, Builder, clang::CodeGen::CodeGenFunction::CGM, Context, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CallExpr::getArg(), clang::CodeGen::CodeGenModule::getIntrinsic(), clang::CodeGen::CodeGenModule::getLLVMContext(), clang::Expr::IgnoreParenCasts(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr().
|
static |
Handle a SystemZ function in which the final argument is a pointer to an int that receives the post-instruction CC value.
At the LLVM level this is represented as a function that returns a {result, cc} pair.
Definition at line 6957 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CGBuilderTy::CreateStore(), clang::CodeGen::CodeGenFunction::EmitPointerWithAlignment(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CallExpr::getArg(), clang::CodeGen::CodeGenModule::getIntrinsic(), clang::CallExpr::getNumArgs(), I, and clang::NumArgs.
|
static |
Definition at line 2066 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitAMDGPUBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitNVPTXBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitPPCBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitSystemZBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitWebAssemblyBuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitX86BuiltinExpr().
Referenced by clang::CodeGen::CodeGenFunction::EmitTargetBuiltinExpr().
|
static |
Definition at line 6865 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CallExpr::getArg(), and clang::CodeGen::CodeGenModule::getIntrinsic().
Referenced by clang::CodeGen::CodeGenFunction::EmitAMDGPUBuiltinExpr().
|
static |
Emit the conversions required to turn the given value into an integer of the given size.
Definition at line 61 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, and clang::CodeGen::CodeGenFunction::EmitToMemory().
Referenced by EmitBinaryAtomicPost(), MakeAtomicCmpXchgValue(), and MakeBinaryAtomicValue().
|
static |
Definition at line 6855 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitScalarExpr(), clang::CallExpr::getArg(), and clang::CodeGen::CodeGenModule::getIntrinsic().
Referenced by clang::CodeGen::CodeGenFunction::EmitAMDGPUBuiltinExpr().
|
static |
Definition at line 311 of file CGBuiltin.cpp.
|
static |
Definition at line 2804 of file CGBuiltin.cpp.
References clang::begin(), and clang::end().
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr().
|
static |
Definition at line 355 of file CGBuiltin.cpp.
|
static |
Definition at line 2144 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenTypeCache::DoubleTy, clang::CodeGen::CodeGenTypeCache::FloatTy, clang::NeonTypeFlags::getEltType(), clang::NeonTypeFlags::Int32, clang::NeonTypeFlags::Int64, and clang::NeonTypeFlags::isQuad().
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitCommonNeonBuiltinExpr().
|
static |
Definition at line 299 of file CGBuiltin.cpp.
References clang::ASTContext::getTypeInfo(), clang::Type::isBooleanType(), clang::Type::isIntegerType(), clang::Type::isSignedIntegerType(), and clang::TypeInfo::Width.
|
static |
Definition at line 2114 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenTypeCache::DoubleTy, clang::NeonTypeFlags::Float16, clang::NeonTypeFlags::Float32, clang::NeonTypeFlags::Float64, clang::CodeGen::CodeGenTypeCache::FloatTy, clang::NeonTypeFlags::getEltType(), clang::NeonTypeFlags::Int16, clang::CodeGen::CodeGenTypeCache::Int16Ty, clang::NeonTypeFlags::Int32, clang::CodeGen::CodeGenTypeCache::Int32Ty, clang::NeonTypeFlags::Int64, clang::CodeGen::CodeGenTypeCache::Int64Ty, clang::NeonTypeFlags::Int8, clang::CodeGen::CodeGenTypeCache::Int8Ty, clang::NeonTypeFlags::isQuad(), clang::NeonTypeFlags::Poly128, clang::NeonTypeFlags::Poly16, clang::NeonTypeFlags::Poly64, and clang::NeonTypeFlags::Poly8.
Referenced by clang::CodeGen::CodeGenFunction::EmitAArch64BuiltinExpr(), EmitAArch64TblBuiltinExpr(), clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr(), and clang::CodeGen::CodeGenFunction::EmitCommonNeonBuiltinExpr().
Return true if BuiltinID is an overloaded Neon intrinsic with an extra argument that specifies the vector type.
Definition at line 3511 of file CGBuiltin.cpp.
Referenced by clang::CodeGen::CodeGenFunction::EmitARMBuiltinExpr().
|
static |
Utility to insert an atomic cmpxchg instruction.
| CGF | The current codegen function. |
| E | Builtin call expression to convert to cmpxchg. arg0 - address to operate on arg1 - value to compare with arg2 - new value |
| ReturnBool | Specifies whether to return success flag of cmpxchg result or the old value. |
Definition at line 192 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::ConvertType(), clang::CodeGen::CGBuilderTy::CreateBitCast(), EmitFromInt(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), EmitToInt(), clang::CallExpr::getArg(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::getLLVMContext(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), and clang::CodeGen::Type.
Referenced by clang::CodeGen::CodeGenFunction::EmitNVPTXBuiltinExpr().
|
static |
Utility to insert an atomic instruction based on Instrinsic::ID and the expression node.
Definition at line 85 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateBitCast(), EmitFromInt(), clang::CodeGen::CodeGenFunction::EmitScalarExpr(), EmitToInt(), clang::CallExpr::getArg(), clang::CodeGen::CodeGenFunction::getContext(), clang::CodeGen::CodeGenFunction::getLLVMContext(), clang::Type::getPointeeType(), clang::Expr::getType(), clang::ASTContext::getTypeSize(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isPointerType(), clang::Result, and clang::CodeGen::Type.
Referenced by EmitBinaryAtomic(), and clang::CodeGen::CodeGenFunction::EmitNVPTXBuiltinExpr().
|
static |
Definition at line 3376 of file CGBuiltin.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::CGM, clang::CodeGen::CodeGenFunction::EmitNeonCall(), clang::CodeGen::CodeGenModule::getIntrinsic(), and clang::CodeGen::CodeGenTypeCache::Int32Ty.
Referenced by EmitAArch64TblBuiltinExpr().
|
static |
Definition at line 2483 of file CGBuiltin.cpp.
Definition at line 2799 of file CGBuiltin.cpp.
|
static |
Definition at line 2598 of file CGBuiltin.cpp.
Definition at line 2800 of file CGBuiltin.cpp.
|
static |
Definition at line 2266 of file CGBuiltin.cpp.
Definition at line 2797 of file CGBuiltin.cpp.
1.8.6