Lines Matching refs:CGF
90 Address ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitMSVAArg() argument
241 static llvm::Value *emitRoundPointerUpToAlignment(CodeGenFunction &CGF, in emitRoundPointerUpToAlignment() argument
246 PtrAsInt = CGF.Builder.CreatePtrToInt(PtrAsInt, CGF.IntPtrTy); in emitRoundPointerUpToAlignment()
247 PtrAsInt = CGF.Builder.CreateAdd(PtrAsInt, in emitRoundPointerUpToAlignment()
248 llvm::ConstantInt::get(CGF.IntPtrTy, Align.getQuantity() - 1)); in emitRoundPointerUpToAlignment()
249 PtrAsInt = CGF.Builder.CreateAnd(PtrAsInt, in emitRoundPointerUpToAlignment()
250 llvm::ConstantInt::get(CGF.IntPtrTy, -Align.getQuantity())); in emitRoundPointerUpToAlignment()
251 PtrAsInt = CGF.Builder.CreateIntToPtr(PtrAsInt, in emitRoundPointerUpToAlignment()
271 static Address emitVoidPtrDirectVAArg(CodeGenFunction &CGF, in emitVoidPtrDirectVAArg() argument
280 if (VAListAddr.getElementType() != CGF.Int8PtrTy) in emitVoidPtrDirectVAArg()
281 VAListAddr = CGF.Builder.CreateElementBitCast(VAListAddr, CGF.Int8PtrTy); in emitVoidPtrDirectVAArg()
283 llvm::Value *Ptr = CGF.Builder.CreateLoad(VAListAddr, "argp.cur"); in emitVoidPtrDirectVAArg()
288 Addr = Address(emitRoundPointerUpToAlignment(CGF, Ptr, DirectAlign), in emitVoidPtrDirectVAArg()
297 CGF.Builder.CreateConstInBoundsByteGEP(Addr.getPointer(), FullDirectSize, in emitVoidPtrDirectVAArg()
299 CGF.Builder.CreateStore(NextPtr, VAListAddr); in emitVoidPtrDirectVAArg()
303 if (DirectSize < SlotSize && CGF.CGM.getDataLayout().isBigEndian() && in emitVoidPtrDirectVAArg()
305 Addr = CGF.Builder.CreateConstInBoundsByteGEP(Addr, SlotSize - DirectSize); in emitVoidPtrDirectVAArg()
308 Addr = CGF.Builder.CreateElementBitCast(Addr, DirectTy); in emitVoidPtrDirectVAArg()
325 static Address emitVoidPtrVAArg(CodeGenFunction &CGF, Address VAListAddr, in emitVoidPtrVAArg() argument
333 DirectSize = CGF.getPointerSize(); in emitVoidPtrVAArg()
334 DirectAlign = CGF.getPointerAlign(); in emitVoidPtrVAArg()
341 llvm::Type *DirectTy = CGF.ConvertTypeForMem(ValueTy); in emitVoidPtrVAArg()
345 Address Addr = emitVoidPtrDirectVAArg(CGF, VAListAddr, DirectTy, in emitVoidPtrVAArg()
351 Addr = Address(CGF.Builder.CreateLoad(Addr), ValueInfo.second); in emitVoidPtrVAArg()
358 static Address emitMergePHI(CodeGenFunction &CGF, in emitMergePHI() argument
363 llvm::PHINode *PHI = CGF.Builder.CreatePHI(Addr1.getType(), 2, Name); in emitMergePHI()
539 Address EmitVAArgInstr(CodeGenFunction &CGF, Address VAListAddr, QualType Ty, in EmitVAArgInstr() argument
559 auto TyInfo = CGF.getContext().getTypeInfoInChars(Ty); in EmitVAArgInstr()
563 llvm::PointerType::getUnqual(CGF.ConvertTypeForMem(Ty)); in EmitVAArgInstr()
565 CGF.Builder.CreateVAArg(VAListAddr.getPointer(), BaseTy); in EmitVAArgInstr()
580 Address Temp = CGF.CreateMemTemp(Ty, "varet"); in EmitVAArgInstr()
581 Val = CGF.Builder.CreateVAArg(VAListAddr.getPointer(), CGF.ConvertType(Ty)); in EmitVAArgInstr()
582 CGF.Builder.CreateStore(Val, Temp); in EmitVAArgInstr()
605 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
607 return EmitVAArgInstr(CGF, VAListAddr, Ty, classifyArgumentType(Ty)); in EmitVAArg()
677 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
730 Address WebAssemblyABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
732 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*Indirect=*/ false, in EmitVAArg()
753 Address EmitVAArg(CodeGenFunction &CGF,
771 Address PNaClABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
779 return EmitVAArgInstr(CGF, VAListAddr, Ty, ABIArgInfo::getDirect()); in EmitVAArg()
824 static llvm::Type* X86AdjustInlineAsmType(CodeGen::CodeGenFunction &CGF, in X86AdjustInlineAsmType() argument
833 return llvm::Type::getX86_MMXTy(CGF.getLLVMContext()); in X86AdjustInlineAsmType()
941 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
986 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
989 llvm::Type* adjustInlineAsmType(CodeGen::CodeGenFunction &CGF, in adjustInlineAsmType() argument
992 return X86AdjustInlineAsmType(CGF, Constraint, Ty); in adjustInlineAsmType()
995 void addReturnRegisterOutputs(CodeGenFunction &CGF, LValue ReturnValue,
1067 CodeGenFunction &CGF, LValue ReturnSlot, std::string &Constraints, in addReturnRegisterOutputs() argument
1072 uint64_t RetWidth = CGF.getContext().getTypeSize(ReturnSlot.getType()); in addReturnRegisterOutputs()
1080 ResultRegTypes.push_back(CGF.Int32Ty); in addReturnRegisterOutputs()
1084 ResultRegTypes.push_back(CGF.Int64Ty); in addReturnRegisterOutputs()
1088 llvm::Type *CoerceTy = llvm::IntegerType::get(CGF.getLLVMContext(), RetWidth); in addReturnRegisterOutputs()
1092 ReturnSlot.setAddress(CGF.Builder.CreateBitCast(ReturnSlot.getAddress(), in addReturnRegisterOutputs()
1719 Address X86_32ABIInfo::EmitVAArg(CodeGenFunction &CGF, in EmitVAArg() argument
1731 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*Indirect*/ false, in EmitVAArg()
1788 CodeGen::CodeGenFunction &CGF, in initDwarfEHRegSizeTable() argument
1790 CodeGen::CGBuilderTy &Builder = CGF.Builder; in initDwarfEHRegSizeTable()
1792 llvm::Value *Four8 = llvm::ConstantInt::get(CGF.Int8Ty, 4); in initDwarfEHRegSizeTable()
1799 if (CGF.CGM.getTarget().getTriple().isOSDarwin()) { in initDwarfEHRegSizeTable()
1803 llvm::Value *Sixteen8 = llvm::ConstantInt::get(CGF.Int8Ty, 16); in initDwarfEHRegSizeTable()
1810 Four8, Builder.CreateConstInBoundsGEP1_32(CGF.Int8Ty, Address, 9), in initDwarfEHRegSizeTable()
1816 llvm::Value *Twelve8 = llvm::ConstantInt::get(CGF.Int8Ty, 12); in initDwarfEHRegSizeTable()
1991 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
1993 Address EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr,
2016 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
2050 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, in initDwarfEHRegSizeTable() argument
2052 llvm::Value *Eight8 = llvm::ConstantInt::get(CGF.Int8Ty, 8); in initDwarfEHRegSizeTable()
2056 AssignToArrayRange(CGF.Builder, Address, Eight8, 0, 16); in initDwarfEHRegSizeTable()
2060 llvm::Type* adjustInlineAsmType(CodeGen::CodeGenFunction &CGF, in adjustInlineAsmType() argument
2063 return X86AdjustInlineAsmType(CGF, Constraint, Ty); in adjustInlineAsmType()
2205 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, in initDwarfEHRegSizeTable() argument
2207 llvm::Value *Eight8 = llvm::ConstantInt::get(CGF.Int8Ty, 8); in initDwarfEHRegSizeTable()
2211 AssignToArrayRange(CGF.Builder, Address, Eight8, 0, 16); in initDwarfEHRegSizeTable()
3320 static Address EmitX86_64VAArgFromMemory(CodeGenFunction &CGF, in EmitX86_64VAArgFromMemory() argument
3322 Address overflow_arg_area_p = CGF.Builder.CreateStructGEP( in EmitX86_64VAArgFromMemory()
3325 CGF.Builder.CreateLoad(overflow_arg_area_p, "overflow_arg_area"); in EmitX86_64VAArgFromMemory()
3331 CharUnits Align = CGF.getContext().getTypeAlignInChars(Ty); in EmitX86_64VAArgFromMemory()
3333 overflow_arg_area = emitRoundPointerUpToAlignment(CGF, overflow_arg_area, in EmitX86_64VAArgFromMemory()
3338 llvm::Type *LTy = CGF.ConvertTypeForMem(Ty); in EmitX86_64VAArgFromMemory()
3340 CGF.Builder.CreateBitCast(overflow_arg_area, in EmitX86_64VAArgFromMemory()
3348 uint64_t SizeInBytes = (CGF.getContext().getTypeSize(Ty) + 7) / 8; in EmitX86_64VAArgFromMemory()
3350 llvm::ConstantInt::get(CGF.Int32Ty, (SizeInBytes + 7) & ~7); in EmitX86_64VAArgFromMemory()
3351 overflow_arg_area = CGF.Builder.CreateGEP(overflow_arg_area, Offset, in EmitX86_64VAArgFromMemory()
3353 CGF.Builder.CreateStore(overflow_arg_area, overflow_arg_area_p); in EmitX86_64VAArgFromMemory()
3359 Address X86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
3377 return EmitX86_64VAArgFromMemory(CGF, VAListAddr, Ty); in EmitVAArg()
3395 CGF.Builder.CreateStructGEP(VAListAddr, 0, CharUnits::Zero(), in EmitVAArg()
3397 gp_offset = CGF.Builder.CreateLoad(gp_offset_p, "gp_offset"); in EmitVAArg()
3398 InRegs = llvm::ConstantInt::get(CGF.Int32Ty, 48 - neededInt * 8); in EmitVAArg()
3399 InRegs = CGF.Builder.CreateICmpULE(gp_offset, InRegs, "fits_in_gp"); in EmitVAArg()
3404 CGF.Builder.CreateStructGEP(VAListAddr, 1, CharUnits::fromQuantity(4), in EmitVAArg()
3406 fp_offset = CGF.Builder.CreateLoad(fp_offset_p, "fp_offset"); in EmitVAArg()
3408 llvm::ConstantInt::get(CGF.Int32Ty, 176 - neededSSE * 16); in EmitVAArg()
3409 FitsInFP = CGF.Builder.CreateICmpULE(fp_offset, FitsInFP, "fits_in_fp"); in EmitVAArg()
3410 InRegs = InRegs ? CGF.Builder.CreateAnd(InRegs, FitsInFP) : FitsInFP; in EmitVAArg()
3413 llvm::BasicBlock *InRegBlock = CGF.createBasicBlock("vaarg.in_reg"); in EmitVAArg()
3414 llvm::BasicBlock *InMemBlock = CGF.createBasicBlock("vaarg.in_mem"); in EmitVAArg()
3415 llvm::BasicBlock *ContBlock = CGF.createBasicBlock("vaarg.end"); in EmitVAArg()
3416 CGF.Builder.CreateCondBr(InRegs, InRegBlock, InMemBlock); in EmitVAArg()
3420 CGF.EmitBlock(InRegBlock); in EmitVAArg()
3432 llvm::Type *LTy = CGF.ConvertTypeForMem(Ty); in EmitVAArg()
3433 llvm::Value *RegSaveArea = CGF.Builder.CreateLoad( in EmitVAArg()
3434 CGF.Builder.CreateStructGEP(VAListAddr, 3, CharUnits::fromQuantity(16)), in EmitVAArg()
3442 Address Tmp = CGF.CreateMemTemp(Ty); in EmitVAArg()
3443 Tmp = CGF.Builder.CreateElementBitCast(Tmp, ST); in EmitVAArg()
3451 llvm::Value *GPAddr = CGF.Builder.CreateGEP(RegSaveArea, gp_offset); in EmitVAArg()
3452 llvm::Value *FPAddr = CGF.Builder.CreateGEP(RegSaveArea, fp_offset); in EmitVAArg()
3458 CGF.Builder.CreateDefaultAlignedLoad( in EmitVAArg()
3459 CGF.Builder.CreateBitCast(RegLoAddr, PTyLo)); in EmitVAArg()
3460 CGF.Builder.CreateStore(V, in EmitVAArg()
3461 CGF.Builder.CreateStructGEP(Tmp, 0, CharUnits::Zero())); in EmitVAArg()
3464 V = CGF.Builder.CreateDefaultAlignedLoad( in EmitVAArg()
3465 CGF.Builder.CreateBitCast(RegHiAddr, PTyHi)); in EmitVAArg()
3468 CGF.Builder.CreateStore(V, CGF.Builder.CreateStructGEP(Tmp, 1, Offset)); in EmitVAArg()
3470 RegAddr = CGF.Builder.CreateElementBitCast(Tmp, LTy); in EmitVAArg()
3472 RegAddr = Address(CGF.Builder.CreateGEP(RegSaveArea, gp_offset), in EmitVAArg()
3474 RegAddr = CGF.Builder.CreateElementBitCast(RegAddr, LTy); in EmitVAArg()
3485 Address Tmp = CGF.CreateMemTemp(Ty); in EmitVAArg()
3486 CGF.Builder.CreateMemCpy(Tmp, RegAddr, TySize, false); in EmitVAArg()
3491 RegAddr = Address(CGF.Builder.CreateGEP(RegSaveArea, fp_offset), in EmitVAArg()
3493 RegAddr = CGF.Builder.CreateElementBitCast(RegAddr, LTy); in EmitVAArg()
3502 Address RegAddrLo = Address(CGF.Builder.CreateGEP(RegSaveArea, fp_offset), in EmitVAArg()
3505 CGF.Builder.CreateConstInBoundsByteGEP(RegAddrLo, in EmitVAArg()
3507 llvm::Type *DoubleTy = CGF.DoubleTy; in EmitVAArg()
3510 Address Tmp = CGF.CreateMemTemp(Ty); in EmitVAArg()
3511 Tmp = CGF.Builder.CreateElementBitCast(Tmp, ST); in EmitVAArg()
3512 V = CGF.Builder.CreateLoad( in EmitVAArg()
3513 CGF.Builder.CreateElementBitCast(RegAddrLo, DoubleTy)); in EmitVAArg()
3514 CGF.Builder.CreateStore(V, in EmitVAArg()
3515 CGF.Builder.CreateStructGEP(Tmp, 0, CharUnits::Zero())); in EmitVAArg()
3516 V = CGF.Builder.CreateLoad( in EmitVAArg()
3517 CGF.Builder.CreateElementBitCast(RegAddrHi, DoubleTy)); in EmitVAArg()
3518 CGF.Builder.CreateStore(V, in EmitVAArg()
3519 CGF.Builder.CreateStructGEP(Tmp, 1, CharUnits::fromQuantity(8))); in EmitVAArg()
3521 RegAddr = CGF.Builder.CreateElementBitCast(Tmp, LTy); in EmitVAArg()
3528 llvm::Value *Offset = llvm::ConstantInt::get(CGF.Int32Ty, neededInt * 8); in EmitVAArg()
3529 CGF.Builder.CreateStore(CGF.Builder.CreateAdd(gp_offset, Offset), in EmitVAArg()
3533 llvm::Value *Offset = llvm::ConstantInt::get(CGF.Int32Ty, neededSSE * 16); in EmitVAArg()
3534 CGF.Builder.CreateStore(CGF.Builder.CreateAdd(fp_offset, Offset), in EmitVAArg()
3537 CGF.EmitBranch(ContBlock); in EmitVAArg()
3541 CGF.EmitBlock(InMemBlock); in EmitVAArg()
3542 Address MemAddr = EmitX86_64VAArgFromMemory(CGF, VAListAddr, Ty); in EmitVAArg()
3546 CGF.EmitBlock(ContBlock); in EmitVAArg()
3547 Address ResAddr = emitMergePHI(CGF, RegAddr, InRegBlock, MemAddr, InMemBlock, in EmitVAArg()
3552 Address X86_64ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitMSVAArg() argument
3554 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*indirect*/ false, in EmitMSVAArg()
3555 CGF.getContext().getTypeInfoInChars(Ty), in EmitMSVAArg()
3650 Address WinX86_64ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
3652 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*indirect*/ false, in EmitVAArg()
3653 CGF.getContext().getTypeInfoInChars(Ty), in EmitVAArg()
3667 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
3681 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
3689 Address PPC32_SVR4_ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAList, in EmitVAArg() argument
3715 CGBuilderTy &Builder = CGF.Builder; in EmitVAArg()
3736 llvm::BasicBlock *UsingRegs = CGF.createBasicBlock("using_regs"); in EmitVAArg()
3737 llvm::BasicBlock *UsingOverflow = CGF.createBasicBlock("using_overflow"); in EmitVAArg()
3738 llvm::BasicBlock *Cont = CGF.createBasicBlock("cont"); in EmitVAArg()
3742 llvm::Type *DirectTy = CGF.ConvertType(Ty); in EmitVAArg()
3748 CGF.EmitBlock(UsingRegs); in EmitVAArg()
3754 assert(RegAddr.getElementType() == CGF.Int8Ty); in EmitVAArg()
3767 RegAddr = Address(Builder.CreateInBoundsGEP(CGF.Int8Ty, in EmitVAArg()
3778 CGF.EmitBranch(Cont); in EmitVAArg()
3784 CGF.EmitBlock(UsingOverflow); in EmitVAArg()
3793 auto TypeInfo = CGF.getContext().getTypeInfoInChars(Ty); in EmitVAArg()
3796 Size = CGF.getPointerSize(); in EmitVAArg()
3804 CharUnits Align = CGF.getContext().getTypeAlignInChars(Ty); in EmitVAArg()
3807 OverflowArea = Address(emitRoundPointerUpToAlignment(CGF, Ptr, Align), in EmitVAArg()
3816 CGF.EmitBranch(Cont); in EmitVAArg()
3819 CGF.EmitBlock(Cont); in EmitVAArg()
3822 Address Result = emitMergePHI(CGF, RegAddr, UsingRegs, MemAddr, UsingOverflow, in EmitVAArg()
3835 PPC32TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, in initDwarfEHRegSizeTable() argument
3840 CodeGen::CGBuilderTy &Builder = CGF.Builder; in initDwarfEHRegSizeTable()
3842 llvm::IntegerType *i8 = CGF.Int8Ty; in initDwarfEHRegSizeTable()
3961 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
3977 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
3990 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
4336 Address PPC64_SVR4_ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
4352 Address Addr = emitVoidPtrDirectVAArg(CGF, VAListAddr, CGF.Int8Ty, in EmitVAArg()
4358 if (CGF.CGM.getDataLayout().isBigEndian()) { in EmitVAArg()
4359 RealAddr = CGF.Builder.CreateConstInBoundsByteGEP(RealAddr, in EmitVAArg()
4361 ImagAddr = CGF.Builder.CreateConstInBoundsByteGEP(ImagAddr, in EmitVAArg()
4364 ImagAddr = CGF.Builder.CreateConstInBoundsByteGEP(RealAddr, SlotSize); in EmitVAArg()
4367 llvm::Type *EltTy = CGF.ConvertTypeForMem(CTy->getElementType()); in EmitVAArg()
4368 RealAddr = CGF.Builder.CreateElementBitCast(RealAddr, EltTy); in EmitVAArg()
4369 ImagAddr = CGF.Builder.CreateElementBitCast(ImagAddr, EltTy); in EmitVAArg()
4370 llvm::Value *Real = CGF.Builder.CreateLoad(RealAddr, ".vareal"); in EmitVAArg()
4371 llvm::Value *Imag = CGF.Builder.CreateLoad(ImagAddr, ".vaimag"); in EmitVAArg()
4373 Address Temp = CGF.CreateMemTemp(Ty, "vacplx"); in EmitVAArg()
4374 CGF.EmitStoreOfComplex({Real, Imag}, CGF.MakeAddrLValue(Temp, Ty), in EmitVAArg()
4381 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*Indirect*/ false, in EmitVAArg()
4386 PPC64_initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, in PPC64_initDwarfEHRegSizeTable() argument
4391 CodeGen::CGBuilderTy &Builder = CGF.Builder; in PPC64_initDwarfEHRegSizeTable()
4393 llvm::IntegerType *i8 = CGF.Int8Ty; in PPC64_initDwarfEHRegSizeTable()
4428 CodeGen::CodeGenFunction &CGF, in initDwarfEHRegSizeTable() argument
4431 return PPC64_initDwarfEHRegSizeTable(CGF, Address); in initDwarfEHRegSizeTable()
4435 PPC64TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, in initDwarfEHRegSizeTable() argument
4438 return PPC64_initDwarfEHRegSizeTable(CGF, Address); in initDwarfEHRegSizeTable()
4482 CodeGenFunction &CGF) const;
4485 CodeGenFunction &CGF) const;
4487 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
4489 return isDarwinPCS() ? EmitDarwinVAArg(VAListAddr, Ty, CGF) in EmitVAArg()
4490 : EmitAAPCSVAArg(VAListAddr, Ty, CGF); in EmitVAArg()
4689 CodeGenFunction &CGF) const { in EmitAAPCSVAArg()
4693 llvm::Type *BaseTy = CGF.ConvertType(Ty); in EmitAAPCSVAArg()
4717 llvm::BasicBlock *MaybeRegBlock = CGF.createBasicBlock("vaarg.maybe_reg"); in EmitAAPCSVAArg()
4718 llvm::BasicBlock *InRegBlock = CGF.createBasicBlock("vaarg.in_reg"); in EmitAAPCSVAArg()
4719 llvm::BasicBlock *OnStackBlock = CGF.createBasicBlock("vaarg.on_stack"); in EmitAAPCSVAArg()
4720 llvm::BasicBlock *ContBlock = CGF.createBasicBlock("vaarg.end"); in EmitAAPCSVAArg()
4733 CGF.Builder.CreateStructGEP(VAListAddr, 3, CharUnits::fromQuantity(24), in EmitAAPCSVAArg()
4735 reg_offs = CGF.Builder.CreateLoad(reg_offs_p, "gr_offs"); in EmitAAPCSVAArg()
4742 CGF.Builder.CreateStructGEP(VAListAddr, 4, CharUnits::fromQuantity(28), in EmitAAPCSVAArg()
4744 reg_offs = CGF.Builder.CreateLoad(reg_offs_p, "vr_offs"); in EmitAAPCSVAArg()
4759 UsingStack = CGF.Builder.CreateICmpSGE( in EmitAAPCSVAArg()
4760 reg_offs, llvm::ConstantInt::get(CGF.Int32Ty, 0)); in EmitAAPCSVAArg()
4762 CGF.Builder.CreateCondBr(UsingStack, OnStackBlock, MaybeRegBlock); in EmitAAPCSVAArg()
4766 CGF.EmitBlock(MaybeRegBlock); in EmitAAPCSVAArg()
4774 reg_offs = CGF.Builder.CreateAdd( in EmitAAPCSVAArg()
4775 reg_offs, llvm::ConstantInt::get(CGF.Int32Ty, Align - 1), in EmitAAPCSVAArg()
4777 reg_offs = CGF.Builder.CreateAnd( in EmitAAPCSVAArg()
4778 reg_offs, llvm::ConstantInt::get(CGF.Int32Ty, -Align), in EmitAAPCSVAArg()
4787 NewOffset = CGF.Builder.CreateAdd( in EmitAAPCSVAArg()
4788 reg_offs, llvm::ConstantInt::get(CGF.Int32Ty, RegSize), "new_reg_offs"); in EmitAAPCSVAArg()
4789 CGF.Builder.CreateStore(NewOffset, reg_offs_p); in EmitAAPCSVAArg()
4794 InRegs = CGF.Builder.CreateICmpSLE( in EmitAAPCSVAArg()
4795 NewOffset, llvm::ConstantInt::get(CGF.Int32Ty, 0), "inreg"); in EmitAAPCSVAArg()
4797 CGF.Builder.CreateCondBr(InRegs, InRegBlock, OnStackBlock); in EmitAAPCSVAArg()
4805 CGF.EmitBlock(InRegBlock); in EmitAAPCSVAArg()
4808 Address reg_top_p = CGF.Builder.CreateStructGEP(VAListAddr, reg_top_index, in EmitAAPCSVAArg()
4810 reg_top = CGF.Builder.CreateLoad(reg_top_p, "reg_top"); in EmitAAPCSVAArg()
4811 Address BaseAddr(CGF.Builder.CreateInBoundsGEP(reg_top, reg_offs), in EmitAAPCSVAArg()
4814 llvm::Type *MemTy = CGF.ConvertTypeForMem(Ty); in EmitAAPCSVAArg()
4832 llvm::Type *BaseTy = CGF.ConvertType(QualType(Base, 0)); in EmitAAPCSVAArg()
4834 Address Tmp = CGF.CreateTempAlloca(HFATy, in EmitAAPCSVAArg()
4839 if (CGF.CGM.getDataLayout().isBigEndian() && in EmitAAPCSVAArg()
4846 CGF.Builder.CreateConstInBoundsByteGEP(BaseAddr, BaseOffset); in EmitAAPCSVAArg()
4847 LoadAddr = CGF.Builder.CreateElementBitCast(LoadAddr, BaseTy); in EmitAAPCSVAArg()
4850 CGF.Builder.CreateConstArrayGEP(Tmp, i, BaseTyInfo.first); in EmitAAPCSVAArg()
4852 llvm::Value *Elem = CGF.Builder.CreateLoad(LoadAddr); in EmitAAPCSVAArg()
4853 CGF.Builder.CreateStore(Elem, StoreAddr); in EmitAAPCSVAArg()
4856 RegAddr = CGF.Builder.CreateElementBitCast(Tmp, MemTy); in EmitAAPCSVAArg()
4862 if (CGF.CGM.getDataLayout().isBigEndian() && !IsIndirect && in EmitAAPCSVAArg()
4866 BaseAddr = CGF.Builder.CreateConstInBoundsByteGEP(BaseAddr, Offset); in EmitAAPCSVAArg()
4869 RegAddr = CGF.Builder.CreateElementBitCast(BaseAddr, MemTy); in EmitAAPCSVAArg()
4872 CGF.EmitBranch(ContBlock); in EmitAAPCSVAArg()
4877 CGF.EmitBlock(OnStackBlock); in EmitAAPCSVAArg()
4879 Address stack_p = CGF.Builder.CreateStructGEP(VAListAddr, 0, in EmitAAPCSVAArg()
4881 llvm::Value *OnStackPtr = CGF.Builder.CreateLoad(stack_p, "stack"); in EmitAAPCSVAArg()
4888 OnStackPtr = CGF.Builder.CreatePtrToInt(OnStackPtr, CGF.Int64Ty); in EmitAAPCSVAArg()
4890 OnStackPtr = CGF.Builder.CreateAdd( in EmitAAPCSVAArg()
4891 OnStackPtr, llvm::ConstantInt::get(CGF.Int64Ty, Align - 1), in EmitAAPCSVAArg()
4893 OnStackPtr = CGF.Builder.CreateAnd( in EmitAAPCSVAArg()
4894 OnStackPtr, llvm::ConstantInt::get(CGF.Int64Ty, -Align), in EmitAAPCSVAArg()
4897 OnStackPtr = CGF.Builder.CreateIntToPtr(OnStackPtr, CGF.Int8PtrTy); in EmitAAPCSVAArg()
4910 llvm::Value *StackSizeC = CGF.Builder.getSize(StackSize); in EmitAAPCSVAArg()
4912 CGF.Builder.CreateInBoundsGEP(OnStackPtr, StackSizeC, "new_stack"); in EmitAAPCSVAArg()
4915 CGF.Builder.CreateStore(NewStack, stack_p); in EmitAAPCSVAArg()
4917 if (CGF.CGM.getDataLayout().isBigEndian() && !isAggregateTypeForABI(Ty) && in EmitAAPCSVAArg()
4920 OnStackAddr = CGF.Builder.CreateConstInBoundsByteGEP(OnStackAddr, Offset); in EmitAAPCSVAArg()
4923 OnStackAddr = CGF.Builder.CreateElementBitCast(OnStackAddr, MemTy); in EmitAAPCSVAArg()
4925 CGF.EmitBranch(ContBlock); in EmitAAPCSVAArg()
4930 CGF.EmitBlock(ContBlock); in EmitAAPCSVAArg()
4932 Address ResAddr = emitMergePHI(CGF, RegAddr, InRegBlock, in EmitAAPCSVAArg()
4936 return Address(CGF.Builder.CreateLoad(ResAddr, "vaarg.addr"), in EmitAAPCSVAArg()
4943 CodeGenFunction &CGF) const { in EmitDarwinVAArg()
4948 return EmitVAArgInstr(CGF, VAListAddr, Ty, ABIArgInfo::getDirect()); in EmitDarwinVAArg()
4954 Address Addr(CGF.Builder.CreateLoad(VAListAddr, "ap.cur"), SlotSize); in EmitDarwinVAArg()
4955 Addr = CGF.Builder.CreateElementBitCast(Addr, CGF.ConvertTypeForMem(Ty)); in EmitDarwinVAArg()
4972 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, IsIndirect, in EmitDarwinVAArg()
5039 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
5070 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, in initDwarfEHRegSizeTable() argument
5072 llvm::Value *Four8 = llvm::ConstantInt::get(CGF.Int8Ty, 4); in initDwarfEHRegSizeTable()
5075 AssignToArrayRange(CGF.Builder, Address, Four8, 0, 15); in initDwarfEHRegSizeTable()
5587 Address ARMABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
5593 Address Addr(CGF.Builder.CreateLoad(VAListAddr), SlotSize); in EmitVAArg()
5594 Addr = CGF.Builder.CreateElementBitCast(Addr, CGF.ConvertTypeForMem(Ty)); in EmitVAArg()
5632 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, IsIndirect, TyInfo, in EmitVAArg()
5650 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
5709 Address NVPTXABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
5811 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
5919 Address SystemZABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
5934 llvm::Type *ArgTy = CGF.ConvertTypeForMem(Ty); in EmitVAArg()
5960 llvm::Type *IndexTy = CGF.Int64Ty; in EmitVAArg()
5969 CGF.Builder.CreateStructGEP(VAListAddr, 2, CharUnits::fromQuantity(16), in EmitVAArg()
5972 Address(CGF.Builder.CreateLoad(OverflowArgAreaPtr, "overflow_arg_area"), in EmitVAArg()
5975 CGF.Builder.CreateElementBitCast(OverflowArgArea, DirectTy, "mem_addr"); in EmitVAArg()
5979 CGF.Builder.CreateGEP(OverflowArgArea.getPointer(), PaddedSizeV, in EmitVAArg()
5981 CGF.Builder.CreateStore(NewOverflowArgArea, OverflowArgAreaPtr); in EmitVAArg()
6002 Address RegCountPtr = CGF.Builder.CreateStructGEP( in EmitVAArg()
6005 llvm::Value *RegCount = CGF.Builder.CreateLoad(RegCountPtr, "reg_count"); in EmitVAArg()
6007 llvm::Value *InRegs = CGF.Builder.CreateICmpULT(RegCount, MaxRegsV, in EmitVAArg()
6010 llvm::BasicBlock *InRegBlock = CGF.createBasicBlock("vaarg.in_reg"); in EmitVAArg()
6011 llvm::BasicBlock *InMemBlock = CGF.createBasicBlock("vaarg.in_mem"); in EmitVAArg()
6012 llvm::BasicBlock *ContBlock = CGF.createBasicBlock("vaarg.end"); in EmitVAArg()
6013 CGF.Builder.CreateCondBr(InRegs, InRegBlock, InMemBlock); in EmitVAArg()
6016 CGF.EmitBlock(InRegBlock); in EmitVAArg()
6020 CGF.Builder.CreateMul(RegCount, PaddedSizeV, "scaled_reg_count"); in EmitVAArg()
6025 CGF.Builder.CreateAdd(ScaledRegCount, RegBase, "reg_offset"); in EmitVAArg()
6027 CGF.Builder.CreateStructGEP(VAListAddr, 3, CharUnits::fromQuantity(24), in EmitVAArg()
6030 CGF.Builder.CreateLoad(RegSaveAreaPtr, "reg_save_area"); in EmitVAArg()
6031 Address RawRegAddr(CGF.Builder.CreateGEP(RegSaveArea, RegOffset, in EmitVAArg()
6035 CGF.Builder.CreateElementBitCast(RawRegAddr, DirectTy, "reg_addr"); in EmitVAArg()
6040 CGF.Builder.CreateAdd(RegCount, One, "reg_count"); in EmitVAArg()
6041 CGF.Builder.CreateStore(NewRegCount, RegCountPtr); in EmitVAArg()
6042 CGF.EmitBranch(ContBlock); in EmitVAArg()
6045 CGF.EmitBlock(InMemBlock); in EmitVAArg()
6048 Address OverflowArgAreaPtr = CGF.Builder.CreateStructGEP( in EmitVAArg()
6051 Address(CGF.Builder.CreateLoad(OverflowArgAreaPtr, "overflow_arg_area"), in EmitVAArg()
6054 CGF.Builder.CreateConstByteGEP(OverflowArgArea, Padding, "raw_mem_addr"); in EmitVAArg()
6056 CGF.Builder.CreateElementBitCast(RawMemAddr, DirectTy, "mem_addr"); in EmitVAArg()
6060 CGF.Builder.CreateGEP(OverflowArgArea.getPointer(), PaddedSizeV, in EmitVAArg()
6062 CGF.Builder.CreateStore(NewOverflowArgArea, OverflowArgAreaPtr); in EmitVAArg()
6063 CGF.EmitBranch(ContBlock); in EmitVAArg()
6066 CGF.EmitBlock(ContBlock); in EmitVAArg()
6067 Address ResAddr = emitMergePHI(CGF, RegAddr, InRegBlock, in EmitVAArg()
6071 ResAddr = Address(CGF.Builder.CreateLoad(ResAddr, "indirect_arg"), in EmitVAArg()
6198 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
6247 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
6475 Address MipsABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
6502 Address Addr = emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*indirect*/ false, in EmitVAArg()
6509 Address Temp = CGF.CreateMemTemp(OrigTy, "vaarg.promotion-temp"); in EmitVAArg()
6510 llvm::Value *Promoted = CGF.Builder.CreateLoad(Addr); in EmitVAArg()
6514 : CGF.IntPtrTy); in EmitVAArg()
6515 llvm::Value *V = CGF.Builder.CreateTrunc(Promoted, IntTy); in EmitVAArg()
6517 V = CGF.Builder.CreateIntToPtr(V, Temp.getElementType()); in EmitVAArg()
6519 CGF.Builder.CreateStore(V, Temp); in EmitVAArg()
6537 MIPSTargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, in initDwarfEHRegSizeTable() argument
6544 llvm::Value *Four8 = llvm::ConstantInt::get(CGF.Int8Ty, 4); in initDwarfEHRegSizeTable()
6550 AssignToArrayRange(CGF.Builder, Address, Four8, 0, 65); in initDwarfEHRegSizeTable()
6560 AssignToArrayRange(CGF.Builder, Address, Four8, 80, 181); in initDwarfEHRegSizeTable()
6645 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
6736 Address HexagonABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
6739 return emitVoidPtrVAArg(CGF, VAListAddr, Ty, /*indirect*/ false, in EmitVAArg()
6993 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
7152 Address SparcV9ABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
7161 CGBuilderTy &Builder = CGF.Builder; in EmitVAArg()
7224 bool initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF,
7230 SparcV9TargetCodeGenInfo::initDwarfEHRegSizeTable(CodeGen::CodeGenFunction &CGF, in initDwarfEHRegSizeTable() argument
7235 CodeGen::CGBuilderTy &Builder = CGF.Builder; in initDwarfEHRegSizeTable()
7237 llvm::IntegerType *i8 = CGF.Int8Ty; in initDwarfEHRegSizeTable()
7365 Address EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
7382 Address XCoreABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, in EmitVAArg() argument
7384 CGBuilderTy &Builder = CGF.Builder; in EmitVAArg()