From 320296a4cfe414ce59f406b8a5ce15272f563103 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 8 Oct 2013 13:08:17 +0000 Subject: Add a MCTargetStreamer interface. This patch fixes an old FIXME by creating a MCTargetStreamer interface and moving the target specific functions for ARM, Mips and PPC to it. The ARM streamer is still declared in a common place because it is used from lib/CodeGen/ARMException.cpp, but the Mips and PPC are completely hidden in the corresponding Target directories. I will send an email to llvmdev with instructions on how to use this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192181 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp | 55 ------------------------ 1 file changed, 55 deletions(-) delete mode 100644 lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp (limited to 'lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp') diff --git a/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp b/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp deleted file mode 100644 index 1779b92..0000000 --- a/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//===-- MipsELFStreamer.cpp - MipsELFStreamer ---------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===-------------------------------------------------------------------===// -#include "MipsSubtarget.h" -#include "llvm/MC/MCAssembler.h" -#include "llvm/MC/MCELF.h" -#include "llvm/MC/MCELFStreamer.h" -#include "llvm/MC/MCELFSymbolFlags.h" -#include "llvm/MC/MCSymbol.h" -#include "llvm/Support/ELF.h" -#include "llvm/Support/ErrorHandling.h" -using namespace llvm; - -namespace { -class MipsELFStreamer : public MCELFStreamer { -public: - MipsELFStreamer(MCContext &Context, MCAsmBackend &TAB, raw_ostream &OS, - MCCodeEmitter *Emitter, bool RelaxAll, bool NoExecStack) - : MCELFStreamer(Context, TAB, OS, Emitter) {} - - ~MipsELFStreamer() {} - void emitMipsHackELFFlags(unsigned Flags); - void emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val); -}; -} - -namespace llvm { -MCELFStreamer *createMipsELFStreamer(MCContext &Context, MCAsmBackend &TAB, - raw_ostream &OS, MCCodeEmitter *Emitter, - bool RelaxAll, bool NoExecStack) { - MipsELFStreamer *S = - new MipsELFStreamer(Context, TAB, OS, Emitter, RelaxAll, NoExecStack); - return S; -} -} // namespace llvm - -void MipsELFStreamer::emitMipsHackELFFlags(unsigned Flags) { - MCAssembler &MCA = getAssembler(); - - MCA.setELFHeaderEFlags(Flags); -} - -// Set a symbol's STO flags -void MipsELFStreamer::emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val) { - MCSymbolData &Data = getOrCreateSymbolData(Sym); - // The "other" values are stored in the last 6 bits of the second byte - // The traditional defines for STO values assume the full byte and thus - // the shift to pack it. - MCELF::setOther(Data, Val >> 2); -} -- cgit v1.1