Home | History | Annotate | Download | only in CodeGen

Lines Matching full:cgf

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