llvm.org GIT mirror llvm / b6d6674
remove the dead PreferredEHDataFormat TAI hook: its now dead even considering #if 0 code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77856 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 10 years ago
5 changed file(s) with 3 addition(s) and 91 deletion(s). Raw diff Collapse all Expand all
20792079
20802080

20812081 The X86 assembly printer implementation (X86TargetAsmInfo) is an
2082 example where the target specific TargetAsmInfo class uses overridden
2083 methods: ExpandInlineAsm and PreferredEHDataFormat.
2082 example where the target specific TargetAsmInfo class uses an
2083 overridden methods: ExpandInlineAsm.
20842084

20852085
20862086

382382 /// length.
383383 virtual unsigned getInlineAsmLength(const char *Str) const;
384384
385 /// PreferredEHDataFormat - This hook allows the target to select data
386 /// format used for encoding pointers in exception handling data.
387 virtual unsigned PreferredEHDataFormat() const;
388
389
390385 /// getSLEB128Size - Compute the number of bytes required for a signed
391386 /// leb128 value.
392387 static unsigned getSLEB128Size(int Value);
139139 return Length;
140140 }
141141
142 unsigned TargetAsmInfo::PreferredEHDataFormat() const {
143 return dwarf::DW_EH_PE_absptr;
144 }
145
146142 unsigned TargetAsmInfo::getULEB128Size(unsigned Value) {
147143 unsigned Size = 0;
148144 do {
8585 ".section __TEXT,__eh_frame,coalesced,no_toc+strip_static_syms+live_support";
8686 }
8787
88 unsigned X86DarwinTargetAsmInfo::PreferredEHDataFormat() const {
89 const X86Subtarget *Subtarget = &TM.getSubtarget();
90 if (Subtarget->getDarwinVers() > 9)
91 return DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4;
92
93 return DW_EH_PE_absptr;
94 }
95
9688 const char *
9789 X86DarwinTargetAsmInfo::getEHGlobalPrefix() const {
9890 const X86Subtarget* Subtarget = &TM.getSubtarget();
137129 NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits";
138130 }
139131
140 unsigned
141 X86ELFTargetAsmInfo::PreferredEHDataFormat() const {
142 CodeModel::Model CM = TM.getCodeModel();
143 bool is64Bit = TM.getSubtarget().is64Bit();
144
145 if (TM.getRelocationModel() == Reloc::PIC_) {
146 unsigned Format = 0;
147
148 if (!is64Bit)
149 // 32 bit targets always encode pointers as 4 bytes
150 Format = DW_EH_PE_sdata4;
151 else {
152 // 64 bit targets encode pointers in 4 bytes iff:
153 // - code model is small OR
154 // - code model is medium and we're emitting externally visible symbols
155 // or any code symbols
156 if (CM == CodeModel::Small || CM == CodeModel::Medium)
157 Format = DW_EH_PE_sdata4;
158 else
159 Format = DW_EH_PE_sdata8;
160 }
161
162 Format |= DW_EH_PE_indirect;
163 return (Format | DW_EH_PE_pcrel);
164 }
165
166 if (is64Bit && CM == CodeModel::Small)
167 return DW_EH_PE_udata4;
168 return DW_EH_PE_absptr;
169 }
170
171
172 unsigned
173 X86COFFTargetAsmInfo::PreferredEHDataFormat() const {
174 CodeModel::Model CM = TM.getCodeModel();
175 bool is64Bit = TM.getSubtarget().is64Bit();
176
177 if (TM.getRelocationModel() == Reloc::PIC_) {
178 unsigned Format = 0;
179
180 if (!is64Bit)
181 // 32 bit targets always encode pointers as 4 bytes
182 Format = DW_EH_PE_sdata4;
183 else {
184 // 64 bit targets encode pointers in 4 bytes iff:
185 // - code model is small OR
186 // - code model is medium and we're emitting externally visible symbols
187 // or any code symbols
188 if (CM == CodeModel::Small || CM == CodeModel::Medium)
189 Format = DW_EH_PE_sdata4;
190 else
191 Format = DW_EH_PE_sdata8;
192 }
193
194 Format |= DW_EH_PE_indirect;
195 return (Format | DW_EH_PE_pcrel);
196 }
197
198 if (is64Bit && CM == CodeModel::Small)
199 return DW_EH_PE_udata4;
200 return DW_EH_PE_absptr;
201 }
202
203
204132
205133 X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM):
206134 X86TargetAsmInfo(TM) {
3636
3737 struct X86DarwinTargetAsmInfo : public X86TargetAsmInfo {
3838 explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM);
39 virtual unsigned PreferredEHDataFormat() const;
4039 virtual const char *getEHGlobalPrefix() const;
4140 };
4241
4342 struct X86ELFTargetAsmInfo : public X86TargetAsmInfo {
4443 explicit X86ELFTargetAsmInfo(const X86TargetMachine &TM);
45 virtual unsigned PreferredEHDataFormat() const;
4644 };
4745
48 struct X86COFFTargetAsmInfo : public X86TargetAsmInfo {
49 explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM) :
50 X86TargetAsmInfo(TM) {}
51 virtual unsigned PreferredEHDataFormat() const;
52 };
53
46 typedef X86TargetAsmInfo X86COFFTargetAsmInfo;
5447
5548 struct X86WinTargetAsmInfo : public X86TargetAsmInfo {
5649 explicit X86WinTargetAsmInfo(const X86TargetMachine &TM);