aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-10-08 13:08:17 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-10-08 13:08:17 +0000
commit320296a4cfe414ce59f406b8a5ce15272f563103 (patch)
treeadb8ac19e1ad3d948795c00cd022008111a6e199 /lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp
parent26c46ba11c9c614ee79ed7f5c505578187fb2971 (diff)
downloadexternal_llvm-320296a4cfe414ce59f406b8a5ce15272f563103.zip
external_llvm-320296a4cfe414ce59f406b8a5ce15272f563103.tar.gz
external_llvm-320296a4cfe414ce59f406b8a5ce15272f563103.tar.bz2
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
Diffstat (limited to 'lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp')
-rw-r--r--lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp55
1 files changed, 0 insertions, 55 deletions
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);
-}