@@ -42,7 +42,7 @@ class MipsABIInfo : public ABIInfo {
4242
4343 ABIArgInfo classifyReturnType (QualType RetTy) const ;
4444 ABIArgInfo classifyArgumentType (QualType RetTy, bool IsFixed,
45- uint64_t &Offset, bool &HasV0 ) const ;
45+ uint64_t &Offset) const ;
4646 void computeInfo (CGFunctionInfo &FI) const override ;
4747 RValue EmitVAArg (CodeGenFunction &CGF, Address VAListAddr, QualType Ty,
4848 AggValueSlot Slot) const override ;
@@ -321,9 +321,8 @@ llvm::Type *MipsABIInfo::getPaddingType(uint64_t OrigOffset,
321321 return llvm::IntegerType::get (getVMContext (), (Offset - OrigOffset) * 8 );
322322}
323323
324- ABIArgInfo
325- MipsABIInfo::classifyArgumentType (QualType Ty, bool IsFixed,
326- uint64_t &Offset, bool &HasV0) const {
324+ ABIArgInfo MipsABIInfo::classifyArgumentType (QualType Ty, bool IsFixed,
325+ uint64_t &Offset) const {
327326 Ty = useFirstFieldIfTransparentUnion (Ty);
328327
329328 uint64_t OrigOffset = Offset;
@@ -393,22 +392,6 @@ MipsABIInfo::classifyArgumentType(QualType Ty, bool IsFixed,
393392 // All integral types are promoted to the GPR width.
394393 if (Ty->isIntegralOrEnumerationType () &&
395394 !Ty->isCHERICapabilityType (getContext ())) {
396- if (HasV0) {
397- // This is the special method number argument; don't count it as a
398- // parameter slot. otherwise we risk inserting padding directly after
399- // this argument if we next see an aggregate, which disagrees with the
400- // non-CCall calling convention when dropping the object and method, but
401- // the two must match to allow cheri_invoke and the libcheri CCall
402- // vectors to act as trampolines.
403- //
404- // TODO: This is insufficient if the first integral type comes as part of
405- // an aggregate above. Ideally the front-end would enforce that
406- // CCall functions have sane arguments (two capabilities and an
407- // integer (up to one machine word) before anything else, with the
408- // capabilities possibly in a struct).
409- HasV0 = false ;
410- Offset = OrigOffset;
411- }
412395 return extendType (Ty);
413396 }
414397
@@ -607,13 +590,12 @@ void MipsABIInfo::computeInfo(CGFunctionInfo &FI) const {
607590
608591 // Check if a pointer to an aggregate is passed as a hidden argument.
609592 uint64_t Offset = RetInfo.isIndirect () ? MinABIStackAlignInBytes : 0 ;
610- bool HasV0 = FI.getCallingConvention () == llvm::CallingConv::CHERI_CCall;
611- int NumFixedArgs = FI.getNumRequiredArgs ();
612593
594+ int NumFixedArgs = FI.getNumRequiredArgs ();
613595 int ArgNum = 0 ;
614596 for (auto &I : FI.arguments ()) {
615597 bool IsFixed = ArgNum < NumFixedArgs;
616- I.info = classifyArgumentType (I.type , IsFixed, Offset, HasV0 );
598+ I.info = classifyArgumentType (I.type , IsFixed, Offset);
617599 ArgNum++;
618600 }
619601}
0 commit comments