@@ -509,11 +509,11 @@ class MCCFIInstruction {
509509 union {
510510 struct {
511511 unsigned Register;
512- int Offset;
512+ int64_t Offset;
513513 } RI;
514514 struct {
515515 unsigned Register;
516- int Offset;
516+ int64_t Offset;
517517 unsigned AddressSpace;
518518 } RIA;
519519 struct {
@@ -527,7 +527,7 @@ class MCCFIInstruction {
527527 std::vector<char > Values;
528528 std::string Comment;
529529
530- MCCFIInstruction (OpType Op, MCSymbol *L, unsigned R, int O, SMLoc Loc,
530+ MCCFIInstruction (OpType Op, MCSymbol *L, unsigned R, int64_t O, SMLoc Loc,
531531 StringRef V = " " , StringRef Comment = " " )
532532 : Label(L), Operation(Op), Loc(Loc), Values(V.begin(), V.end()),
533533 Comment (Comment) {
@@ -539,7 +539,7 @@ class MCCFIInstruction {
539539 assert (Op == OpRegister);
540540 U.RR = {R1, R2};
541541 }
542- MCCFIInstruction (OpType Op, MCSymbol *L, unsigned R, int O, unsigned AS,
542+ MCCFIInstruction (OpType Op, MCSymbol *L, unsigned R, int64_t O, unsigned AS,
543543 SMLoc Loc)
544544 : Label(L), Operation(Op), Loc(Loc) {
545545 assert (Op == OpLLVMDefAspaceCfa);
@@ -555,30 +555,30 @@ class MCCFIInstruction {
555555public:
556556 // / .cfi_def_cfa defines a rule for computing CFA as: take address from
557557 // / Register and add Offset to it.
558- static MCCFIInstruction cfiDefCfa (MCSymbol *L, unsigned Register, int Offset,
559- SMLoc Loc = {}) {
558+ static MCCFIInstruction cfiDefCfa (MCSymbol *L, unsigned Register,
559+ int64_t Offset, SMLoc Loc = {}) {
560560 return MCCFIInstruction (OpDefCfa, L, Register, Offset, Loc);
561561 }
562562
563563 // / .cfi_def_cfa_register modifies a rule for computing CFA. From now
564564 // / on Register will be used instead of the old one. Offset remains the same.
565565 static MCCFIInstruction createDefCfaRegister (MCSymbol *L, unsigned Register,
566566 SMLoc Loc = {}) {
567- return MCCFIInstruction (OpDefCfaRegister, L, Register, 0 , Loc);
567+ return MCCFIInstruction (OpDefCfaRegister, L, Register, INT64_C ( 0 ) , Loc);
568568 }
569569
570570 // / .cfi_def_cfa_offset modifies a rule for computing CFA. Register
571571 // / remains the same, but offset is new. Note that it is the absolute offset
572572 // / that will be added to a defined register to the compute CFA address.
573- static MCCFIInstruction cfiDefCfaOffset (MCSymbol *L, int Offset,
573+ static MCCFIInstruction cfiDefCfaOffset (MCSymbol *L, int64_t Offset,
574574 SMLoc Loc = {}) {
575575 return MCCFIInstruction (OpDefCfaOffset, L, 0 , Offset, Loc);
576576 }
577577
578578 // / .cfi_adjust_cfa_offset Same as .cfi_def_cfa_offset, but
579579 // / Offset is a relative value that is added/subtracted from the previous
580580 // / offset.
581- static MCCFIInstruction createAdjustCfaOffset (MCSymbol *L, int Adjustment,
581+ static MCCFIInstruction createAdjustCfaOffset (MCSymbol *L, int64_t Adjustment,
582582 SMLoc Loc = {}) {
583583 return MCCFIInstruction (OpAdjustCfaOffset, L, 0 , Adjustment, Loc);
584584 }
@@ -588,7 +588,7 @@ class MCCFIInstruction {
588588 // / be the result of evaluating the DWARF operation expression
589589 // / `DW_OP_constu AS; DW_OP_aspace_bregx R, B` as a location description.
590590 static MCCFIInstruction createLLVMDefAspaceCfa (MCSymbol *L, unsigned Register,
591- int Offset,
591+ int64_t Offset,
592592 unsigned AddressSpace,
593593 SMLoc Loc) {
594594 return MCCFIInstruction (OpLLVMDefAspaceCfa, L, Register, Offset,
@@ -598,15 +598,15 @@ class MCCFIInstruction {
598598 // / .cfi_offset Previous value of Register is saved at offset Offset
599599 // / from CFA.
600600 static MCCFIInstruction createOffset (MCSymbol *L, unsigned Register,
601- int Offset, SMLoc Loc = {}) {
601+ int64_t Offset, SMLoc Loc = {}) {
602602 return MCCFIInstruction (OpOffset, L, Register, Offset, Loc);
603603 }
604604
605605 // / .cfi_rel_offset Previous value of Register is saved at offset
606606 // / Offset from the current CFA register. This is transformed to .cfi_offset
607607 // / using the known displacement of the CFA register from the CFA.
608608 static MCCFIInstruction createRelOffset (MCSymbol *L, unsigned Register,
609- int Offset, SMLoc Loc = {}) {
609+ int64_t Offset, SMLoc Loc = {}) {
610610 return MCCFIInstruction (OpRelOffset, L, Register, Offset, Loc);
611611 }
612612
@@ -619,44 +619,44 @@ class MCCFIInstruction {
619619
620620 // / .cfi_window_save SPARC register window is saved.
621621 static MCCFIInstruction createWindowSave (MCSymbol *L, SMLoc Loc = {}) {
622- return MCCFIInstruction (OpWindowSave, L, 0 , 0 , Loc);
622+ return MCCFIInstruction (OpWindowSave, L, 0 , INT64_C ( 0 ) , Loc);
623623 }
624624
625625 // / .cfi_negate_ra_state AArch64 negate RA state.
626626 static MCCFIInstruction createNegateRAState (MCSymbol *L, SMLoc Loc = {}) {
627- return MCCFIInstruction (OpNegateRAState, L, 0 , 0 , Loc);
627+ return MCCFIInstruction (OpNegateRAState, L, 0 , INT64_C ( 0 ) , Loc);
628628 }
629629
630630 // / .cfi_restore says that the rule for Register is now the same as it
631631 // / was at the beginning of the function, after all initial instructions added
632632 // / by .cfi_startproc were executed.
633633 static MCCFIInstruction createRestore (MCSymbol *L, unsigned Register,
634634 SMLoc Loc = {}) {
635- return MCCFIInstruction (OpRestore, L, Register, 0 , Loc);
635+ return MCCFIInstruction (OpRestore, L, Register, INT64_C ( 0 ) , Loc);
636636 }
637637
638638 // / .cfi_undefined From now on the previous value of Register can't be
639639 // / restored anymore.
640640 static MCCFIInstruction createUndefined (MCSymbol *L, unsigned Register,
641641 SMLoc Loc = {}) {
642- return MCCFIInstruction (OpUndefined, L, Register, 0 , Loc);
642+ return MCCFIInstruction (OpUndefined, L, Register, INT64_C ( 0 ) , Loc);
643643 }
644644
645645 // / .cfi_same_value Current value of Register is the same as in the
646646 // / previous frame. I.e., no restoration is needed.
647647 static MCCFIInstruction createSameValue (MCSymbol *L, unsigned Register,
648648 SMLoc Loc = {}) {
649- return MCCFIInstruction (OpSameValue, L, Register, 0 , Loc);
649+ return MCCFIInstruction (OpSameValue, L, Register, INT64_C ( 0 ) , Loc);
650650 }
651651
652652 // / .cfi_remember_state Save all current rules for all registers.
653653 static MCCFIInstruction createRememberState (MCSymbol *L, SMLoc Loc = {}) {
654- return MCCFIInstruction (OpRememberState, L, 0 , 0 , Loc);
654+ return MCCFIInstruction (OpRememberState, L, 0 , INT64_C ( 0 ) , Loc);
655655 }
656656
657657 // / .cfi_restore_state Restore the previously saved state.
658658 static MCCFIInstruction createRestoreState (MCSymbol *L, SMLoc Loc = {}) {
659- return MCCFIInstruction (OpRestoreState, L, 0 , 0 , Loc);
659+ return MCCFIInstruction (OpRestoreState, L, 0 , INT64_C ( 0 ) , Loc);
660660 }
661661
662662 // / .cfi_escape Allows the user to add arbitrary bytes to the unwind
@@ -667,7 +667,7 @@ class MCCFIInstruction {
667667 }
668668
669669 // / A special wrapper for .cfi_escape that indicates GNU_ARGS_SIZE
670- static MCCFIInstruction createGnuArgsSize (MCSymbol *L, int Size,
670+ static MCCFIInstruction createGnuArgsSize (MCSymbol *L, int64_t Size,
671671 SMLoc Loc = {}) {
672672 return MCCFIInstruction (OpGnuArgsSize, L, 0 , Size, Loc);
673673 }
@@ -702,7 +702,7 @@ class MCCFIInstruction {
702702 return U.RIA .AddressSpace ;
703703 }
704704
705- int getOffset () const {
705+ int64_t getOffset () const {
706706 if (Operation == OpLLVMDefAspaceCfa)
707707 return U.RIA .Offset ;
708708 assert (Operation == OpDefCfa || Operation == OpOffset ||
@@ -736,7 +736,7 @@ struct MCDwarfFrameInfo {
736736 unsigned CurrentCfaRegister = 0 ;
737737 unsigned PersonalityEncoding = 0 ;
738738 unsigned LsdaEncoding = 0 ;
739- uint32_t CompactUnwindEncoding = 0 ;
739+ uint64_t CompactUnwindEncoding = 0 ;
740740 bool IsSignalFrame = false ;
741741 bool IsSimple = false ;
742742 unsigned RAReg = static_cast <unsigned >(INT_MAX);
0 commit comments