summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-01-14 04:25:13 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-01-14 04:25:13 +0000
commit3c733ea0649665b81947de596d410a5c4f42f5f4 (patch)
tree5ca3a0eb19cf878d00fbd4cb086834685b00a4be /lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
parentdfa550a1761a85417d0e42c8cd17cd08e753388b (diff)
downloadllvm-3c733ea0649665b81947de596d410a5c4f42f5f4.tar.gz
llvm-3c733ea0649665b81947de596d410a5c4f42f5f4.tar.bz2
llvm-3c733ea0649665b81947de596d410a5c4f42f5f4.tar.xz
Replace .mips_hack_stocg with ".set micromips" and ".set nomicromips".
This matches what gnu as does and implementing this is easier than arguing about it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp')
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp38
1 files changed, 23 insertions, 15 deletions
diff --git a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
index 16203a0dcb..48af1a71ca 100644
--- a/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
+++ b/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
@@ -38,16 +38,15 @@ void MipsTargetAsmStreamer::emitMipsHackELFFlags(unsigned Flags) {
OS.write_hex(Flags);
OS << '\n';
}
-void MipsTargetAsmStreamer::emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val) {
- if (!PrintHackDirectives)
- return;
- OS << "\t.mips_hack_stocg ";
- OS << Sym->getName();
- OS << ", ";
- OS << Val;
- OS << '\n';
+void MipsTargetAsmStreamer::emitDirectiveSetMicroMips() {
+ OS << "\t.set\tmicromips\n";
+}
+
+void MipsTargetAsmStreamer::emitDirectiveSetNoMicroMips() {
+ OS << "\t.set\tnomicromips\n";
}
+
void MipsTargetAsmStreamer::emitDirectiveAbiCalls() { OS << "\t.abicalls\n"; }
void MipsTargetAsmStreamer::emitDirectiveOptionPic0() {
OS << "\t.option\tpic0\n";
@@ -56,6 +55,15 @@ void MipsTargetAsmStreamer::emitDirectiveOptionPic0() {
// This part is for ELF object output.
MipsTargetELFStreamer::MipsTargetELFStreamer() {}
+void MipsTargetELFStreamer::emitLabel(MCSymbol *Symbol) {
+ MCSymbolData &Data = getStreamer().getOrCreateSymbolData(Symbol);
+ // The "other" values are stored in the last 6 bits of the second byte
+ // The traditional defines for STO values assume the full byte and thus
+ // the shift to pack it.
+ if (isMicroMipsEnabled())
+ MCELF::setOther(Data, ELF::STO_MIPS_MICROMIPS >> 2);
+}
+
MCELFStreamer &MipsTargetELFStreamer::getStreamer() {
return static_cast<MCELFStreamer &>(*Streamer);
}
@@ -65,14 +73,14 @@ void MipsTargetELFStreamer::emitMipsHackELFFlags(unsigned Flags) {
MCA.setELFHeaderEFlags(Flags);
}
-// Set a symbol's STO flags.
-void MipsTargetELFStreamer::emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val) {
- MCSymbolData &Data = getStreamer().getOrCreateSymbolData(Sym);
- // The "other" values are stored in the last 6 bits of the second byte
- // The traditional defines for STO values assume the full byte and thus
- // the shift to pack it.
- MCELF::setOther(Data, Val >> 2);
+void MipsTargetELFStreamer::emitDirectiveSetMicroMips() {
+ MicroMipsEnabled = true;
+}
+
+void MipsTargetELFStreamer::emitDirectiveSetNoMicroMips() {
+ MicroMipsEnabled = false;
}
+
void MipsTargetELFStreamer::emitDirectiveAbiCalls() {
MCAssembler &MCA = getStreamer().getAssembler();
unsigned Flags = MCA.getELFHeaderEFlags();