llvm.org GIT mirror llvm / 6b918b8
Add a method to TargetRegisterInfo to get the register number that the Win64 EH scheme uses internally. Implement it for x86 (the only architecture that LLVM supports for which this matters right now). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131969 91177308-0d34-0410-b5e6-96231b3b80d8 Charles Davis 9 years ago
3 changed file(s) with 30 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
808808 /// getRARegister - This method should return the register where the return
809809 /// address can be found.
810810 virtual unsigned getRARegister() const = 0;
811
812 /// getSEHRegNum - Map a target register to an equivalent SEH register
813 /// number. Returns -1 if there is no equivalent value.
814 virtual int getSEHRegNum(unsigned i) const {
815 return i;
816 }
811817 };
812818
813819
9393 }
9494
9595 return X86GenRegisterInfo::getDwarfRegNumFull(RegNo, Flavour);
96 }
97
98 int
99 X86RegisterInfo::getSEHRegNum(unsigned i) const {
100 int reg = getX86RegNum(i);
101 switch (i) {
102 case X86::R8: case X86::R8D: case X86::R8W: case X86::R8B:
103 case X86::R9: case X86::R9D: case X86::R9W: case X86::R9B:
104 case X86::R10: case X86::R10D: case X86::R10W: case X86::R10B:
105 case X86::R11: case X86::R11D: case X86::R11W: case X86::R11B:
106 case X86::R12: case X86::R12D: case X86::R12W: case X86::R12B:
107 case X86::R13: case X86::R13D: case X86::R13W: case X86::R13B:
108 case X86::R14: case X86::R14D: case X86::R14W: case X86::R14B:
109 case X86::R15: case X86::R15D: case X86::R15W: case X86::R15B:
110 case X86::XMM8: case X86::XMM9: case X86::XMM10: case X86::XMM11:
111 case X86::XMM12: case X86::XMM13: case X86::XMM14: case X86::XMM15:
112 case X86::YMM8: case X86::YMM9: case X86::YMM10: case X86::YMM11:
113 case X86::YMM12: case X86::YMM13: case X86::YMM14: case X86::YMM15:
114 reg += 8;
115 }
116 return reg;
96117 }
97118
98119 /// getX86RegNum - This function maps LLVM register identifiers to their X86
8080 /// (created by TableGen) for target dependencies.
8181 int getDwarfRegNum(unsigned RegNum, bool isEH) const;
8282
83 // FIXME: This should be tablegen'd like getDwarfRegNum is
84 int getSEHRegNum(unsigned i) const;
85
8386 /// Code Generation virtual methods...
8487 ///
8588