2008-02-13 18:39:37 +00:00
|
|
|
//===------ JITDwarfEmitter.h - Write dwarf tables into memory ------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines a JITDwarfEmitter object that is used by the JIT to
|
|
|
|
// write dwarf tables to memory.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
|
|
|
|
#define LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class Function;
|
2009-05-30 20:51:52 +00:00
|
|
|
class JITCodeEmitter;
|
2008-02-13 18:39:37 +00:00
|
|
|
class MachineFunction;
|
|
|
|
class MachineModuleInfo;
|
|
|
|
class MachineMove;
|
|
|
|
class TargetData;
|
|
|
|
class TargetMachine;
|
|
|
|
class TargetRegisterInfo;
|
|
|
|
|
|
|
|
class JITDwarfEmitter {
|
|
|
|
const TargetData* TD;
|
2009-05-30 20:51:52 +00:00
|
|
|
JITCodeEmitter* JCE;
|
2008-02-13 18:39:37 +00:00
|
|
|
const TargetRegisterInfo* RI;
|
|
|
|
MachineModuleInfo* MMI;
|
|
|
|
JIT& Jit;
|
|
|
|
bool needsIndirectEncoding;
|
|
|
|
bool stackGrowthDirection;
|
|
|
|
|
|
|
|
unsigned char* EmitExceptionTable(MachineFunction* MF,
|
|
|
|
unsigned char* StartFunction,
|
2008-04-20 17:44:19 +00:00
|
|
|
unsigned char* EndFunction) const;
|
2008-02-13 18:39:37 +00:00
|
|
|
|
|
|
|
void EmitFrameMoves(intptr_t BaseLabelPtr,
|
2008-04-20 17:44:19 +00:00
|
|
|
const std::vector<MachineMove> &Moves) const;
|
2008-02-13 18:39:37 +00:00
|
|
|
|
2008-04-20 17:44:19 +00:00
|
|
|
unsigned char* EmitCommonEHFrame(const Function* Personality) const;
|
2008-02-13 18:39:37 +00:00
|
|
|
|
|
|
|
unsigned char* EmitEHFrame(const Function* Personality,
|
|
|
|
unsigned char* StartBufferPtr,
|
|
|
|
unsigned char* StartFunction,
|
|
|
|
unsigned char* EndFunction,
|
2008-04-20 17:44:19 +00:00
|
|
|
unsigned char* ExceptionTable) const;
|
2008-02-13 18:39:37 +00:00
|
|
|
|
2008-04-20 17:44:19 +00:00
|
|
|
unsigned GetExceptionTableSizeInBytes(MachineFunction* MF) const;
|
2008-04-18 20:59:31 +00:00
|
|
|
|
2008-04-20 17:44:19 +00:00
|
|
|
unsigned
|
|
|
|
GetFrameMovesSizeInBytes(intptr_t BaseLabelPtr,
|
|
|
|
const std::vector<MachineMove> &Moves) const;
|
2008-04-18 20:59:31 +00:00
|
|
|
|
2008-04-20 17:44:19 +00:00
|
|
|
unsigned GetCommonEHFrameSizeInBytes(const Function* Personality) const;
|
2008-02-13 18:39:37 +00:00
|
|
|
|
2008-04-20 17:44:19 +00:00
|
|
|
unsigned GetEHFrameSizeInBytes(const Function* Personality,
|
|
|
|
unsigned char* StartFunction) const;
|
2008-04-18 20:59:31 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
JITDwarfEmitter(JIT& jit);
|
|
|
|
|
2008-02-13 18:39:37 +00:00
|
|
|
unsigned char* EmitDwarfTable(MachineFunction& F,
|
2009-05-30 20:51:52 +00:00
|
|
|
JITCodeEmitter& JCE,
|
2008-02-13 18:39:37 +00:00
|
|
|
unsigned char* StartFunction,
|
|
|
|
unsigned char* EndFunction);
|
|
|
|
|
2008-04-18 20:59:31 +00:00
|
|
|
|
2008-04-20 17:44:19 +00:00
|
|
|
unsigned GetDwarfTableSizeInBytes(MachineFunction& F,
|
2009-05-30 20:51:52 +00:00
|
|
|
JITCodeEmitter& JCE,
|
2008-04-20 17:44:19 +00:00
|
|
|
unsigned char* StartFunction,
|
|
|
|
unsigned char* EndFunction);
|
2008-04-18 20:59:31 +00:00
|
|
|
|
2008-02-13 18:39:37 +00:00
|
|
|
void setModuleInfo(MachineModuleInfo* Info) {
|
|
|
|
MMI = Info;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-04-18 20:59:31 +00:00
|
|
|
|
2008-02-13 18:39:37 +00:00
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif // LLVM_EXECUTION_ENGINE_JIT_DWARFEMITTER_H
|