Lines Matching refs:CGM

22 static const SwiftABIInfo &getSwiftABIInfo(CodeGenModule &CGM) {  in getSwiftABIInfo()  argument
23 return cast<SwiftABIInfo>(CGM.getTargetCodeGenInfo().getABIInfo()); in getSwiftABIInfo()
55 static CharUnits getTypeStoreSize(CodeGenModule &CGM, llvm::Type *type) { in getTypeStoreSize() argument
56 return CharUnits::fromQuantity(CGM.getDataLayout().getTypeStoreSize(type)); in getTypeStoreSize()
59 static CharUnits getTypeAllocSize(CodeGenModule &CGM, llvm::Type *type) { in getTypeAllocSize() argument
60 return CharUnits::fromQuantity(CGM.getDataLayout().getTypeAllocSize(type)); in getTypeAllocSize()
74 auto arrayType = CGM.getContext().getAsConstantArrayType(type); in addTypedData()
78 auto eltSize = CGM.getContext().getTypeSizeInChars(eltType); in addTypedData()
86 auto eltSize = CGM.getContext().getTypeSizeInChars(eltType); in addTypedData()
87 auto eltLLVMType = CGM.getTypes().ConvertType(eltType); in addTypedData()
94 addOpaqueData(begin, begin + CGM.getContext().getTypeSizeInChars(type)); in addTypedData()
99 auto atomicSize = CGM.getContext().getTypeSizeInChars(atomicType); in addTypedData()
100 auto valueSize = CGM.getContext().getTypeSizeInChars(valueType); in addTypedData()
113 auto *llvmType = CGM.getTypes().ConvertType(type); in addTypedData()
119 addTypedData(record, begin, CGM.getContext().getASTRecordLayout(record)); in addTypedData()
145 addTypedData(CGM.Int8PtrTy, begin); in addTypedData()
158 addTypedData(CGM.Int8PtrTy, begin + layout.getVBPtrOffset()); in addTypedData()
169 begin + CGM.getContext().toCharUnitsFromBits(fieldOffsetInBits)); in addTypedData()
187 auto &ctx = CGM.getContext(); in addBitFieldData()
208 addTypedData(type, begin, begin + getTypeStoreSize(CGM, type)); in addTypedData()
214 assert(getTypeStoreSize(CGM, type) == end - begin); in addTypedData()
219 legalizeVectorType(CGM, end - begin, vecTy, componentTys); in addTypedData()
225 auto componentSize = getTypeStoreSize(CGM, componentTy); in addTypedData()
236 if (!isLegalIntegerType(CGM, intTy)) in addTypedData()
247 if (!begin.isZero() && !begin.isMultipleOf(getNaturalAlignment(CGM, type))) { in addLegalTypedData()
251 auto split = splitLegalVectorType(CGM, end - begin, vecTy); in addLegalTypedData()
256 assert(eltSize == getTypeStoreSize(CGM, eltTy)); in addLegalTypedData()
276 assert(!type || begin.isMultipleOf(getNaturalAlignment(CGM, type))); in addEntry()
338 assert(eltSize == getTypeStoreSize(CGM, eltTy)); in addEntry()
401 auto split = splitLegalVectorType(CGM, Entries[index].getWidth(), vecTy); in splitVectorEntry()
404 CharUnits eltSize = getTypeStoreSize(CGM, eltTy); in splitVectorEntry()
475 const CharUnits chunkSize = getMaximumVoluntaryIntegerSize(CGM); in finish()
545 llvm::IntegerType::get(CGM.getLLVMContext(), in finish()
546 CGM.getContext().toBits(unitSize)); in finish()
570 auto &ctx = CGM.getLLVMContext(); in getCoerceAndExpandTypes()
594 CGM.getDataLayout().getABITypeAlignment(entry.Type)))) in getCoerceAndExpandTypes()
599 lastEnd = entry.Begin + getTypeAllocSize(CGM, entry.Type); in getCoerceAndExpandTypes()
633 return getSwiftABIInfo(CGM).shouldPassIndirectlyForSwift( in shouldPassIndirectly()
643 return getSwiftABIInfo(CGM).shouldPassIndirectlyForSwift(componentTys, in shouldPassIndirectly()
647 bool swiftcall::shouldPassIndirectly(CodeGenModule &CGM, in shouldPassIndirectly() argument
650 return getSwiftABIInfo(CGM).shouldPassIndirectlyForSwift(componentTys, in shouldPassIndirectly()
654 CharUnits swiftcall::getMaximumVoluntaryIntegerSize(CodeGenModule &CGM) { in getMaximumVoluntaryIntegerSize() argument
656 return CGM.getContext().toCharUnitsFromBits( in getMaximumVoluntaryIntegerSize()
657 CGM.getContext().getTargetInfo().getPointerWidth(0)); in getMaximumVoluntaryIntegerSize()
660 CharUnits swiftcall::getNaturalAlignment(CodeGenModule &CGM, llvm::Type *type) { in getNaturalAlignment() argument
663 auto size = (unsigned long long) getTypeStoreSize(CGM, type).getQuantity(); in getNaturalAlignment()
667 assert(size >= CGM.getDataLayout().getABITypeAlignment(type)); in getNaturalAlignment()
671 bool swiftcall::isLegalIntegerType(CodeGenModule &CGM, in isLegalIntegerType() argument
684 return CGM.getContext().getTargetInfo().hasInt128Type(); in isLegalIntegerType()
691 bool swiftcall::isLegalVectorType(CodeGenModule &CGM, CharUnits vectorSize, in isLegalVectorType() argument
694 CGM, vectorSize, vectorTy->getElementType(), in isLegalVectorType()
698 bool swiftcall::isLegalVectorType(CodeGenModule &CGM, CharUnits vectorSize, in isLegalVectorType() argument
701 return getSwiftABIInfo(CGM) in isLegalVectorType()
706 swiftcall::splitLegalVectorType(CodeGenModule &CGM, CharUnits vectorSize, in splitLegalVectorType() argument
713 if (isLegalVectorType(CGM, vectorSize / 2, eltTy, numElts / 2)) in splitLegalVectorType()
720 void swiftcall::legalizeVectorType(CodeGenModule &CGM, CharUnits origVectorSize, in legalizeVectorType() argument
724 if (isLegalVectorType(CGM, origVectorSize, origVectorTy)) { in legalizeVectorType()
758 if (!isLegalVectorType(CGM, candidateSize, eltTy, candidateNumElts)) { in legalizeVectorType()
777 isLegalVectorType(CGM, eltSize * numElts, eltTy, numElts)) { in legalizeVectorType()
794 bool swiftcall::mustPassRecordIndirectly(CodeGenModule &CGM, in mustPassRecordIndirectly() argument
815 static ABIArgInfo classifyType(CodeGenModule &CGM, CanQualType type, in classifyType() argument
819 auto &layout = CGM.getContext().getASTRecordLayout(record); in classifyType()
821 if (mustPassRecordIndirectly(CGM, record)) in classifyType()
824 SwiftAggLowering lowering(CGM); in classifyType()
839 SwiftAggLowering lowering(CGM); in classifyType()
843 CharUnits alignment = CGM.getContext().getTypeAlignInChars(type); in classifyType()
860 ABIArgInfo swiftcall::classifyReturnType(CodeGenModule &CGM, CanQualType type) { in classifyReturnType() argument
861 return classifyType(CGM, type, /*forReturn*/ true); in classifyReturnType()
864 ABIArgInfo swiftcall::classifyArgumentType(CodeGenModule &CGM, in classifyArgumentType() argument
866 return classifyType(CGM, type, /*forReturn*/ false); in classifyArgumentType()
869 void swiftcall::computeABIInfo(CodeGenModule &CGM, CGFunctionInfo &FI) { in computeABIInfo() argument
871 retInfo = classifyReturnType(CGM, FI.getReturnType()); in computeABIInfo()
875 argInfo.info = classifyArgumentType(CGM, argInfo.type); in computeABIInfo()
880 bool swiftcall::isSwiftErrorLoweredInRegister(CodeGenModule &CGM) { in isSwiftErrorLoweredInRegister() argument
881 return getSwiftABIInfo(CGM).isSwiftErrorInRegister(); in isSwiftErrorLoweredInRegister()