59 lines · c
1//===-- XtensaTargetStreamer.h - Xtensa Target Streamer --------*- C++ -*--===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLVM_LIB_TARGET_XTENSA_XTENSATARGETSTREAMER_H10#define LLVM_LIB_TARGET_XTENSA_XTENSATARGETSTREAMER_H11 12#include "llvm/MC/MCELFStreamer.h"13#include "llvm/MC/MCStreamer.h"14#include "llvm/Support/SMLoc.h"15 16namespace llvm {17class formatted_raw_ostream;18 19class XtensaTargetStreamer : public MCTargetStreamer {20public:21 XtensaTargetStreamer(MCStreamer &S);22 23 // Emit literal label and literal Value to the literal section. If literal24 // section is not switched yet (SwitchLiteralSection is true) then switch to25 // literal section.26 virtual void emitLiteral(MCSymbol *LblSym, const MCExpr *Value,27 bool SwitchLiteralSection, SMLoc L = SMLoc()) = 0;28 29 virtual void emitLiteralPosition() = 0;30 31 // Switch to the literal section. The BaseSection name is used to construct32 // literal section name.33 virtual void startLiteralSection(MCSection *BaseSection) = 0;34};35 36class XtensaTargetAsmStreamer : public XtensaTargetStreamer {37 formatted_raw_ostream &OS;38 39public:40 XtensaTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS);41 void emitLiteral(MCSymbol *LblSym, const MCExpr *Value,42 bool SwitchLiteralSection, SMLoc L) override;43 void emitLiteralPosition() override;44 void startLiteralSection(MCSection *Section) override;45};46 47class XtensaTargetELFStreamer : public XtensaTargetStreamer {48public:49 XtensaTargetELFStreamer(MCStreamer &S);50 MCELFStreamer &getStreamer();51 void emitLiteral(MCSymbol *LblSym, const MCExpr *Value,52 bool SwitchLiteralSection, SMLoc L) override;53 void emitLiteralPosition() override {}54 void startLiteralSection(MCSection *Section) override;55};56} // end namespace llvm57 58#endif // LLVM_LIB_TARGET_XTENSA_XTENSATARGETSTREAMER_H59