return Error(Loc, OutputErrMsg.str());
}
- getTargetStreamer().emitDirectiveOptionArchPlus(Ext->Key, PrefixEmitted,
- HasComma);
+ getTargetStreamer().emitDirectiveOptionArchPlusOrMinus(
+ Ext->Key, /*Enable*/ true, PrefixEmitted, HasComma);
} else {
// It is invalid to disable an extension that there are other enabled
// extensions depend on it.
}
clearFeatureBits(Ext->Value, Ext->Key);
- getTargetStreamer().emitDirectiveOptionArchMinus(
- Ext->Key, PrefixEmitted, HasComma);
+ getTargetStreamer().emitDirectiveOptionArchPlusOrMinus(
+ Ext->Key, /*Enable*/ false, PrefixEmitted, HasComma);
}
if (!HasComma)
void RISCVTargetStreamer::emitDirectiveOptionNoRelax() {}
void RISCVTargetStreamer::emitDirectiveVariantCC(MCSymbol &Symbol) {}
void RISCVTargetStreamer::emitDirectiveOptionArchFullArch(StringRef Value,
- bool &hasDotOption) {}
-void RISCVTargetStreamer::emitDirectiveOptionArchPlus(StringRef Value,
- bool &hasDotOption,
- bool EmitComma) {}
-void RISCVTargetStreamer::emitDirectiveOptionArchMinus(StringRef Value,
- bool &hasDotOption,
- bool EmitComma) {}
+ bool &PrefixEmitted) {
+}
+void RISCVTargetStreamer::emitDirectiveOptionArchPlusOrMinus(
+ StringRef Value, bool Enable, bool &PrefixEmitted, bool EmitComma) {}
void RISCVTargetStreamer::emitAttribute(unsigned Attribute, unsigned Value) {}
void RISCVTargetStreamer::finishAttributeSection() {}
void RISCVTargetStreamer::emitTextAttribute(unsigned Attribute,
OS << Value;
emitCommaOrNextLine(OS, false);
}
-void RISCVTargetAsmStreamer::emitDirectiveOptionArchPlus(StringRef Value,
- bool &PrefixEmitted,
- bool EmitComma) {
- emitDirectiveOptionArchPrefix(OS, PrefixEmitted);
- OS << "+" << Value;
- emitCommaOrNextLine(OS, EmitComma);
-}
-void RISCVTargetAsmStreamer::emitDirectiveOptionArchMinus(StringRef Value,
- bool &PrefixEmitted,
- bool EmitComma) {
+
+void RISCVTargetAsmStreamer::emitDirectiveOptionArchPlusOrMinus(
+ StringRef Value, bool Enable, bool &PrefixEmitted, bool EmitComma) {
emitDirectiveOptionArchPrefix(OS, PrefixEmitted);
- OS << "-" << Value;
+ OS << (Enable ? "+" : "-") << Value;
emitCommaOrNextLine(OS, EmitComma);
}
virtual void emitDirectiveVariantCC(MCSymbol &Symbol);
virtual void emitDirectiveOptionArchFullArch(StringRef Value,
bool &PrefixEmitted);
- virtual void emitDirectiveOptionArchPlus(StringRef Value, bool &PrefixEmitted,
- bool EmitComma);
- virtual void emitDirectiveOptionArchMinus(StringRef Value,
- bool &PrefixEmitted,
- bool EmitComma);
+ virtual void emitDirectiveOptionArchPlusOrMinus(StringRef Value, bool Enable,
+ bool &PrefixEmitted,
+ bool EmitComma);
virtual void emitAttribute(unsigned Attribute, unsigned Value);
virtual void finishAttributeSection();
virtual void emitTextAttribute(unsigned Attribute, StringRef String);
void emitDirectiveVariantCC(MCSymbol &Symbol) override;
void emitDirectiveOptionArchFullArch(StringRef Value,
bool &PrefixEmitted) override;
- void emitDirectiveOptionArchPlus(StringRef Value, bool &PrefixEmitted,
- bool EmitComma) override;
- void emitDirectiveOptionArchMinus(StringRef Value, bool &PrefixEmitted,
- bool EmitComma) override;
+ void emitDirectiveOptionArchPlusOrMinus(StringRef Value, bool Enable,
+ bool &PrefixEmitted,
+ bool EmitComma) override;
};
}