diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-06-03 17:47:27 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-06-03 17:47:27 +0000 |
commit | 4cb31436bd90ace0e41c6aad801371538996d8c7 (patch) | |
tree | 0304477b2cafe8d3723eeeb894fa602f9bd358f1 /lib/CodeGen/ELFCodeEmitter.h | |
parent | bae049cd9ed7a7ac683df04f457c301df082c6cb (diff) | |
download | external_llvm-4cb31436bd90ace0e41c6aad801371538996d8c7.zip external_llvm-4cb31436bd90ace0e41c6aad801371538996d8c7.tar.gz external_llvm-4cb31436bd90ace0e41c6aad801371538996d8c7.tar.bz2 |
Move ELFCodeEmiter stuff to new files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ELFCodeEmitter.h')
-rw-r--r-- | lib/CodeGen/ELFCodeEmitter.h | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/lib/CodeGen/ELFCodeEmitter.h b/lib/CodeGen/ELFCodeEmitter.h new file mode 100644 index 0000000..11ebcc8 --- /dev/null +++ b/lib/CodeGen/ELFCodeEmitter.h @@ -0,0 +1,87 @@ +//===-- lib/CodeGen/ELFCodeEmitter.h ----------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef ELFCODEEMITTER_H +#define ELFCODEEMITTER_H + +#include "ELFWriter.h" +#include "llvm/CodeGen/MachineCodeEmitter.h" +#include <vector> + +namespace llvm { + + /// ELFCodeEmitter - This class is used by the ELFWriter to + /// emit the code for functions to the ELF file. + class ELFCodeEmitter : public MachineCodeEmitter { + ELFWriter &EW; + TargetMachine &TM; + ELFWriter::ELFSection *ES; // Section to write to. + std::vector<unsigned char> *OutBuffer; + size_t FnStart; + public: + explicit ELFCodeEmitter(ELFWriter &ew) : EW(ew), TM(EW.TM), OutBuffer(0) {} + + void startFunction(MachineFunction &F); + bool finishFunction(MachineFunction &F); + + void addRelocation(const MachineRelocation &MR) { + assert(0 && "relo not handled yet!"); + } + + virtual void StartMachineBasicBlock(MachineBasicBlock *MBB) { + } + + virtual uintptr_t getConstantPoolEntryAddress(unsigned Index) const { + assert(0 && "CP not implementated yet!"); + return 0; + } + virtual uintptr_t getJumpTableEntryAddress(unsigned Index) const { + assert(0 && "JT not implementated yet!"); + return 0; + } + + virtual uintptr_t getMachineBasicBlockAddress(MachineBasicBlock *MBB) const { + assert(0 && "JT not implementated yet!"); + return 0; + } + + virtual uintptr_t getLabelAddress(uint64_t Label) const { + assert(0 && "Label address not implementated yet!"); + abort(); + return 0; + } + + virtual void emitLabel(uint64_t LabelID) { + assert(0 && "emit Label not implementated yet!"); + abort(); + } + + virtual void setModuleInfo(llvm::MachineModuleInfo* MMI) { } + + /// JIT SPECIFIC FUNCTIONS - DO NOT IMPLEMENT THESE HERE! + void startGVStub(const GlobalValue* F, unsigned StubSize, + unsigned Alignment = 1) { + assert(0 && "JIT specific function called!"); + abort(); + } + void startGVStub(const GlobalValue* F, void *Buffer, unsigned StubSize) { + assert(0 && "JIT specific function called!"); + abort(); + } + void *finishGVStub(const GlobalValue *F) { + assert(0 && "JIT specific function called!"); + abort(); + return 0; + } +}; // end class ELFCodeEmitter + +} // end namespace llvm + +#endif + |