14ba319b5SDimitry Andric //===-- RISCVELFStreamer.cpp - RISCV ELF Target Streamer Methods ----------===// 24ba319b5SDimitry Andric // 34ba319b5SDimitry Andric // The LLVM Compiler Infrastructure 44ba319b5SDimitry Andric // 54ba319b5SDimitry Andric // This file is distributed under the University of Illinois Open Source 64ba319b5SDimitry Andric // License. See LICENSE.TXT for details. 74ba319b5SDimitry Andric // 84ba319b5SDimitry Andric //===----------------------------------------------------------------------===// 94ba319b5SDimitry Andric // 104ba319b5SDimitry Andric // This file provides RISCV specific target streamer methods. 114ba319b5SDimitry Andric // 124ba319b5SDimitry Andric //===----------------------------------------------------------------------===// 134ba319b5SDimitry Andric 144ba319b5SDimitry Andric #include "RISCVELFStreamer.h" 154ba319b5SDimitry Andric #include "RISCVMCTargetDesc.h" 164ba319b5SDimitry Andric #include "llvm/BinaryFormat/ELF.h" 174ba319b5SDimitry Andric #include "llvm/MC/MCSubtargetInfo.h" 184ba319b5SDimitry Andric 194ba319b5SDimitry Andric using namespace llvm; 204ba319b5SDimitry Andric 214ba319b5SDimitry Andric // This part is for ELF object output. RISCVTargetELFStreamer(MCStreamer & S,const MCSubtargetInfo & STI)224ba319b5SDimitry AndricRISCVTargetELFStreamer::RISCVTargetELFStreamer(MCStreamer &S, 234ba319b5SDimitry Andric const MCSubtargetInfo &STI) 244ba319b5SDimitry Andric : RISCVTargetStreamer(S) { 254ba319b5SDimitry Andric MCAssembler &MCA = getStreamer().getAssembler(); 264ba319b5SDimitry Andric 274ba319b5SDimitry Andric const FeatureBitset &Features = STI.getFeatureBits(); 284ba319b5SDimitry Andric 294ba319b5SDimitry Andric unsigned EFlags = MCA.getELFHeaderEFlags(); 304ba319b5SDimitry Andric 314ba319b5SDimitry Andric if (Features[RISCV::FeatureStdExtC]) 324ba319b5SDimitry Andric EFlags |= ELF::EF_RISCV_RVC; 334ba319b5SDimitry Andric 344ba319b5SDimitry Andric MCA.setELFHeaderEFlags(EFlags); 354ba319b5SDimitry Andric } 364ba319b5SDimitry Andric getStreamer()374ba319b5SDimitry AndricMCELFStreamer &RISCVTargetELFStreamer::getStreamer() { 384ba319b5SDimitry Andric return static_cast<MCELFStreamer &>(Streamer); 394ba319b5SDimitry Andric } 404ba319b5SDimitry Andric emitDirectiveOptionPush()41*b5893f02SDimitry Andricvoid RISCVTargetELFStreamer::emitDirectiveOptionPush() {} emitDirectiveOptionPop()42*b5893f02SDimitry Andricvoid RISCVTargetELFStreamer::emitDirectiveOptionPop() {} emitDirectiveOptionRVC()434ba319b5SDimitry Andricvoid RISCVTargetELFStreamer::emitDirectiveOptionRVC() {} emitDirectiveOptionNoRVC()444ba319b5SDimitry Andricvoid RISCVTargetELFStreamer::emitDirectiveOptionNoRVC() {} emitDirectiveOptionRelax()45*b5893f02SDimitry Andricvoid RISCVTargetELFStreamer::emitDirectiveOptionRelax() {} emitDirectiveOptionNoRelax()46*b5893f02SDimitry Andricvoid RISCVTargetELFStreamer::emitDirectiveOptionNoRelax() {} 47