LLVM  8.0.1
RISCVELFStreamer.cpp
Go to the documentation of this file.
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"
18 
19 using namespace llvm;
20 
21 // This part is for ELF object output.
23  const MCSubtargetInfo &STI)
24  : RISCVTargetStreamer(S) {
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 
38  return static_cast<MCELFStreamer &>(Streamer);
39 }
40 
void setELFHeaderEFlags(unsigned Flags)
Definition: MCAssembler.h:256
RISCVTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
This class represents lattice values for constants.
Definition: AllocatorList.h:24
const FeatureBitset Features
virtual void emitDirectiveOptionNoRelax()
const FeatureBitset & getFeatureBits() const
Streaming machine code generation interface.
Definition: MCStreamer.h:189
Container class for subtarget features.
MCAssembler & getAssembler()
unsigned getELFHeaderEFlags() const
ELF e_header flags.
Definition: MCAssembler.h:255
MCStreamer & Streamer
Definition: MCStreamer.h:86
Generic base class for all target subtargets.