2018-01-26 15:53:07 +08:00
|
|
|
//===-- RISCVTargetStreamer.h - RISCV Target Streamer ----------*- C++ -*--===//
|
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2018-01-26 15:53:07 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_LIB_TARGET_RISCV_RISCVTARGETSTREAMER_H
|
|
|
|
#define LLVM_LIB_TARGET_RISCV_RISCVTARGETSTREAMER_H
|
|
|
|
|
|
|
|
#include "llvm/MC/MCStreamer.h"
|
2020-02-04 22:20:10 +08:00
|
|
|
#include "llvm/MC/MCSubtargetInfo.h"
|
2018-01-26 15:53:07 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class RISCVTargetStreamer : public MCTargetStreamer {
|
|
|
|
public:
|
|
|
|
RISCVTargetStreamer(MCStreamer &S);
|
2020-02-04 22:20:10 +08:00
|
|
|
void finish() override;
|
2018-05-12 01:30:28 +08:00
|
|
|
|
[RISCV] Register null target streamer for RISC-V
Summary:
This fixes two llc crashes with the following tests when RISC-V is the default
target.
LLVM :: DebugInfo/Generic/global.ll
LLVM :: DebugInfo/Generic/inlined-strings.ll
Reviewers: HsiangKai
Reviewed By: HsiangKai
Subscribers: hiraditya, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, sameer.abuasal, apazos, luismarques, evandro, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80352
2020-05-21 10:12:36 +08:00
|
|
|
virtual void emitDirectiveOptionPush();
|
|
|
|
virtual void emitDirectiveOptionPop();
|
|
|
|
virtual void emitDirectiveOptionPIC();
|
|
|
|
virtual void emitDirectiveOptionNoPIC();
|
|
|
|
virtual void emitDirectiveOptionRVC();
|
|
|
|
virtual void emitDirectiveOptionNoRVC();
|
|
|
|
virtual void emitDirectiveOptionRelax();
|
|
|
|
virtual void emitDirectiveOptionNoRelax();
|
|
|
|
virtual void emitAttribute(unsigned Attribute, unsigned Value);
|
|
|
|
virtual void finishAttributeSection();
|
|
|
|
virtual void emitTextAttribute(unsigned Attribute, StringRef String);
|
2020-02-04 22:20:10 +08:00
|
|
|
virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
|
[RISCV] Register null target streamer for RISC-V
Summary:
This fixes two llc crashes with the following tests when RISC-V is the default
target.
LLVM :: DebugInfo/Generic/global.ll
LLVM :: DebugInfo/Generic/inlined-strings.ll
Reviewers: HsiangKai
Reviewed By: HsiangKai
Subscribers: hiraditya, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, sameer.abuasal, apazos, luismarques, evandro, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D80352
2020-05-21 10:12:36 +08:00
|
|
|
StringRef StringValue);
|
2020-02-04 22:20:10 +08:00
|
|
|
|
|
|
|
void emitTargetAttributes(const MCSubtargetInfo &STI);
|
2018-01-26 15:53:07 +08:00
|
|
|
};
|
2018-05-12 01:30:28 +08:00
|
|
|
|
|
|
|
// This part is for ascii assembly output
|
|
|
|
class RISCVTargetAsmStreamer : public RISCVTargetStreamer {
|
|
|
|
formatted_raw_ostream &OS;
|
|
|
|
|
2020-02-04 22:20:10 +08:00
|
|
|
void finishAttributeSection() override;
|
|
|
|
void emitAttribute(unsigned Attribute, unsigned Value) override;
|
|
|
|
void emitTextAttribute(unsigned Attribute, StringRef String) override;
|
|
|
|
void emitIntTextAttribute(unsigned Attribute, unsigned IntValue,
|
|
|
|
StringRef StringValue) override;
|
|
|
|
|
2018-05-12 01:30:28 +08:00
|
|
|
public:
|
|
|
|
RISCVTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS);
|
|
|
|
|
2018-11-29 00:39:14 +08:00
|
|
|
void emitDirectiveOptionPush() override;
|
|
|
|
void emitDirectiveOptionPop() override;
|
2020-04-17 15:39:49 +08:00
|
|
|
void emitDirectiveOptionPIC() override;
|
|
|
|
void emitDirectiveOptionNoPIC() override;
|
2018-05-12 01:30:28 +08:00
|
|
|
void emitDirectiveOptionRVC() override;
|
|
|
|
void emitDirectiveOptionNoRVC() override;
|
2018-11-12 22:25:07 +08:00
|
|
|
void emitDirectiveOptionRelax() override;
|
|
|
|
void emitDirectiveOptionNoRelax() override;
|
2018-05-12 01:30:28 +08:00
|
|
|
};
|
|
|
|
|
2018-01-26 15:53:07 +08:00
|
|
|
}
|
|
|
|
#endif
|