1 //===-- RISCVELFStreamer.cpp - RISCV ELF Target Streamer Methods ----------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file provides RISCV specific target streamer methods. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #include "RISCVELFStreamer.h" 15 #include "RISCVMCTargetDesc.h" 16 #include "llvm/BinaryFormat/ELF.h" 17 #include "llvm/MC/MCSubtargetInfo.h" 18 19 using namespace llvm; 20 21 // This part is for ELF object output. 22 RISCVTargetELFStreamer::RISCVTargetELFStreamer(MCStreamer &S, 23 const MCSubtargetInfo &STI) 24 : RISCVTargetStreamer(S) { 25 MCAssembler &MCA = getStreamer().getAssembler(); 26 27 const FeatureBitset &Features = STI.getFeatureBits(); 28 29 unsigned EFlags = MCA.getELFHeaderEFlags(); 30 31 if (Features[RISCV::FeatureStdExtC]) 32 EFlags |= ELF::EF_RISCV_RVC; 33 34 MCA.setELFHeaderEFlags(EFlags); 35 } 36 37 MCELFStreamer &RISCVTargetELFStreamer::getStreamer() { 38 return static_cast<MCELFStreamer &>(Streamer); 39 } 40 41 void RISCVTargetELFStreamer::emitDirectiveOptionPush() {} 42 void RISCVTargetELFStreamer::emitDirectiveOptionPop() {} 43 void RISCVTargetELFStreamer::emitDirectiveOptionRVC() {} 44 void RISCVTargetELFStreamer::emitDirectiveOptionNoRVC() {} 45 void RISCVTargetELFStreamer::emitDirectiveOptionRelax() {} 46 void RISCVTargetELFStreamer::emitDirectiveOptionNoRelax() {} 47