Index: lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp =================================================================== --- lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -33,15 +33,21 @@ void MipsTargetStreamer::emitDirectiveSetMicroMips() {} void MipsTargetStreamer::emitDirectiveSetNoMicroMips() {} void MipsTargetStreamer::emitDirectiveSetMips16() {} -void MipsTargetStreamer::emitDirectiveSetNoMips16() {} -void MipsTargetStreamer::emitDirectiveSetReorder() {} +void MipsTargetStreamer::emitDirectiveSetNoMips16() { + setCanHaveModuleDir(false); +} +void MipsTargetStreamer::emitDirectiveSetReorder() { + setCanHaveModuleDir(false); +} void MipsTargetStreamer::emitDirectiveSetNoReorder() {} -void MipsTargetStreamer::emitDirectiveSetMacro() {} -void MipsTargetStreamer::emitDirectiveSetNoMacro() {} +void MipsTargetStreamer::emitDirectiveSetMacro() { setCanHaveModuleDir(false); } +void MipsTargetStreamer::emitDirectiveSetNoMacro() { + setCanHaveModuleDir(false); +} void MipsTargetStreamer::emitDirectiveSetMsa() { setCanHaveModuleDir(false); } void MipsTargetStreamer::emitDirectiveSetNoMsa() { setCanHaveModuleDir(false); } -void MipsTargetStreamer::emitDirectiveSetAt() {} -void MipsTargetStreamer::emitDirectiveSetNoAt() {} +void MipsTargetStreamer::emitDirectiveSetAt() { setCanHaveModuleDir(false); } +void MipsTargetStreamer::emitDirectiveSetNoAt() { setCanHaveModuleDir(false); } void MipsTargetStreamer::emitDirectiveEnd(StringRef Name) {} void MipsTargetStreamer::emitDirectiveEnt(const MCSymbol &Symbol) {} void MipsTargetStreamer::emitDirectiveAbiCalls() {} @@ -54,18 +60,30 @@ void MipsTargetStreamer::emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) {} void MipsTargetStreamer::emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) { } -void MipsTargetStreamer::emitDirectiveSetMips1() {} -void MipsTargetStreamer::emitDirectiveSetMips2() {} -void MipsTargetStreamer::emitDirectiveSetMips3() {} -void MipsTargetStreamer::emitDirectiveSetMips4() {} -void MipsTargetStreamer::emitDirectiveSetMips5() {} -void MipsTargetStreamer::emitDirectiveSetMips32() {} -void MipsTargetStreamer::emitDirectiveSetMips32R2() {} -void MipsTargetStreamer::emitDirectiveSetMips32R6() {} -void MipsTargetStreamer::emitDirectiveSetMips64() {} -void MipsTargetStreamer::emitDirectiveSetMips64R2() {} -void MipsTargetStreamer::emitDirectiveSetMips64R6() {} -void MipsTargetStreamer::emitDirectiveSetDsp() {} +void MipsTargetStreamer::emitDirectiveSetMips1() { setCanHaveModuleDir(false); } +void MipsTargetStreamer::emitDirectiveSetMips2() { setCanHaveModuleDir(false); } +void MipsTargetStreamer::emitDirectiveSetMips3() { setCanHaveModuleDir(false); } +void MipsTargetStreamer::emitDirectiveSetMips4() { setCanHaveModuleDir(false); } +void MipsTargetStreamer::emitDirectiveSetMips5() { setCanHaveModuleDir(false); } +void MipsTargetStreamer::emitDirectiveSetMips32() { + setCanHaveModuleDir(false); +} +void MipsTargetStreamer::emitDirectiveSetMips32R2() { + setCanHaveModuleDir(false); +} +void MipsTargetStreamer::emitDirectiveSetMips32R6() { + setCanHaveModuleDir(false); +} +void MipsTargetStreamer::emitDirectiveSetMips64() { + setCanHaveModuleDir(false); +} +void MipsTargetStreamer::emitDirectiveSetMips64R2() { + setCanHaveModuleDir(false); +} +void MipsTargetStreamer::emitDirectiveSetMips64R6() { + setCanHaveModuleDir(false); +} +void MipsTargetStreamer::emitDirectiveSetDsp() { setCanHaveModuleDir(false); } void MipsTargetStreamer::emitDirectiveCpload(unsigned RegNo) {} void MipsTargetStreamer::emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset, const MCSymbol &Sym, bool IsReg) { @@ -97,12 +115,12 @@ void MipsTargetAsmStreamer::emitDirectiveSetNoMips16() { OS << "\t.set\tnomips16\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetNoMips16(); } void MipsTargetAsmStreamer::emitDirectiveSetReorder() { OS << "\t.set\treorder\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetReorder(); } void MipsTargetAsmStreamer::emitDirectiveSetNoReorder() { @@ -112,12 +130,12 @@ void MipsTargetAsmStreamer::emitDirectiveSetMacro() { OS << "\t.set\tmacro\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMacro(); } void MipsTargetAsmStreamer::emitDirectiveSetNoMacro() { OS << "\t.set\tnomacro\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetNoMacro(); } void MipsTargetAsmStreamer::emitDirectiveSetMsa() { @@ -132,12 +150,12 @@ void MipsTargetAsmStreamer::emitDirectiveSetAt() { OS << "\t.set\tat\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetAt(); } void MipsTargetAsmStreamer::emitDirectiveSetNoAt() { OS << "\t.set\tnoat\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetNoAt(); } void MipsTargetAsmStreamer::emitDirectiveEnd(StringRef Name) { @@ -174,62 +192,62 @@ void MipsTargetAsmStreamer::emitDirectiveSetMips1() { OS << "\t.set\tmips1\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips1(); } void MipsTargetAsmStreamer::emitDirectiveSetMips2() { OS << "\t.set\tmips2\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips2(); } void MipsTargetAsmStreamer::emitDirectiveSetMips3() { OS << "\t.set\tmips3\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips3(); } void MipsTargetAsmStreamer::emitDirectiveSetMips4() { OS << "\t.set\tmips4\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips4(); } void MipsTargetAsmStreamer::emitDirectiveSetMips5() { OS << "\t.set\tmips5\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips5(); } void MipsTargetAsmStreamer::emitDirectiveSetMips32() { OS << "\t.set\tmips32\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips32(); } void MipsTargetAsmStreamer::emitDirectiveSetMips32R2() { OS << "\t.set\tmips32r2\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips32R2(); } void MipsTargetAsmStreamer::emitDirectiveSetMips32R6() { OS << "\t.set\tmips32r6\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips32R6(); } void MipsTargetAsmStreamer::emitDirectiveSetMips64() { OS << "\t.set\tmips64\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips64(); } void MipsTargetAsmStreamer::emitDirectiveSetMips64R2() { OS << "\t.set\tmips64r2\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips64R2(); } void MipsTargetAsmStreamer::emitDirectiveSetMips64R6() { OS << "\t.set\tmips64r6\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetMips64R6(); } void MipsTargetAsmStreamer::emitDirectiveSetDsp() { OS << "\t.set\tdsp\n"; - setCanHaveModuleDir(false); + MipsTargetStreamer::emitDirectiveSetDsp(); } // Print a 32 bit hex number with all numbers. static void printHex32(unsigned Value, raw_ostream &OS) { @@ -438,6 +456,7 @@ unsigned Flags = MCA.getELFHeaderEFlags(); Flags |= ELF::EF_MIPS_MICROMIPS; MCA.setELFHeaderEFlags(Flags); + setCanHaveModuleDir(false); } void MipsTargetELFStreamer::emitDirectiveSetNoMicroMips() { @@ -453,16 +472,6 @@ setCanHaveModuleDir(false); } -void MipsTargetELFStreamer::emitDirectiveSetNoMips16() { - // FIXME: implement. - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetReorder() { - // FIXME: implement. - setCanHaveModuleDir(false); -} - void MipsTargetELFStreamer::emitDirectiveSetNoReorder() { MCAssembler &MCA = getStreamer().getAssembler(); unsigned Flags = MCA.getELFHeaderEFlags(); @@ -471,26 +480,6 @@ setCanHaveModuleDir(false); } -void MipsTargetELFStreamer::emitDirectiveSetMacro() { - // FIXME: implement. - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetNoMacro() { - // FIXME: implement. - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetAt() { - // FIXME: implement. - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetNoAt() { - // FIXME: implement. - setCanHaveModuleDir(false); -} - void MipsTargetELFStreamer::emitDirectiveEnd(StringRef Name) { // FIXME: implement. } @@ -556,54 +545,6 @@ // FIXME: implement. } -void MipsTargetELFStreamer::emitDirectiveSetMips1() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetMips2() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetMips3() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetMips4() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetMips5() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetMips32() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetMips32R2() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetMips32R6() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetMips64() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetMips64R2() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetMips64R6() { - setCanHaveModuleDir(false); -} - -void MipsTargetELFStreamer::emitDirectiveSetDsp() { - setCanHaveModuleDir(false); -} - void MipsTargetELFStreamer::emitDirectiveCpload(unsigned RegNo) { // .cpload $reg // This directive expands to: Index: lib/Target/Mips/MipsTargetStreamer.h =================================================================== --- lib/Target/Mips/MipsTargetStreamer.h +++ lib/Target/Mips/MipsTargetStreamer.h @@ -177,14 +177,8 @@ void emitDirectiveSetMicroMips() override; void emitDirectiveSetNoMicroMips() override; void emitDirectiveSetMips16() override; - void emitDirectiveSetNoMips16() override; - void emitDirectiveSetReorder() override; void emitDirectiveSetNoReorder() override; - void emitDirectiveSetMacro() override; - void emitDirectiveSetNoMacro() override; - void emitDirectiveSetAt() override; - void emitDirectiveSetNoAt() override; void emitDirectiveEnd(StringRef Name) override; void emitDirectiveEnt(const MCSymbol &Symbol) override; @@ -198,19 +192,6 @@ void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override; void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override; - void emitDirectiveSetMips1() override; - void emitDirectiveSetMips2() override; - void emitDirectiveSetMips3() override; - void emitDirectiveSetMips4() override; - void emitDirectiveSetMips5() override; - void emitDirectiveSetMips32() override; - void emitDirectiveSetMips32R2() override; - void emitDirectiveSetMips32R6() override; - void emitDirectiveSetMips64() override; - void emitDirectiveSetMips64R2() override; - void emitDirectiveSetMips64R6() override; - void emitDirectiveSetDsp() override; - // PIC support virtual void emitDirectiveCpload(unsigned RegNo); void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset,