llvm.org GIT mirror llvm / 5cd2791
Add target a target hook to get the register number used by the compact unwind encoding for the registers it knows about. Return -1 if it can't handle that register. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134202 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 9 years ago
4 changed file(s) with 29 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
105105 int getSEHRegNum(unsigned RegNum) const {
106106 return TRI->getSEHRegNum(RegNum);
107107 }
108
109 int getCompactUnwindRegNum(unsigned RegNum) const {
110 return TRI->getCompactUnwindRegNum(RegNum);
111 }
108112 };
109113
110114 }
719719 virtual int getSEHRegNum(unsigned i) const {
720720 return i;
721721 }
722
723 /// getCompactUnwindRegNum - This function maps the register to the number for
724 /// compact unwind encoding. Return -1 if the register isn't valid.
725 virtual int getCompactUnwindRegNum(unsigned) const {
726 return -1;
727 }
722728 };
723729
724730
102102 unsigned Flavour = getFlavour(Subtarget, isEH);
103103
104104 return X86GenRegisterInfo::getLLVMRegNumFull(DwarfRegNo, Flavour);
105 }
106
107 /// getCompactUnwindRegNum - This function maps the register to the number for
108 /// compact unwind encoding. Return -1 if the register isn't valid.
109 int X86RegisterInfo::getCompactUnwindRegNum(unsigned RegNum) const {
110 switch (RegNum) {
111 case X86::EBX: case X86::RBX: return 1;
112 case X86::ECX: case X86::RCX: return 2;
113 case X86::EDX: case X86::RDX: return 3;
114 case X86::EDI: case X86::RDI: return 4;
115 case X86::ESI: case X86::RSI: return 5;
116 case X86::EBP: case X86::RBP: return 6;
117 }
118
119 return -1;
105120 }
106121
107122 int
8080 // FIXME: This should be tablegen'd like getDwarfRegNum is
8181 int getSEHRegNum(unsigned i) const;
8282
83 /// getCompactUnwindRegNum - This function maps the register to the number for
84 /// compact unwind encoding. Return -1 if the register isn't valid.
85 int getCompactUnwindRegNum(unsigned RegNum) const;
86
8387 /// Code Generation virtual methods...
8488 ///
8589