llvm.org GIT mirror llvm / 672b93a
Unfortunately several files in MC are badly violating layering rule by using TargetAsmInfo, which in turn pulls in TargetRegisterInfo, etc. :-( There are other cases of violations, but this is probably the worst. This patch is but one small step towards fixing this. 500 more steps to go. :-( git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135131 91177308-0d34-0410-b5e6-96231b3b80d8 Evan Cheng 8 years ago
11 changed file(s) with 29 addition(s) and 19 deletion(s). Raw diff Collapse all Expand all
7272 virtual void EmitValueToOffset(const MCExpr *Offset, unsigned char Value);
7373 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
7474 const MCSymbol *LastLabel,
75 const MCSymbol *Label);
75 const MCSymbol *Label,
76 unsigned PointerSize);
7677 virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
7778 const MCSymbol *Label);
7879 virtual void Finish();
459459
460460 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
461461 const MCSymbol *LastLabel,
462 const MCSymbol *Label) = 0;
462 const MCSymbol *Label,
463 unsigned PointerSize) = 0;
463464
464465 virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
465466 const MCSymbol *Label) {
136136 virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol);
137137 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
138138 const MCSymbol *LastLabel,
139 const MCSymbol *Label);
139 const MCSymbol *Label,
140 unsigned PointerSize);
140141 virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
141142 const MCSymbol *Label);
142143
363364
364365 void MCAsmStreamer::EmitDwarfAdvanceLineAddr(int64_t LineDelta,
365366 const MCSymbol *LastLabel,
366 const MCSymbol *Label) {
367 EmitDwarfSetLineAddr(LineDelta, Label,
368 getContext().getTargetAsmInfo().getPointerSize());
367 const MCSymbol *Label,
368 unsigned PointerSize) {
369 EmitDwarfSetLineAddr(LineDelta, Label, PointerSize);
369370 }
370371
371372 void MCAsmStreamer::EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
171171 // At this point we want to emit/create the sequence to encode the delta in
172172 // line numbers and the increment of the address from the previous Label
173173 // and the current Label.
174 MCOS->EmitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label);
174 const TargetAsmInfo &asmInfo = MCOS->getContext().getTargetAsmInfo();
175 MCOS->EmitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label,
176 asmInfo.getPointerSize());
175177
176178 LastLine = it->getLine();
177179 LastLabel = Label;
195197 // Switch back the the dwarf line section.
196198 MCOS->SwitchSection(context.getTargetAsmInfo().getDwarfLineSection());
197199
198 MCOS->EmitDwarfAdvanceLineAddr(INT64_MAX, LastLabel, SectionEnd);
200 const TargetAsmInfo &asmInfo = MCOS->getContext().getTargetAsmInfo();
201 MCOS->EmitDwarfAdvanceLineAddr(INT64_MAX, LastLabel, SectionEnd,
202 asmInfo.getPointerSize());
199203 }
200204
201205 //
2525 #include "llvm/Support/ErrorHandling.h"
2626 #include "llvm/Support/raw_ostream.h"
2727 #include "llvm/Target/TargetAsmBackend.h"
28 #include "llvm/Target/TargetAsmInfo.h"
2928
3029 using namespace llvm;
3130
8484
8585 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
8686 const MCSymbol *LastLabel,
87 const MCSymbol *Label) {
87 const MCSymbol *Label,
88 unsigned PointerSize) {
8889 LogCall("EmitDwarfAdvanceLineAddr");
89 return Child->EmitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label);
90 return Child->EmitDwarfAdvanceLineAddr(LineDelta, LastLabel, Label,
91 PointerSize);
9092 }
9193
9294 virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) {
2323 #include "llvm/Support/ErrorHandling.h"
2424 #include "llvm/Support/raw_ostream.h"
2525 #include "llvm/Target/TargetAsmBackend.h"
26 #include "llvm/Target/TargetAsmInfo.h"
2726
2827 using namespace llvm;
2928
4343 virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol){}
4444 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
4545 const MCSymbol *LastLabel,
46 const MCSymbol *Label) {}
46 const MCSymbol *Label,
47 unsigned PointerSize) {}
4748
4849 virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute){}
4950
1717 #include "llvm/MC/MCExpr.h"
1818 #include "llvm/MC/MCSymbol.h"
1919 #include "llvm/Target/TargetAsmBackend.h"
20 #include "llvm/Target/TargetAsmInfo.h"
2120 using namespace llvm;
2221
2322 MCObjectStreamer::MCObjectStreamer(MCContext &Context, TargetAsmBackend &TAB,
196195
197196 void MCObjectStreamer::EmitDwarfAdvanceLineAddr(int64_t LineDelta,
198197 const MCSymbol *LastLabel,
199 const MCSymbol *Label) {
198 const MCSymbol *Label,
199 unsigned PointerSize) {
200200 if (!LastLabel) {
201 int PointerSize = getContext().getTargetAsmInfo().getPointerSize();
202201 EmitDwarfSetLineAddr(LineDelta, Label, PointerSize);
203202 return;
204203 }
114114
115115 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
116116 const MCSymbol *LastLabel,
117 const MCSymbol *Label);
117 const MCSymbol *Label,
118 unsigned PointerSize);
118119
119120 virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute);
120121
259260
260261 void PTXMCAsmStreamer::EmitDwarfAdvanceLineAddr(int64_t LineDelta,
261262 const MCSymbol *LastLabel,
262 const MCSymbol *Label) {
263 const MCSymbol *Label,
264 unsigned PointerSize) {
263265 report_fatal_error("Unimplemented.");
264266 }
265267
597597 virtual void EmitFileDirective(StringRef Filename) {}
598598 virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
599599 const MCSymbol *LastLabel,
600 const MCSymbol *Label) {}
600 const MCSymbol *Label,
601 unsigned PointerSize) {}
601602
602603 virtual void EmitInstruction(const MCInst &Inst) {
603604 // Scan for values.