Home | History | Annotate | Download | only in CodeGen

Lines Matching full:cgf

199 pushTemporaryCleanup(CodeGenFunction &CGF, const MaterializeTemporaryExpr *M,
237 CleanupKind = CGF.getARCCleanupKind();
247 CGF.pushDestroy(CleanupKind, ReferenceTemporary,
251 CGF.pushLifetimeExtendedDestroy(CleanupKind, ReferenceTemporary,
282 CleanupFn = CodeGenFunction(CGF.CGM).generateDestroyHelper(
284 CodeGenFunction::destroyCXXObject, CGF.getLangOpts().Exceptions,
286 CleanupArg = llvm::Constant::getNullValue(CGF.Int8PtrTy);
288 CleanupFn = CGF.CGM.getAddrOfCXXStructor(ReferenceTemporaryDtor,
292 CGF.CGM.getCXXABI().registerGlobalDtor(
293 CGF, *cast<VarDecl>(M->getExtendingDecl()), CleanupFn, CleanupArg);
298 CGF.pushDestroy(NormalAndEHCleanup, ReferenceTemporary, E->getType(),
300 CGF.getLangOpts().Exceptions);
304 CGF.pushLifetimeExtendedDestroy(NormalAndEHCleanup,
307 CGF.getLangOpts().Exceptions);
316 createReferenceTemporary(CodeGenFunction &CGF,
326 if (CGF.CGM.getCodeGenOpts().MergeAllConstants &&
328 CGF.CGM.isTypeConstant(Ty, true))
329 if (llvm::Constant *Init = CGF.CGM.EmitConstantExpr(Inner, Ty, &CGF)) {
331 CGF.CGM.getModule(), Init->getType(), /*isConstant=*/true,
333 CharUnits alignment = CGF.getContext().getTypeAlignInChars(Ty);
338 return CGF.CreateMemTemp(Ty, "ref.tmp");
342 return CGF.CGM.GetAddrOfGlobalTemporary(M, Inner);
719 CodeGenFunction &CGF, const Expr *Base, QualType &IndexedType) {
723 return CGF.Builder.getInt32(VT->getNumElements());
734 return CGF.Builder.getInt(CAT->getSize());
736 return CGF.getVLASize(VAT).first;
805 CodeGenFunction *CGF) {
807 if (CGF && E->getType()->isVariablyModifiedType())
808 CGF->EmitVariablyModifiedType(E->getType());
1218 static bool getRangeForType(CodeGenFunction &CGF, QualType Ty,
1222 bool IsRegularCPlusPlusEnum = CGF.getLangOpts().CPlusPlus && StrictEnums &&
1229 Min = llvm::APInt(CGF.getContext().getTypeSize(Ty), 0);
1230 End = llvm::APInt(CGF.getContext().getTypeSize(Ty), 2);
1233 llvm::Type *LTy = CGF.ConvertTypeForMem(ED->getIntegerType());
1943 EmitBitCastOfLValueToProperType(CodeGenFunction &CGF,
1947 return CGF.Builder.CreateBitCast(V, IRType->getPointerTo(AS), Name);
1951 CodeGenFunction &CGF, const VarDecl *VD, QualType T, Address Addr,
1953 Addr = CGF.CGM.getOpenMPRuntime().getAddrOfThreadPrivate(CGF, VD, Addr, Loc);
1954 Addr = CGF.Builder.CreateElementBitCast(Addr, RealVarTy);
1955 return CGF.MakeAddrLValue(Addr, T, AlignmentSource::Decl);
1989 static LValue EmitGlobalVarDeclLValue(CodeGenFunction &CGF,
1995 CGF.CGM.getCXXABI().usesThreadWrapperFunction())
1996 return CGF.CGM.getCXXABI().EmitThreadLocalVarDeclLValue(CGF, VD, T);
1998 llvm::Value *V = CGF.CGM.GetAddrOfGlobalVar(VD);
1999 llvm::Type *RealVarTy = CGF.getTypes().ConvertTypeForMem(VD->getType());
2000 V = EmitBitCastOfLValueToProperType(CGF, V, RealVarTy);
2001 CharUnits Alignment = CGF.getContext().getDeclAlign(VD);
2006 if (CGF.getLangOpts().OpenMP && VD->hasAttr<OMPThreadPrivateDeclAttr>())
2007 return EmitThreadPrivateVarDeclLValue(CGF, VD, T, Addr, RealVarTy,
2010 LV = CGF.EmitLoadOfReferenceLValue(Addr, RefTy);
2012 LV = CGF.MakeAddrLValue(Addr, T, AlignmentSource::Decl);
2014 setObjCGCLValueClass(CGF.getContext(), E, LV);
2018 static LValue EmitFunctionDeclLValue(CodeGenFunction &CGF,
2020 llvm::Value *V = CGF.CGM.GetAddrOfFunction(FD);
2028 CGF.getContext().getFunctionNoProtoType(Proto->getReturnType());
2029 NoProtoType = CGF.getContext().getPointerType(NoProtoType);
2030 V = CGF.Builder.CreateBitCast(V, CGF.ConvertType(NoProtoType));
2033 CharUnits Alignment = CGF.getContext().getDeclAlign(FD);
2034 return CGF.MakeAddrLValue(V, E->getType(), Alignment, AlignmentSource::Decl);
2037 static LValue EmitCapturedFieldLValue(CodeGenFunction &CGF, const FieldDecl *FD,
2039 QualType TagType = CGF.getContext().getTagDeclType(FD->getParent());
2040 LValue LV = CGF.MakeNaturalAlignAddrLValue(ThisValue, TagType);
2041 return CGF.EmitLValueForField(LV, FD);
2463 static void emitCheckHandlerCall(CodeGenFunction &CGF,
2484 llvm::Value *Fn = CGF.CGM.CreateRuntimeFunction(
2486 llvm::AttributeSet::get(CGF.getLLVMContext(),
2488 llvm::CallInst *HandlerCall = CGF.EmitNounwindRuntimeCall(Fn, FnArgs);
2491 CGF.Builder.CreateUnreachable();
2493 CGF.Builder.CreateBr(ContBB);
2806 static llvm::Value *emitArraySubscriptGEP(CodeGenFunction &CGF,
2812 return CGF.Builder.CreateInBoundsGEP(ptr, indices, name);
2814 return CGF.Builder.CreateGEP(ptr, indices, name);
2842 static Address emitArraySubscriptGEP(CodeGenFunction &CGF, Address addr,
2855 if (auto vla = CGF.getContext().getAsVariableArrayType(eltType)) {
2856 eltType = getFixedSizeElementType(CGF.getContext(), vla);
2860 CharUnits eltSize = CGF.getContext().getTypeSizeInChars(eltType);
2865 emitArraySubscriptGEP(CGF, addr.getPointer(), indices, inbounds, name);
2999 static Address emitOMPArraySectionBase(CodeGenFunction &CGF, const Expr *Base,
3005 BaseLVal = CGF.EmitOMPArraySectionExpr(ASE, IsLowerBound);
3012 llvm::Type *NewTy = CGF.ConvertType(BaseTy);
3013 Addr = CGF.Builder.CreateElementBitCast(Addr, NewTy);
3020 Addr = CGF.Builder.CreateStructGEP(Addr, 0, CharUnits::Zero(),
3024 return CGF.Builder.CreateElementBitCast(Addr,
3025 CGF.ConvertTypeForMem(ElTy));
3027 CharUnits Align = CGF.getNaturalTypeAlignment(ElTy, &AlignSource);
3028 return Address(CGF.Builder.CreateLoad(BaseLVal.getAddress()), Align);
3030 return CGF.EmitPointerWithAlignment(Base, &AlignSource);
3287 static Address emitAddrOfFieldStorage(CodeGenFunction &CGF, Address base,
3292 CGF.CGM.getTypes().getCGRecordLayout(rec).getLLVMFieldNo(field);
3298 assert((idx != 0 || CGF.getContext().getASTRecordLayout(rec)
3302 auto &recLayout = CGF.getContext().getASTRecordLayout(rec);
3304 offset = CGF.getContext().toCharUnitsFromBits(offsetInBits);
3307 return CGF.Builder.CreateStructGEP(base, idx, offset, field->getName());
3472 static Optional<LValue> EmitLValueOrThrowExpression(CodeGenFunction &CGF,
3475 CGF.EmitCXXThrowExpr(ThrowExpr, /*KeepInsertionPoint*/false);
3479 return CGF.EmitLValue(Operand);
4189 static LValueOrRValue emitPseudoObjectExpr(CodeGenFunction &CGF,
4213 CGF.EmitAggExpr(ov->getSourceExpr(), slot);
4215 LValue LV = CGF.MakeAddrLValue(slot.getAddress(), ov->getType(),
4217 opaqueData = OVMA::bind(CGF, ov, LV);
4222 opaqueData = OVMA::bind(CGF, ov, ov->getSourceExpr());
4227 result.LV = CGF.EmitLValue(ov);
4229 result.RV = CGF.EmitAnyExpr(ov, slot);
4239 result.LV = CGF.EmitLValue(semantic);
4241 result.RV = CGF.EmitAnyExpr(semantic, slot);
4245 CGF.EmitIgnoredExpr(semantic);
4251 opaques[i].unbind(CGF);