2018-01-26 15:53:07 +08:00
|
|
|
//===-- RISCVELFStreamer.cpp - RISCV ELF Target Streamer Methods ----------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file provides RISCV specific target streamer methods.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "RISCVELFStreamer.h"
|
|
|
|
#include "RISCVMCTargetDesc.h"
|
|
|
|
#include "llvm/BinaryFormat/ELF.h"
|
|
|
|
#include "llvm/MC/MCSubtargetInfo.h"
|
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
// This part is for ELF object output.
|
|
|
|
RISCVTargetELFStreamer::RISCVTargetELFStreamer(MCStreamer &S,
|
|
|
|
const MCSubtargetInfo &STI)
|
|
|
|
: RISCVTargetStreamer(S) {
|
|
|
|
MCAssembler &MCA = getStreamer().getAssembler();
|
|
|
|
|
|
|
|
const FeatureBitset &Features = STI.getFeatureBits();
|
|
|
|
|
|
|
|
unsigned EFlags = MCA.getELFHeaderEFlags();
|
|
|
|
|
|
|
|
if (Features[RISCV::FeatureStdExtC])
|
|
|
|
EFlags |= ELF::EF_RISCV_RVC;
|
|
|
|
|
|
|
|
MCA.setELFHeaderEFlags(EFlags);
|
|
|
|
}
|
|
|
|
|
|
|
|
MCELFStreamer &RISCVTargetELFStreamer::getStreamer() {
|
|
|
|
return static_cast<MCELFStreamer &>(Streamer);
|
|
|
|
}
|
2018-05-12 01:30:28 +08:00
|
|
|
|
|
|
|
void RISCVTargetELFStreamer::emitDirectiveOptionRVC() {}
|
|
|
|
void RISCVTargetELFStreamer::emitDirectiveOptionNoRVC() {}
|