File tree Expand file tree Collapse file tree 3 files changed +170
-185
lines changed Expand file tree Collapse file tree 3 files changed +170
-185
lines changed Original file line number Diff line number Diff line change @@ -353,6 +353,34 @@ bool ABIPassingInformation::IsSplitAcrossRegistersAndStack() const
353
353
return false ;
354
354
}
355
355
356
+ // -----------------------------------------------------------------------------
357
+ // CountRegsAndStackSlots:
358
+ // Count how many registers and stack slots are used for passing the
359
+ // argument.
360
+ //
361
+ // Return Value:
362
+ // Count of registers plus count of stack slots.
363
+ //
364
+ unsigned ABIPassingInformation::CountRegsAndStackSlots () const
365
+ {
366
+ unsigned numSlots = 0 ;
367
+
368
+ for (unsigned i = 0 ; i < NumSegments; i++)
369
+ {
370
+ const ABIPassingSegment& seg = Segment (i);
371
+ if (seg.IsPassedInRegister ())
372
+ {
373
+ numSlots++;
374
+ }
375
+ else
376
+ {
377
+ numSlots += (seg.Size + TARGET_POINTER_SIZE - 1 ) / TARGET_POINTER_SIZE;
378
+ }
379
+ }
380
+
381
+ return numSlots;
382
+ }
383
+
356
384
// -----------------------------------------------------------------------------
357
385
// FromSegment:
358
386
// Create ABIPassingInformation from a single segment.
Original file line number Diff line number Diff line change @@ -74,12 +74,13 @@ struct ABIPassingInformation
74
74
const ABIPassingSegment& Segment (unsigned index) const ;
75
75
ABIPassingSegment& Segment (unsigned index);
76
76
77
- bool HasAnyRegisterSegment () const ;
78
- bool HasAnyFloatingRegisterSegment () const ;
79
- bool HasAnyStackSegment () const ;
80
- bool HasExactlyOneRegisterSegment () const ;
81
- bool HasExactlyOneStackSegment () const ;
82
- bool IsSplitAcrossRegistersAndStack () const ;
77
+ bool HasAnyRegisterSegment () const ;
78
+ bool HasAnyFloatingRegisterSegment () const ;
79
+ bool HasAnyStackSegment () const ;
80
+ bool HasExactlyOneRegisterSegment () const ;
81
+ bool HasExactlyOneStackSegment () const ;
82
+ bool IsSplitAcrossRegistersAndStack () const ;
83
+ unsigned CountRegsAndStackSlots () const ;
83
84
84
85
static ABIPassingInformation FromSegment (Compiler* comp, const ABIPassingSegment& segment);
85
86
static ABIPassingInformation FromSegments (Compiler* comp,
You can’t perform that action at this time.
0 commit comments