llvm.org GIT mirror llvm / 7c44f63
Convert some easy uses of EmitRawText to TargetStreamer methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200122 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
3 changed file(s) with 98 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
5454 OS << "\t.set\tnomips16\n";
5555 }
5656
57 void MipsTargetAsmStreamer::emitDirectiveSetReorder() {
58 OS << "\t.set\treorder\n";
59 }
60
61 void MipsTargetAsmStreamer::emitDirectiveSetNoReorder() {
62 OS << "\t.set\tnoreorder\n";
63 }
64
65 void MipsTargetAsmStreamer::emitDirectiveSetMacro() {
66 OS << "\t.set\tmacro\n";
67 }
68
69 void MipsTargetAsmStreamer::emitDirectiveSetNoMacro() {
70 OS << "\t.set\tnomacro\n";
71 }
72
73 void MipsTargetAsmStreamer::emitDirectiveSetAt() {
74 OS << "\t.set\tat\n";
75 }
76
77 void MipsTargetAsmStreamer::emitDirectiveSetNoAt() {
78 OS << "\t.set\tnoat\n";
79 }
80
81 void MipsTargetAsmStreamer::emitDirectiveEnd(StringRef Name) {
82 OS << "\t.end\t" << Name << '\n';
83 }
84
5785 void MipsTargetAsmStreamer::emitDirectiveEnt(const MCSymbol &Symbol) {
5886 OS << "\t.ent\t" << Symbol.getName() << '\n';
5987 }
108136 // FIXME: implement.
109137 }
110138
139 void MipsTargetELFStreamer::emitDirectiveSetReorder() {
140 // FIXME: implement.
141 }
142
143 void MipsTargetELFStreamer::emitDirectiveSetNoReorder() {
144 // FIXME: implement.
145 }
146
147 void MipsTargetELFStreamer::emitDirectiveSetMacro() {
148 // FIXME: implement.
149 }
150
151 void MipsTargetELFStreamer::emitDirectiveSetNoMacro() {
152 // FIXME: implement.
153 }
154
155 void MipsTargetELFStreamer::emitDirectiveSetAt() {
156 // FIXME: implement.
157 }
158
159 void MipsTargetELFStreamer::emitDirectiveSetNoAt() {
160 // FIXME: implement.
161 }
162
163 void MipsTargetELFStreamer::emitDirectiveEnd(StringRef Name) {
164 // FIXME: implement.
165 }
166
111167 void MipsTargetELFStreamer::emitDirectiveEnt(const MCSymbol &Symbol) {
112168 // FIXME: implement.
113169 }
283283 /// EmitFunctionBodyStart - Targets can override this to emit stuff before
284284 /// the first basic block in the function.
285285 void MipsAsmPrinter::EmitFunctionBodyStart() {
286 MipsTargetStreamer &TS = getTargetStreamer();
287
286288 MCInstLowering.Initialize(&MF->getContext());
287289
288290 bool IsNakedFunction =
298300 if (!IsNakedFunction)
299301 printSavedRegsBitmask(OS);
300302 OutStreamer.EmitRawText(OS.str());
301 if (!Subtarget->inMips16Mode()) {
302 OutStreamer.EmitRawText(StringRef("\t.set\tnoreorder"));
303 OutStreamer.EmitRawText(StringRef("\t.set\tnomacro"));
304 OutStreamer.EmitRawText(StringRef("\t.set\tnoat"));
305 }
303 }
304 if (!Subtarget->inMips16Mode()) {
305 TS.emitDirectiveSetNoReorder();
306 TS.emitDirectiveSetNoMacro();
307 TS.emitDirectiveSetNoAt();
306308 }
307309 }
308310
309311 /// EmitFunctionBodyEnd - Targets can override this to emit stuff after
310312 /// the last basic block in the function.
311313 void MipsAsmPrinter::EmitFunctionBodyEnd() {
314 MipsTargetStreamer &TS = getTargetStreamer();
315
312316 // There are instruction for this macros, but they must
313317 // always be at the function end, and we can't emit and
314318 // break with BB logic.
315 if (OutStreamer.hasRawTextSupport()) {
316 if (!Subtarget->inMips16Mode()) {
317 OutStreamer.EmitRawText(StringRef("\t.set\tat"));
318 OutStreamer.EmitRawText(StringRef("\t.set\tmacro"));
319 OutStreamer.EmitRawText(StringRef("\t.set\treorder"));
320 }
321 OutStreamer.EmitRawText("\t.end\t" + Twine(CurrentFnSym->getName()));
322 }
319 if (!Subtarget->inMips16Mode()) {
320 TS.emitDirectiveSetAt();
321 TS.emitDirectiveSetMacro();
322 TS.emitDirectiveSetReorder();
323 }
324 TS.emitDirectiveEnd(CurrentFnSym->getName());
323325 // Make sure to terminate any constant pools that were at the end
324326 // of the function.
325327 if (!InConstantPool)
2222 virtual void emitDirectiveSetNoMicroMips() = 0;
2323 virtual void emitDirectiveSetMips16() = 0;
2424 virtual void emitDirectiveSetNoMips16() = 0;
25
26 virtual void emitDirectiveSetReorder() = 0;
27 virtual void emitDirectiveSetNoReorder() = 0;
28 virtual void emitDirectiveSetMacro() = 0;
29 virtual void emitDirectiveSetNoMacro() = 0;
30 virtual void emitDirectiveSetAt() = 0;
31 virtual void emitDirectiveSetNoAt() = 0;
32 virtual void emitDirectiveEnd(StringRef Name) = 0;
33
2534 virtual void emitDirectiveEnt(const MCSymbol &Symbol) = 0;
2635 virtual void emitDirectiveAbiCalls() = 0;
2736 virtual void emitDirectiveOptionPic0() = 0;
3847 virtual void emitDirectiveSetNoMicroMips();
3948 virtual void emitDirectiveSetMips16();
4049 virtual void emitDirectiveSetNoMips16();
50
51 virtual void emitDirectiveSetReorder();
52 virtual void emitDirectiveSetNoReorder();
53 virtual void emitDirectiveSetMacro();
54 virtual void emitDirectiveSetNoMacro();
55 virtual void emitDirectiveSetAt();
56 virtual void emitDirectiveSetNoAt();
57 virtual void emitDirectiveEnd(StringRef Name);
58
4159 virtual void emitDirectiveEnt(const MCSymbol &Symbol);
4260 virtual void emitDirectiveAbiCalls();
4361 virtual void emitDirectiveOptionPic0();
6078 virtual void emitDirectiveSetNoMicroMips();
6179 virtual void emitDirectiveSetMips16();
6280 virtual void emitDirectiveSetNoMips16();
81
82 virtual void emitDirectiveSetReorder();
83 virtual void emitDirectiveSetNoReorder();
84 virtual void emitDirectiveSetMacro();
85 virtual void emitDirectiveSetNoMacro();
86 virtual void emitDirectiveSetAt();
87 virtual void emitDirectiveSetNoAt();
88 virtual void emitDirectiveEnd(StringRef Name);
89
6390 virtual void emitDirectiveEnt(const MCSymbol &Symbol);
6491 virtual void emitDirectiveAbiCalls();
6592 virtual void emitDirectiveOptionPic0();