mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 06:33:24 +00:00
Remove the "#if 0" that Noone loved. It wasn't really necessary, because the
code within it was the same inside and out. There's still a problem of the TypeInfoSize should be the size of the TType format encoding (at least that's what GCC thinks it should be). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81417 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b8b70521de
commit
43e484fbcf
@ -17,6 +17,7 @@
|
|||||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||||
#include "llvm/CodeGen/MachineFunction.h"
|
#include "llvm/CodeGen/MachineFunction.h"
|
||||||
#include "llvm/CodeGen/MachineLocation.h"
|
#include "llvm/CodeGen/MachineLocation.h"
|
||||||
|
#include "llvm/MC/MCSection.h"
|
||||||
#include "llvm/MC/MCStreamer.h"
|
#include "llvm/MC/MCStreamer.h"
|
||||||
#include "llvm/MC/MCAsmInfo.h"
|
#include "llvm/MC/MCAsmInfo.h"
|
||||||
#include "llvm/Target/TargetData.h"
|
#include "llvm/Target/TargetData.h"
|
||||||
@ -616,7 +617,8 @@ void DwarfException::EmitExceptionTable() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Type infos.
|
// Type infos.
|
||||||
const unsigned TypeInfoSize = TD->getPointerSize(); // DW_EH_PE_absptr
|
// FIXME: Don't hardcode. Should be TType's format encoding size.
|
||||||
|
unsigned TypeInfoSize = SizeOfEncodedValue(dwarf::DW_EH_PE_absptr);
|
||||||
unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
|
unsigned SizeTypes = TypeInfos.size() * TypeInfoSize;
|
||||||
|
|
||||||
unsigned TypeOffset = sizeof(int8_t) + // Call site format
|
unsigned TypeOffset = sizeof(int8_t) + // Call site format
|
||||||
@ -654,8 +656,10 @@ void DwarfException::EmitExceptionTable() {
|
|||||||
Asm->EmitInt8(dwarf::DW_EH_PE_omit);
|
Asm->EmitInt8(dwarf::DW_EH_PE_omit);
|
||||||
Asm->EOL("@LPStart format", dwarf::DW_EH_PE_omit);
|
Asm->EOL("@LPStart format", dwarf::DW_EH_PE_omit);
|
||||||
|
|
||||||
#if 0
|
// For SjLj exceptions, if there is no TypeInfo, then we just explicitly
|
||||||
if (TypeInfos.empty() && FilterIds.empty()) {
|
// say that we're omitting that bit.
|
||||||
|
// FIXME: does this apply to Dwarf also? The above #if 0 implies yes?
|
||||||
|
if (!HaveTTData) {
|
||||||
// If there are no typeinfos or filters, there is nothing to emit, optimize
|
// If there are no typeinfos or filters, there is nothing to emit, optimize
|
||||||
// by specifying the "omit" encoding.
|
// by specifying the "omit" encoding.
|
||||||
Asm->EmitInt8(dwarf::DW_EH_PE_omit);
|
Asm->EmitInt8(dwarf::DW_EH_PE_omit);
|
||||||
@ -681,36 +685,25 @@ void DwarfException::EmitExceptionTable() {
|
|||||||
// need to tell the personality function of the unwinder to indirect
|
// need to tell the personality function of the unwinder to indirect
|
||||||
// through the dyld stub.
|
// through the dyld stub.
|
||||||
//
|
//
|
||||||
// FIXME: When this is actually implemented, we'll have to emit the stubs
|
// FIXME: When (3) is actually implemented, we'll have to emit the stubs
|
||||||
// somewhere. This predicate should be moved to a shared location that is
|
// somewhere. This predicate should be moved to a shared location that is
|
||||||
// in target-independent code.
|
// in target-independent code.
|
||||||
//
|
//
|
||||||
if (LSDASection->isWritable() ||
|
unsigned TTypeFormat;
|
||||||
Asm->TM.getRelocationModel() == Reloc::Static) {
|
|
||||||
Asm->EmitInt8(DW_EH_PE_absptr);
|
if (LSDASection->getKind().isWriteable() ||
|
||||||
Asm->EOL("TType format (DW_EH_PE_absptr)");
|
Asm->TM.getRelocationModel() == Reloc::Static)
|
||||||
} else {
|
TTypeFormat = dwarf::DW_EH_PE_absptr;
|
||||||
Asm->EmitInt8(DW_EH_PE_pcrel | DW_EH_PE_indirect | DW_EH_PE_sdata4);
|
else
|
||||||
Asm->EOL("TType format (DW_EH_PE_pcrel | DW_EH_PE_indirect"
|
TTypeFormat = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
|
||||||
" | DW_EH_PE_sdata4)");
|
dwarf::DW_EH_PE_sdata4;
|
||||||
}
|
|
||||||
Asm->EmitULEB128Bytes(TypeOffset);
|
Asm->EmitInt8(TTypeFormat);
|
||||||
Asm->EOL("TType base offset");
|
Asm->EOL("@TType format", TTypeFormat);
|
||||||
}
|
|
||||||
#else
|
|
||||||
// For SjLj exceptions, if there is no TypeInfo, then we just explicitly
|
|
||||||
// say that we're omitting that bit.
|
|
||||||
// FIXME: does this apply to Dwarf also? The above #if 0 implies yes?
|
|
||||||
if (!HaveTTData) {
|
|
||||||
Asm->EmitInt8(dwarf::DW_EH_PE_omit);
|
|
||||||
Asm->EOL("@TType format", dwarf::DW_EH_PE_omit);
|
|
||||||
} else {
|
|
||||||
Asm->EmitInt8(dwarf::DW_EH_PE_absptr);
|
|
||||||
Asm->EOL("@TType format", dwarf::DW_EH_PE_absptr);
|
|
||||||
Asm->EmitULEB128Bytes(TypeOffset);
|
Asm->EmitULEB128Bytes(TypeOffset);
|
||||||
Asm->EOL("@TType base offset");
|
Asm->EOL("@TType base offset");
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// SjLj Exception handilng
|
// SjLj Exception handilng
|
||||||
if (IsSJLJ) {
|
if (IsSJLJ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user