Skip to content

Commit bc296d9

Browse files
committed
update codegen
1 parent 5ceb717 commit bc296d9

File tree

5 files changed

+13
-79
lines changed

5 files changed

+13
-79
lines changed

clang/lib/CodeGen/Targets/AArch64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ AArch64ABIInfo::classifyArgumentType(QualType Ty, bool IsVariadic,
304304
return getNaturalAlignIndirect(Ty, false);
305305

306306
return (isPromotableIntegerTypeForABI(Ty) && isDarwinPCS()
307-
? ABIArgInfo::getExtend(Ty)
307+
? ABIArgInfo::getExtend(Ty, CGT.ConvertType(Ty))
308308
: ABIArgInfo::getDirect());
309309
}
310310

clang/lib/CodeGen/Targets/ARM.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,9 @@ ABIArgInfo ARMABIInfo::classifyArgumentType(QualType Ty, bool isVariadic,
354354
if (EIT->getNumBits() > 64)
355355
return getNaturalAlignIndirect(Ty, /*ByVal=*/true);
356356

357-
return (isPromotableIntegerTypeForABI(Ty) ? ABIArgInfo::getExtend(Ty)
358-
: ABIArgInfo::getDirect());
357+
return (isPromotableIntegerTypeForABI(Ty)
358+
? ABIArgInfo::getExtend(Ty, CGT.ConvertType(Ty))
359+
: ABIArgInfo::getDirect());
359360
}
360361

361362
if (CGCXXABI::RecordArgABI RAA = getRecordArgABI(Ty, getCXXABI())) {

clang/lib/CodeGen/Targets/RISCV.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class RISCVABIInfo : public DefaultABIInfo {
5151
RValue EmitVAArg(CodeGenFunction &CGF, Address VAListAddr, QualType Ty,
5252
AggValueSlot Slot) const override;
5353

54-
ABIArgInfo extendType(QualType Ty) const;
54+
ABIArgInfo extendType(QualType Ty, llvm::Type *CoerceTy = nullptr) const;
5555

5656
bool detectFPCCEligibleStruct(QualType Ty, llvm::Type *&Field1Ty,
5757
CharUnits &Field1Off, llvm::Type *&Field2Ty,
@@ -439,12 +439,12 @@ ABIArgInfo RISCVABIInfo::classifyArgumentType(QualType Ty, bool IsFixed,
439439

440440
// All integral types are promoted to XLen width
441441
if (Size < XLen && Ty->isIntegralOrEnumerationType()) {
442-
return extendType(Ty);
442+
return extendType(Ty, CGT.ConvertType(Ty));
443443
}
444444

445445
if (const auto *EIT = Ty->getAs<BitIntType>()) {
446446
if (EIT->getNumBits() < XLen)
447-
return extendType(Ty);
447+
return extendType(Ty, CGT.ConvertType(Ty));
448448
if (EIT->getNumBits() > 128 ||
449449
(!getContext().getTargetInfo().hasInt128Type() &&
450450
EIT->getNumBits() > 64))
@@ -526,12 +526,12 @@ RValue RISCVABIInfo::EmitVAArg(CodeGenFunction &CGF, Address VAListAddr,
526526
/*AllowHigherAlign=*/true, Slot);
527527
}
528528

529-
ABIArgInfo RISCVABIInfo::extendType(QualType Ty) const {
529+
ABIArgInfo RISCVABIInfo::extendType(QualType Ty, llvm::Type *CoerceTy) const {
530530
int TySize = getContext().getTypeSize(Ty);
531531
// RV64 ABI requires unsigned 32 bit integers to be sign extended.
532532
if (XLen == 64 && Ty->isUnsignedIntegerOrEnumerationType() && TySize == 32)
533-
return ABIArgInfo::getSignExtend(Ty);
534-
return ABIArgInfo::getExtend(Ty);
533+
return ABIArgInfo::getSignExtend(Ty, CoerceTy);
534+
return ABIArgInfo::getExtend(Ty, CoerceTy);
535535
}
536536

537537
namespace {

clang/lib/CodeGen/Targets/X86.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,8 +881,8 @@ ABIArgInfo X86_32ABIInfo::classifyArgumentType(QualType Ty, CCState &State,
881881

882882
if (isPromotableIntegerTypeForABI(Ty)) {
883883
if (InReg)
884-
return ABIArgInfo::getExtendInReg(Ty);
885-
return ABIArgInfo::getExtend(Ty);
884+
return ABIArgInfo::getExtendInReg(Ty, CGT.ConvertType(Ty));
885+
return ABIArgInfo::getExtend(Ty, CGT.ConvertType(Ty));
886886
}
887887

888888
if (const auto *EIT = Ty->getAs<BitIntType>()) {
@@ -2756,7 +2756,7 @@ X86_64ABIInfo::classifyArgumentType(QualType Ty, unsigned freeIntRegs,
27562756

27572757
if (Ty->isIntegralOrEnumerationType() &&
27582758
isPromotableIntegerTypeForABI(Ty))
2759-
return ABIArgInfo::getExtend(Ty);
2759+
return ABIArgInfo::getExtend(Ty, CGT.ConvertType(Ty));
27602760
}
27612761

27622762
break;

clang/test/CodeGen/PowerPC/transparent_union.c

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)