mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-20 09:30:43 +00:00
simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100350 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ca6190b108
commit
9be4913136
@ -334,6 +334,15 @@ namespace llvm {
|
|||||||
void EmitULEB128(unsigned Value, const char *Desc = 0,
|
void EmitULEB128(unsigned Value, const char *Desc = 0,
|
||||||
unsigned PadTo = 0) const;
|
unsigned PadTo = 0) const;
|
||||||
|
|
||||||
|
/// EmitCFAByte - Emit a .byte 42 directive for a DW_CFA_xxx value.
|
||||||
|
void EmitCFAByte(unsigned Val) const;
|
||||||
|
|
||||||
|
/// EmitEncodingByte - Emit a .byte 42 directive that corresponds to an
|
||||||
|
/// encoding. If verbose assembly output is enabled, we output comments
|
||||||
|
/// describing the encoding. Desc is a string saying what the encoding is
|
||||||
|
/// specifying (e.g. "LSDA").
|
||||||
|
void EmitEncodingByte(unsigned Val, const char *Desc = 0);
|
||||||
|
|
||||||
//===------------------------------------------------------------------===//
|
//===------------------------------------------------------------------===//
|
||||||
// Inline Asm Support
|
// Inline Asm Support
|
||||||
//===------------------------------------------------------------------===//
|
//===------------------------------------------------------------------===//
|
||||||
|
@ -354,7 +354,7 @@ ComputeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads,
|
|||||||
I = LandingPads.begin(), E = LandingPads.end(); I != E; ++I) {
|
I = LandingPads.begin(), E = LandingPads.end(); I != E; ++I) {
|
||||||
const LandingPadInfo *LPI = *I;
|
const LandingPadInfo *LPI = *I;
|
||||||
const std::vector<int> &TypeIds = LPI->TypeIds;
|
const std::vector<int> &TypeIds = LPI->TypeIds;
|
||||||
const unsigned NumShared = PrevLPI ? SharedTypeIds(LPI, PrevLPI) : 0;
|
unsigned NumShared = PrevLPI ? SharedTypeIds(LPI, PrevLPI) : 0;
|
||||||
unsigned SizeSiteActions = 0;
|
unsigned SizeSiteActions = 0;
|
||||||
|
|
||||||
if (NumShared < TypeIds.size()) {
|
if (NumShared < TypeIds.size()) {
|
||||||
@ -362,7 +362,7 @@ ComputeActionsTable(const SmallVectorImpl<const LandingPadInfo*> &LandingPads,
|
|||||||
unsigned PrevAction = (unsigned)-1;
|
unsigned PrevAction = (unsigned)-1;
|
||||||
|
|
||||||
if (NumShared) {
|
if (NumShared) {
|
||||||
const unsigned SizePrevIds = PrevLPI->TypeIds.size();
|
unsigned SizePrevIds = PrevLPI->TypeIds.size();
|
||||||
assert(Actions.size());
|
assert(Actions.size());
|
||||||
PrevAction = Actions.size() - 1;
|
PrevAction = Actions.size() - 1;
|
||||||
SizeAction =
|
SizeAction =
|
||||||
@ -622,18 +622,19 @@ void DwarfException::EmitExceptionTable() {
|
|||||||
// Final tallies.
|
// Final tallies.
|
||||||
|
|
||||||
// Call sites.
|
// Call sites.
|
||||||
const unsigned SiteStartSize = SizeOfEncodedValue(dwarf::DW_EH_PE_udata4);
|
|
||||||
const unsigned SiteLengthSize = SizeOfEncodedValue(dwarf::DW_EH_PE_udata4);
|
|
||||||
const unsigned LandingPadSize = SizeOfEncodedValue(dwarf::DW_EH_PE_udata4);
|
|
||||||
bool IsSJLJ = MAI->getExceptionHandlingType() == ExceptionHandling::SjLj;
|
bool IsSJLJ = MAI->getExceptionHandlingType() == ExceptionHandling::SjLj;
|
||||||
bool HaveTTData = IsSJLJ ? (!TypeInfos.empty() || !FilterIds.empty()) : true;
|
bool HaveTTData = IsSJLJ ? (!TypeInfos.empty() || !FilterIds.empty()) : true;
|
||||||
unsigned CallSiteTableLength;
|
|
||||||
|
|
||||||
|
unsigned CallSiteTableLength;
|
||||||
if (IsSJLJ)
|
if (IsSJLJ)
|
||||||
CallSiteTableLength = 0;
|
CallSiteTableLength = 0;
|
||||||
else
|
else {
|
||||||
CallSiteTableLength = CallSites.size() *
|
unsigned SiteStartSize = 4; // dwarf::DW_EH_PE_udata4
|
||||||
(SiteStartSize + SiteLengthSize + LandingPadSize);
|
unsigned SiteLengthSize = 4; // dwarf::DW_EH_PE_udata4
|
||||||
|
unsigned LandingPadSize = 4; // dwarf::DW_EH_PE_udata4
|
||||||
|
CallSiteTableLength =
|
||||||
|
CallSites.size() * (SiteStartSize + SiteLengthSize + LandingPadSize);
|
||||||
|
}
|
||||||
|
|
||||||
for (unsigned i = 0, e = CallSites.size(); i < e; ++i) {
|
for (unsigned i = 0, e = CallSites.size(); i < e; ++i) {
|
||||||
CallSiteTableLength += MCAsmInfo::getULEB128Size(CallSites[i].Action);
|
CallSiteTableLength += MCAsmInfo::getULEB128Size(CallSites[i].Action);
|
||||||
@ -650,7 +651,7 @@ void DwarfException::EmitExceptionTable() {
|
|||||||
// For SjLj exceptions, if there is no TypeInfo, then we just explicitly say
|
// For SjLj exceptions, if there is no TypeInfo, then we just explicitly say
|
||||||
// that we're omitting that bit.
|
// that we're omitting that bit.
|
||||||
TTypeEncoding = dwarf::DW_EH_PE_omit;
|
TTypeEncoding = dwarf::DW_EH_PE_omit;
|
||||||
TypeFormatSize = SizeOfEncodedValue(dwarf::DW_EH_PE_absptr);
|
TypeFormatSize = TD->getPointerSize(); // dwarf::DW_EH_PE_absptr
|
||||||
} else {
|
} else {
|
||||||
// Okay, we have actual filters or typeinfos to emit. As such, we need to
|
// Okay, we have actual filters or typeinfos to emit. As such, we need to
|
||||||
// pick a type encoding for them. We're about to emit a list of pointers to
|
// pick a type encoding for them. We're about to emit a list of pointers to
|
||||||
|
@ -43,18 +43,12 @@ unsigned DwarfPrinter::SizeOfEncodedValue(unsigned Encoding) const {
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
switch (Encoding & 0x07) {
|
switch (Encoding & 0x07) {
|
||||||
case dwarf::DW_EH_PE_absptr:
|
default: assert(0 && "Invalid encoded value.");
|
||||||
return TD->getPointerSize();
|
case dwarf::DW_EH_PE_absptr: return TD->getPointerSize();
|
||||||
case dwarf::DW_EH_PE_udata2:
|
case dwarf::DW_EH_PE_udata2: return 2;
|
||||||
return 2;
|
case dwarf::DW_EH_PE_udata4: return 4;
|
||||||
case dwarf::DW_EH_PE_udata4:
|
case dwarf::DW_EH_PE_udata8: return 8;
|
||||||
return 4;
|
|
||||||
case dwarf::DW_EH_PE_udata8:
|
|
||||||
return 8;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(0 && "Invalid encoded value.");
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DwarfPrinter::EmitReference(const MCSymbol *Sym, unsigned Encoding) const {
|
void DwarfPrinter::EmitReference(const MCSymbol *Sym, unsigned Encoding) const {
|
||||||
|
Loading…
Reference in New Issue
Block a user