llvm.org GIT mirror llvm / f961273
Remove an easy use of EmitRawText from PPC. This makes lib/Target/PowerPC EmitRawText free. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200065 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
4 changed file(s) with 19 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
88
99 #include "MCTargetDesc/PPCMCTargetDesc.h"
1010 #include "MCTargetDesc/PPCMCExpr.h"
11 #include "PPCTargetStreamer.h"
1112 #include "llvm/ADT/STLExtras.h"
1213 #include "llvm/ADT/SmallString.h"
1314 #include "llvm/ADT/SmallVector.h"
14351436 Error(L, "unexpected token in directive");
14361437 return false;
14371438 }
1439 PPCTargetStreamer &TStreamer =
1440 *static_cast(
1441 getParser().getStreamer().getTargetStreamer());
1442 TStreamer.emitMachine(CPU);
14381443
14391444 return false;
14401445 }
119119 OS << S.getName();
120120 OS << '\n';
121121 }
122 virtual void emitMachine(StringRef CPU) {
123 OS << "\t.machine " << CPU << '\n';
124 }
122125 };
123126
124127 class PPCTargetELFStreamer : public PPCTargetStreamer {
125128 virtual void emitTCEntry(const MCSymbol &S) {
126129 // Creates a R_PPC64_TOC relocation
127130 Streamer->EmitSymbolValue(&S, 8);
131 }
132 virtual void emitMachine(StringRef CPU) {
133 // FIXME: Is there anything to do in here or does this directive only
134 // limit the parser?
128135 }
129136 };
130137 }
849849 if (Subtarget.isPPC64() && Directive < PPC::DIR_64)
850850 Directive = PPC::DIR_64;
851851 assert(Directive <= PPC::DIR_64 && "Directive out of range.");
852
853 // FIXME: This is a total hack, finish mc'izing the PPC backend.
854 if (OutStreamer.hasRawTextSupport()) {
855 assert(Directive < array_lengthof(CPUDirectives) &&
856 "CPUDirectives[] might not be up-to-date!");
857 OutStreamer.EmitRawText("\t.machine " + Twine(CPUDirectives[Directive]));
858 }
852
853 assert(Directive < array_lengthof(CPUDirectives) &&
854 "CPUDirectives[] might not be up-to-date!");
855 PPCTargetStreamer &TStreamer =
856 *static_cast(OutStreamer.getTargetStreamer());
857 TStreamer.emitMachine(CPUDirectives[Directive]);
859858
860859 // Prime text sections so they are adjacent. This reduces the likelihood a
861860 // large data or debug section causes a branch to exceed 16M limit.
1616 public:
1717 virtual ~PPCTargetStreamer();
1818 virtual void emitTCEntry(const MCSymbol &S) = 0;
19 virtual void emitMachine(StringRef CPU) = 0;
1920 };
2021 }
2122