[NFC][XCOFF] format `XCOFFObjectWriter.cpp`
This commit is contained in:
parent
a73db7f1ad
commit
664cbfaf07
|
@ -206,8 +206,8 @@ struct ExceptionTableEntry {
|
|||
unsigned Lang;
|
||||
unsigned Reason;
|
||||
|
||||
ExceptionTableEntry(const MCSymbol *Trap, unsigned Lang, unsigned Reason) :
|
||||
Trap(Trap), Lang(Lang), Reason(Reason) {}
|
||||
ExceptionTableEntry(const MCSymbol *Trap, unsigned Lang, unsigned Reason)
|
||||
: Trap(Trap), Lang(Lang), Reason(Reason) {}
|
||||
};
|
||||
|
||||
struct ExceptionInfo {
|
||||
|
@ -220,8 +220,8 @@ struct ExceptionSectionEntry : public SectionEntry {
|
|||
std::map<const StringRef, ExceptionInfo> ExceptionTable;
|
||||
bool isDebugEnabled = false;
|
||||
|
||||
ExceptionSectionEntry(StringRef N, int32_t Flags) :
|
||||
SectionEntry(N, Flags | XCOFF::STYP_EXCEPT) {
|
||||
ExceptionSectionEntry(StringRef N, int32_t Flags)
|
||||
: SectionEntry(N, Flags | XCOFF::STYP_EXCEPT) {
|
||||
assert(N.size() <= XCOFF::NameSize && "Section too long.");
|
||||
memcpy(Name, N.data(), N.size());
|
||||
}
|
||||
|
@ -319,22 +319,20 @@ class XCOFFObjectWriter : public MCObjectWriter {
|
|||
const MCAsmLayout &Layout,
|
||||
const DwarfSectionEntry &DwarfEntry,
|
||||
uint64_t &CurrentAddressLocation);
|
||||
void writeSectionForExceptionSectionEntry(const MCAssembler &Asm,
|
||||
const MCAsmLayout &Layout,
|
||||
ExceptionSectionEntry &ExceptionEntry,
|
||||
uint64_t &CurrentAddressLocation);
|
||||
void writeSectionForExceptionSectionEntry(
|
||||
const MCAssembler &Asm, const MCAsmLayout &Layout,
|
||||
ExceptionSectionEntry &ExceptionEntry, uint64_t &CurrentAddressLocation);
|
||||
void writeSymbolTable(const MCAsmLayout &Layout);
|
||||
void writeSymbolAuxDwarfEntry(uint64_t LengthOfSectionPortion,
|
||||
uint64_t NumberOfRelocEnt = 0);
|
||||
void writeSymbolAuxCsectEntry(uint64_t SectionOrLength,
|
||||
uint8_t SymbolAlignmentAndType,
|
||||
uint8_t StorageMappingClass);
|
||||
void writeSymbolAuxFunctionEntry(uint32_t EntryOffset,
|
||||
uint32_t FunctionSize,
|
||||
void writeSymbolAuxFunctionEntry(uint32_t EntryOffset, uint32_t FunctionSize,
|
||||
uint64_t LineNumberPointer,
|
||||
uint32_t EndIndex);
|
||||
void writeSymbolAuxExceptionEntry(uint64_t EntryOffset,
|
||||
uint32_t FunctionSize, uint32_t EndIndex);
|
||||
void writeSymbolAuxExceptionEntry(uint64_t EntryOffset, uint32_t FunctionSize,
|
||||
uint32_t EndIndex);
|
||||
void writeSymbolEntry(StringRef SymbolName, uint64_t Value,
|
||||
int16_t SectionNumber, uint16_t SymbolType,
|
||||
uint8_t StorageClass, uint8_t NumberOfAuxEntries = 1);
|
||||
|
@ -1090,12 +1088,9 @@ void XCOFFObjectWriter::finalizeSectionInfo() {
|
|||
SymbolTableOffset = RawPointer;
|
||||
}
|
||||
|
||||
void XCOFFObjectWriter::addExceptionEntry(const MCSymbol *Symbol,
|
||||
const MCSymbol *Trap,
|
||||
unsigned LanguageCode,
|
||||
unsigned ReasonCode,
|
||||
unsigned FunctionSize,
|
||||
bool hasDebug) {
|
||||
void XCOFFObjectWriter::addExceptionEntry(
|
||||
const MCSymbol *Symbol, const MCSymbol *Trap, unsigned LanguageCode,
|
||||
unsigned ReasonCode, unsigned FunctionSize, bool hasDebug) {
|
||||
// If a module had debug info, debugging is enabled and XCOFF emits the
|
||||
// exception auxilliary entry.
|
||||
if (hasDebug)
|
||||
|
@ -1124,8 +1119,8 @@ unsigned XCOFFObjectWriter::getExceptionSectionSize() {
|
|||
// symbol table index.
|
||||
EntryNum += it->second.Entries.size() + 1;
|
||||
|
||||
return EntryNum * (is64Bit() ? XCOFF::ExceptionSectionEntrySize64 :
|
||||
XCOFF::ExceptionSectionEntrySize32);
|
||||
return EntryNum * (is64Bit() ? XCOFF::ExceptionSectionEntrySize64
|
||||
: XCOFF::ExceptionSectionEntrySize32);
|
||||
}
|
||||
|
||||
unsigned XCOFFObjectWriter::getExceptionOffset(const MCSymbol *Symbol) {
|
||||
|
@ -1136,8 +1131,8 @@ unsigned XCOFFObjectWriter::getExceptionOffset(const MCSymbol *Symbol) {
|
|||
break;
|
||||
EntryNum += it->second.Entries.size() + 1;
|
||||
}
|
||||
return EntryNum * (is64Bit() ? XCOFF::ExceptionSectionEntrySize64 :
|
||||
XCOFF::ExceptionSectionEntrySize32);
|
||||
return EntryNum * (is64Bit() ? XCOFF::ExceptionSectionEntrySize64
|
||||
: XCOFF::ExceptionSectionEntrySize32);
|
||||
}
|
||||
|
||||
void XCOFFObjectWriter::assignAddressesAndIndices(const MCAsmLayout &Layout) {
|
||||
|
|
Loading…
Reference in New Issue