diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-07-18 20:57:22 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-07-18 20:57:22 +0000 |
commit | 0e6a052331f674dd70e28af41f654a7874405eab (patch) | |
tree | 5b2a153966b9f7585e2c882d1d34f97d108d54f2 /lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h | |
parent | 1360bc8eb029d51d426c77c4b1410849ff308893 (diff) | |
download | external_llvm-0e6a052331f674dd70e28af41f654a7874405eab.zip external_llvm-0e6a052331f674dd70e28af41f654a7874405eab.tar.gz external_llvm-0e6a052331f674dd70e28af41f654a7874405eab.tar.bz2 |
Sink getDwarfRegNum, getLLVMRegNum, getSEHRegNum from TargetRegisterInfo down
to MCRegisterInfo. Also initialize the mapping at construction time.
This patch eliminate TargetRegisterInfo from TargetAsmInfo. It's another step
towards fixing the layering violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135424 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h')
-rw-r--r-- | lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h b/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h index 89ea22b..2c5ae4e 100644 --- a/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h +++ b/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h @@ -17,12 +17,29 @@ #include <string> namespace llvm { +class MCRegisterInfo; class MCSubtargetInfo; class Target; class StringRef; extern Target TheX86_32Target, TheX86_64Target; +/// DWARFFlavour - Flavour of dwarf regnumbers +/// +namespace DWARFFlavour { + enum { + X86_64 = 0, X86_32_DarwinEH = 1, X86_32_Generic = 2 + }; +} + +/// N86 namespace - Native X86 register numbers +/// +namespace N86 { + enum { + EAX = 0, ECX = 1, EDX = 2, EBX = 3, ESP = 4, EBP = 5, ESI = 6, EDI = 7 + }; +} + namespace X86_MC { std::string ParseX86Triple(StringRef TT); @@ -33,7 +50,13 @@ namespace X86_MC { void DetectFamilyModel(unsigned EAX, unsigned &Family, unsigned &Model); - /// createARMMCSubtargetInfo - Create a X86 MCSubtargetInfo instance. + unsigned getDwarfRegFlavour(StringRef TT, bool isEH); + + unsigned getX86RegNum(unsigned RegNo); + + void InitLLVM2SEHRegisterMapping(MCRegisterInfo *MRI); + + /// createX86MCSubtargetInfo - Create a X86 MCSubtargetInfo instance. /// This is exposed so Asm parser, etc. do not need to go through /// TargetRegistry. MCSubtargetInfo *createX86MCSubtargetInfo(StringRef TT, StringRef CPU, |