[mips][microMIPS] Mark symbols as microMIPS if necessary
[oota-llvm.git] / lib / Target / Mips / MCTargetDesc / MipsELFStreamer.h
index 0bc59eae32e32294226392769c6fc03297b4fed6..136146b9474c99d4a67acb064e0666bca30b3306 100644 (file)
@@ -29,6 +29,8 @@ class MCSubtargetInfo;
 class MipsELFStreamer : public MCELFStreamer {
   SmallVector<std::unique_ptr<MipsOptionRecord>, 8> MipsOptionRecords;
   MipsRegInfoRecord *RegInfoRecord;
+  SmallVector<MCSymbol*, 4> Labels;
+
 
 public:
   MipsELFStreamer(MCContext &Context, MCAsmBackend &MAB, raw_ostream &OS,
@@ -46,6 +48,21 @@ public:
   /// usage for the translation unit.
   void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override;
 
+  /// Overriding this function allows us to record all labels that should be
+  /// marked as microMIPS. Based on this data marking is done in
+  /// EmitInstruction.
+  void EmitLabel(MCSymbol *Symbol) override;
+
+  /// Overriding this function allows us to dismiss all labels that are
+  /// candidates for marking as microMIPS when .section directive is processed.
+  void SwitchSection(const MCSection *Section,
+                     const MCExpr *Subsection = nullptr) override;
+
+  /// Overriding this function allows us to dismiss all labels that are
+  /// candidates for marking as microMIPS when .word directive is emitted.
+  void EmitValueImpl(const MCExpr *Value, unsigned Size,
+                     const SMLoc &Loc) override;
+
   /// Emits all the option records stored up until the point it's called.
   void EmitMipsOptionRecords();
 };