Lines Matching refs:CGM
24 static const SwiftABIInfo &getSwiftABIInfo(CodeGenModule &CGM) { in getSwiftABIInfo() argument
25 return CGM.getTargetCodeGenInfo().getSwiftABIInfo(); in getSwiftABIInfo()
57 static CharUnits getTypeStoreSize(CodeGenModule &CGM, llvm::Type *type) { in getTypeStoreSize() argument
58 return CharUnits::fromQuantity(CGM.getDataLayout().getTypeStoreSize(type)); in getTypeStoreSize()
61 static CharUnits getTypeAllocSize(CodeGenModule &CGM, llvm::Type *type) { in getTypeAllocSize() argument
62 return CharUnits::fromQuantity(CGM.getDataLayout().getTypeAllocSize(type)); in getTypeAllocSize()
76 auto arrayType = CGM.getContext().getAsConstantArrayType(type); in addTypedData()
80 auto eltSize = CGM.getContext().getTypeSizeInChars(eltType); in addTypedData()
88 auto eltSize = CGM.getContext().getTypeSizeInChars(eltType); in addTypedData()
89 auto eltLLVMType = CGM.getTypes().ConvertType(eltType); in addTypedData()
96 addOpaqueData(begin, begin + CGM.getContext().getTypeSizeInChars(type)); in addTypedData()
101 auto atomicSize = CGM.getContext().getTypeSizeInChars(atomicType); in addTypedData()
102 auto valueSize = CGM.getContext().getTypeSizeInChars(valueType); in addTypedData()
115 auto *llvmType = CGM.getTypes().ConvertType(type); in addTypedData()
121 addTypedData(record, begin, CGM.getContext().getASTRecordLayout(record)); in addTypedData()
147 addTypedData(CGM.Int8PtrTy, begin); in addTypedData()
160 addTypedData(CGM.Int8PtrTy, begin + layout.getVBPtrOffset()); in addTypedData()
171 begin + CGM.getContext().toCharUnitsFromBits(fieldOffsetInBits)); in addTypedData()
189 auto &ctx = CGM.getContext(); in addBitFieldData()
210 addTypedData(type, begin, begin + getTypeStoreSize(CGM, type)); in addTypedData()
216 assert(getTypeStoreSize(CGM, type) == end - begin); in addTypedData()
221 legalizeVectorType(CGM, end - begin, vecTy, componentTys); in addTypedData()
227 auto componentSize = getTypeStoreSize(CGM, componentTy); in addTypedData()
238 if (!isLegalIntegerType(CGM, intTy)) in addTypedData()
249 if (!begin.isZero() && !begin.isMultipleOf(getNaturalAlignment(CGM, type))) { in addLegalTypedData()
253 auto split = splitLegalVectorType(CGM, end - begin, vecTy); in addLegalTypedData()
258 assert(eltSize == getTypeStoreSize(CGM, eltTy)); in addLegalTypedData()
278 assert(!type || begin.isMultipleOf(getNaturalAlignment(CGM, type))); in addEntry()
340 assert(eltSize == getTypeStoreSize(CGM, eltTy)); in addEntry()
403 auto split = splitLegalVectorType(CGM, Entries[index].getWidth(), vecTy); in splitVectorEntry()
406 CharUnits eltSize = getTypeStoreSize(CGM, eltTy); in splitVectorEntry()
478 const CharUnits chunkSize = getMaximumVoluntaryIntegerSize(CGM); in finish()
548 llvm::IntegerType::get(CGM.getLLVMContext(), in finish()
549 CGM.getContext().toBits(unitSize)); in finish()
573 auto &ctx = CGM.getLLVMContext(); in getCoerceAndExpandTypes()
596 CGM.getDataLayout().getABITypeAlign(entry.Type)))) in getCoerceAndExpandTypes()
601 lastEnd = entry.Begin + getTypeAllocSize(CGM, entry.Type); in getCoerceAndExpandTypes()
635 return getSwiftABIInfo(CGM).shouldPassIndirectly(Entries.back().Type, in shouldPassIndirectly()
644 return getSwiftABIInfo(CGM).shouldPassIndirectly(componentTys, asReturnValue); in shouldPassIndirectly()
647 bool swiftcall::shouldPassIndirectly(CodeGenModule &CGM, in shouldPassIndirectly() argument
650 return getSwiftABIInfo(CGM).shouldPassIndirectly(componentTys, asReturnValue); in shouldPassIndirectly()
653 CharUnits swiftcall::getMaximumVoluntaryIntegerSize(CodeGenModule &CGM) { in getMaximumVoluntaryIntegerSize() argument
655 return CGM.getContext().toCharUnitsFromBits( in getMaximumVoluntaryIntegerSize()
656 CGM.getContext().getTargetInfo().getPointerWidth(LangAS::Default)); in getMaximumVoluntaryIntegerSize()
659 CharUnits swiftcall::getNaturalAlignment(CodeGenModule &CGM, llvm::Type *type) { in getNaturalAlignment() argument
662 auto size = (unsigned long long) getTypeStoreSize(CGM, type).getQuantity(); in getNaturalAlignment()
664 assert(CGM.getDataLayout().getABITypeAlign(type) <= size); in getNaturalAlignment()
668 bool swiftcall::isLegalIntegerType(CodeGenModule &CGM, in isLegalIntegerType() argument
681 return CGM.getContext().getTargetInfo().hasInt128Type(); in isLegalIntegerType()
688 bool swiftcall::isLegalVectorType(CodeGenModule &CGM, CharUnits vectorSize, in isLegalVectorType() argument
691 CGM, vectorSize, vectorTy->getElementType(), in isLegalVectorType()
695 bool swiftcall::isLegalVectorType(CodeGenModule &CGM, CharUnits vectorSize, in isLegalVectorType() argument
698 return getSwiftABIInfo(CGM).isLegalVectorType(vectorSize, eltTy, numElts); in isLegalVectorType()
702 swiftcall::splitLegalVectorType(CodeGenModule &CGM, CharUnits vectorSize, in splitLegalVectorType() argument
709 if (isLegalVectorType(CGM, vectorSize / 2, eltTy, numElts / 2)) in splitLegalVectorType()
716 void swiftcall::legalizeVectorType(CodeGenModule &CGM, CharUnits origVectorSize, in legalizeVectorType() argument
720 if (isLegalVectorType(CGM, origVectorSize, origVectorTy)) { in legalizeVectorType()
754 if (!isLegalVectorType(CGM, candidateSize, eltTy, candidateNumElts)) { in legalizeVectorType()
773 isLegalVectorType(CGM, eltSize * numElts, eltTy, numElts)) { in legalizeVectorType()
790 bool swiftcall::mustPassRecordIndirectly(CodeGenModule &CGM, in mustPassRecordIndirectly() argument
811 static ABIArgInfo classifyType(CodeGenModule &CGM, CanQualType type, in classifyType() argument
815 auto &layout = CGM.getContext().getASTRecordLayout(record); in classifyType()
817 if (mustPassRecordIndirectly(CGM, record)) in classifyType()
820 SwiftAggLowering lowering(CGM); in classifyType()
835 SwiftAggLowering lowering(CGM); in classifyType()
839 CharUnits alignment = CGM.getContext().getTypeAlignInChars(type); in classifyType()
856 ABIArgInfo swiftcall::classifyReturnType(CodeGenModule &CGM, CanQualType type) { in classifyReturnType() argument
857 return classifyType(CGM, type, /*forReturn*/ true); in classifyReturnType()
860 ABIArgInfo swiftcall::classifyArgumentType(CodeGenModule &CGM, in classifyArgumentType() argument
862 return classifyType(CGM, type, /*forReturn*/ false); in classifyArgumentType()
865 void swiftcall::computeABIInfo(CodeGenModule &CGM, CGFunctionInfo &FI) { in computeABIInfo() argument
867 retInfo = classifyReturnType(CGM, FI.getReturnType()); in computeABIInfo()
871 argInfo.info = classifyArgumentType(CGM, argInfo.type); in computeABIInfo()
876 bool swiftcall::isSwiftErrorLoweredInRegister(CodeGenModule &CGM) { in isSwiftErrorLoweredInRegister() argument
877 return getSwiftABIInfo(CGM).isSwiftErrorInRegister(); in isSwiftErrorLoweredInRegister()