diff options
| author | Matheus Almeida <matheus.almeida@imgtec.com> | 2014-03-27 11:39:03 +0000 |
|---|---|---|
| committer | Matheus Almeida <matheus.almeida@imgtec.com> | 2014-03-27 11:39:03 +0000 |
| commit | dac77fb389d47d188d0ff399889d541c781429b5 (patch) | |
| tree | 1e02cbab7852eb1d2848ffb1d26cc5e11fb9b00b /llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h | |
| parent | cb5ebf66dfad2e0b038a3b4b10ffc084aa68cabc (diff) | |
| download | bcm5719-llvm-dac77fb389d47d188d0ff399889d541c781429b5.tar.gz bcm5719-llvm-dac77fb389d47d188d0ff399889d541c781429b5.zip | |
[mips] Implement custom MCELFStreamer.
This allows us to insert some hooks before emitting data into an actual object file.
For example, we can capture the register usage for a translation unit by overriding
the EmitInstruction method. The register usage information is needed to generate
.reginfo and .Mips.options ELF sections.
No functional changes.
Differential Revision: http://llvm-reviews.chandlerc.com/D3129
llvm-svn: 204917
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h')
| -rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h new file mode 100644 index 00000000000..aea9440ee7a --- /dev/null +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h @@ -0,0 +1,43 @@ +//===-------- MipsELFStreamer.h - ELF Object Output -----------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This is a custom MCELFStreamer which allows us to insert some hooks before +// emitting data into an actual object file. +// +//===----------------------------------------------------------------------===// + +#ifndef MIPSELFSTREAMER_H +#define MIPSELFSTREAMER_H + +#include "llvm/MC/MCELFStreamer.h" +#include "llvm/Support/raw_ostream.h" + +namespace llvm { +class MCAsmBackend; +class MCCodeEmitter; +class MCContext; +class MCSubtargetInfo; + +class MipsELFStreamer : public MCELFStreamer { + const MCSubtargetInfo &STI; + +public: + MipsELFStreamer(MCContext &Context, MCAsmBackend &MAB, raw_ostream &OS, + MCCodeEmitter *Emitter, const MCSubtargetInfo &STI) + : MCELFStreamer(Context, MAB, OS, Emitter), STI(STI) {} + + virtual ~MipsELFStreamer() {} +}; + +MCELFStreamer *createMipsELFStreamer(MCContext &Context, MCAsmBackend &MAB, + raw_ostream &OS, MCCodeEmitter *Emitter, + const MCSubtargetInfo &STI, bool RelaxAll, + bool NoExecStack); +} // namespace llvm. +#endif |

