Lines Matching refs:CGM
23 static const SwiftABIInfo &getSwiftABIInfo(CodeGenModule &CGM) { in getSwiftABIInfo() argument
24 return cast<SwiftABIInfo>(CGM.getTargetCodeGenInfo().getABIInfo()); in getSwiftABIInfo()
56 static CharUnits getTypeStoreSize(CodeGenModule &CGM, llvm::Type *type) { in getTypeStoreSize() argument
57 return CharUnits::fromQuantity(CGM.getDataLayout().getTypeStoreSize(type)); in getTypeStoreSize()
71 auto arrayType = CGM.getContext().getAsConstantArrayType(type); in addTypedData()
75 auto eltSize = CGM.getContext().getTypeSizeInChars(eltType); in addTypedData()
83 auto eltSize = CGM.getContext().getTypeSizeInChars(eltType); in addTypedData()
84 auto eltLLVMType = CGM.getTypes().ConvertType(eltType); in addTypedData()
91 addOpaqueData(begin, begin + CGM.getContext().getTypeSizeInChars(type)); in addTypedData()
97 auto llvmType = CGM.getTypes().ConvertType(type); in addTypedData()
103 addTypedData(record, begin, CGM.getContext().getASTRecordLayout(record)); in addTypedData()
129 addTypedData(CGM.Int8PtrTy, begin); in addTypedData()
142 addTypedData(CGM.Int8PtrTy, begin + layout.getVBPtrOffset()); in addTypedData()
153 begin + CGM.getContext().toCharUnitsFromBits(fieldOffsetInBits)); in addTypedData()
171 auto &ctx = CGM.getContext(); in addBitFieldData()
192 addTypedData(type, begin, begin + getTypeStoreSize(CGM, type)); in addTypedData()
198 assert(getTypeStoreSize(CGM, type) == end - begin); in addTypedData()
203 legalizeVectorType(CGM, end - begin, vecTy, componentTys); in addTypedData()
209 auto componentSize = getTypeStoreSize(CGM, componentTy); in addTypedData()
220 if (!isLegalIntegerType(CGM, intTy)) in addTypedData()
231 if (!begin.isZero() && !begin.isMultipleOf(getNaturalAlignment(CGM, type))) { in addLegalTypedData()
235 auto split = splitLegalVectorType(CGM, end - begin, vecTy); in addLegalTypedData()
240 assert(eltSize == getTypeStoreSize(CGM, eltTy)); in addLegalTypedData()
260 assert(!type || begin.isMultipleOf(getNaturalAlignment(CGM, type))); in addEntry()
321 assert(eltSize == getTypeStoreSize(CGM, eltTy)); in addEntry()
382 auto split = splitLegalVectorType(CGM, Entries[index].getWidth(), vecTy); in splitVectorEntry()
385 CharUnits eltSize = getTypeStoreSize(CGM, eltTy); in splitVectorEntry()
422 const CharUnits chunkSize = getMaximumVoluntaryIntegerSize(CGM); in finish()
492 llvm::IntegerType::get(CGM.getLLVMContext(), in finish()
493 CGM.getContext().toBits(unitSize)); in finish()
517 auto &ctx = CGM.getLLVMContext(); in getCoerceAndExpandTypes()
541 CGM.getDataLayout().getABITypeAlignment(entry.Type)))) in getCoerceAndExpandTypes()
580 return getSwiftABIInfo(CGM).shouldPassIndirectlyForSwift(totalSize, in shouldPassIndirectly()
590 return getSwiftABIInfo(CGM).shouldPassIndirectlyForSwift(totalSize, in shouldPassIndirectly()
595 CharUnits swiftcall::getMaximumVoluntaryIntegerSize(CodeGenModule &CGM) { in getMaximumVoluntaryIntegerSize() argument
597 return CGM.getContext().toCharUnitsFromBits( in getMaximumVoluntaryIntegerSize()
598 CGM.getContext().getTargetInfo().getPointerWidth(0)); in getMaximumVoluntaryIntegerSize()
601 CharUnits swiftcall::getNaturalAlignment(CodeGenModule &CGM, llvm::Type *type) { in getNaturalAlignment() argument
604 auto size = (unsigned long long) getTypeStoreSize(CGM, type).getQuantity(); in getNaturalAlignment()
608 assert(size >= CGM.getDataLayout().getABITypeAlignment(type)); in getNaturalAlignment()
612 bool swiftcall::isLegalIntegerType(CodeGenModule &CGM, in isLegalIntegerType() argument
625 return CGM.getContext().getTargetInfo().hasInt128Type(); in isLegalIntegerType()
632 bool swiftcall::isLegalVectorType(CodeGenModule &CGM, CharUnits vectorSize, in isLegalVectorType() argument
634 return isLegalVectorType(CGM, vectorSize, vectorTy->getElementType(), in isLegalVectorType()
638 bool swiftcall::isLegalVectorType(CodeGenModule &CGM, CharUnits vectorSize, in isLegalVectorType() argument
641 return getSwiftABIInfo(CGM) in isLegalVectorType()
646 swiftcall::splitLegalVectorType(CodeGenModule &CGM, CharUnits vectorSize, in splitLegalVectorType() argument
653 if (isLegalVectorType(CGM, vectorSize / 2, eltTy, numElts / 2)) in splitLegalVectorType()
660 void swiftcall::legalizeVectorType(CodeGenModule &CGM, CharUnits origVectorSize, in legalizeVectorType() argument
664 if (isLegalVectorType(CGM, origVectorSize, origVectorTy)) { in legalizeVectorType()
698 if (!isLegalVectorType(CGM, candidateSize, eltTy, candidateNumElts)) { in legalizeVectorType()
716 isLegalVectorType(CGM, eltSize * numElts, eltTy, numElts)) { in legalizeVectorType()
733 bool swiftcall::shouldPassCXXRecordIndirectly(CodeGenModule &CGM, in shouldPassCXXRecordIndirectly() argument
766 static ABIArgInfo classifyType(CodeGenModule &CGM, CanQualType type, in classifyType() argument
770 auto &layout = CGM.getContext().getASTRecordLayout(record); in classifyType()
773 if (shouldPassCXXRecordIndirectly(CGM, cxxRecord)) in classifyType()
777 SwiftAggLowering lowering(CGM); in classifyType()
792 SwiftAggLowering lowering(CGM); in classifyType()
796 CharUnits alignment = CGM.getContext().getTypeAlignInChars(type); in classifyType()
813 ABIArgInfo swiftcall::classifyReturnType(CodeGenModule &CGM, CanQualType type) { in classifyReturnType() argument
814 return classifyType(CGM, type, /*forReturn*/ true); in classifyReturnType()
817 ABIArgInfo swiftcall::classifyArgumentType(CodeGenModule &CGM, in classifyArgumentType() argument
819 return classifyType(CGM, type, /*forReturn*/ false); in classifyArgumentType()
822 void swiftcall::computeABIInfo(CodeGenModule &CGM, CGFunctionInfo &FI) { in computeABIInfo() argument
824 retInfo = classifyReturnType(CGM, FI.getReturnType()); in computeABIInfo()
828 argInfo.info = classifyArgumentType(CGM, argInfo.type); in computeABIInfo()