[lld-macho][nfc] Run clang-format on lld/MachO/*.{h,cpp}

- fixed inconsistent indents and spaces
- prevent extraneous formatting changes in other patches

Differential Revision: https://reviews.llvm.org/D126262
This commit is contained in:
Vy Nguyen 2022-05-24 07:59:18 +07:00
parent 0377322897
commit c0ec1036d6
7 changed files with 12 additions and 15 deletions

View File

@ -328,8 +328,8 @@ void TextOutputSection::finalize() {
std::to_string(thunkInfo.sequence++)); std::to_string(thunkInfo.sequence++));
if (!isa<Defined>(funcSym) || cast<Defined>(funcSym)->isExternal()) { if (!isa<Defined>(funcSym) || cast<Defined>(funcSym)->isExternal()) {
r.referent = thunkInfo.sym = symtab->addDefined( r.referent = thunkInfo.sym = symtab->addDefined(
thunkName, /*file=*/nullptr, thunkInfo.isec, /*value=*/0, thunkName, /*file=*/nullptr, thunkInfo.isec, /*value=*/0, thunkSize,
thunkSize, /*isWeakDef=*/false, /*isPrivateExtern=*/true, /*isWeakDef=*/false, /*isPrivateExtern=*/true,
/*isThumb=*/false, /*isReferencedDynamically=*/false, /*isThumb=*/false, /*isReferencedDynamically=*/false,
/*noDeadStrip=*/false, /*isWeakDefCanBeHidden=*/false); /*noDeadStrip=*/false, /*isWeakDefCanBeHidden=*/false);
} else { } else {

View File

@ -439,8 +439,7 @@ static bool validateRelocationInfo(InputFile *file, const SectionHeader &sec,
template <class SectionHeader> template <class SectionHeader>
void ObjFile::parseRelocations(ArrayRef<SectionHeader> sectionHeaders, void ObjFile::parseRelocations(ArrayRef<SectionHeader> sectionHeaders,
const SectionHeader &sec, const SectionHeader &sec, Section &section) {
Section &section) {
auto *buf = reinterpret_cast<const uint8_t *>(mb.getBufferStart()); auto *buf = reinterpret_cast<const uint8_t *>(mb.getBufferStart());
ArrayRef<relocation_info> relInfos( ArrayRef<relocation_info> relInfos(
reinterpret_cast<const relocation_info *>(buf + sec.reloff), sec.nreloc); reinterpret_cast<const relocation_info *>(buf + sec.reloff), sec.nreloc);

View File

@ -71,7 +71,8 @@ protected:
public: public:
// is address assigned? // is address assigned?
bool isFinal = false; bool isFinal = false;
// keep the address of the symbol(s) in this section unique in the final binary ? // keep the address of the symbol(s) in this section unique in the final
// binary ?
bool keepUnique = false; bool keepUnique = false;
uint32_t align = 1; uint32_t align = 1;

View File

@ -165,8 +165,7 @@ void MarkLiveImpl<RecordWhyLive>::markTransitively() {
// contain other types of InputSections (due to S_ATTR_LIVE_SUPPORT), but // contain other types of InputSections (due to S_ATTR_LIVE_SUPPORT), but
// those entries should never be pushed onto the worklist. // those entries should never be pushed onto the worklist.
auto *isec = cast<ConcatInputSection>(getInputSection(entry)); auto *isec = cast<ConcatInputSection>(getInputSection(entry));
assert(isec->live && assert(isec->live && "We mark as live when pushing onto the worklist!");
"We mark as live when pushing onto the worklist!");
// Mark all symbols listed in the relocation table for this section. // Mark all symbols listed in the relocation table for this section.
for (const Reloc &r : isec->relocs) { for (const Reloc &r : isec->relocs) {

View File

@ -13,9 +13,7 @@ using namespace llvm;
using namespace lld; using namespace lld;
using namespace lld::macho; using namespace lld::macho;
uint64_t OutputSection::getSegmentOffset() const { uint64_t OutputSection::getSegmentOffset() const { return addr - parent->addr; }
return addr - parent->addr;
}
void OutputSection::assignAddressesToStartEndSymbols() { void OutputSection::assignAddressesToStartEndSymbols() {
for (Defined *d : sectionStartSymbols) for (Defined *d : sectionStartSymbols)

View File

@ -704,8 +704,8 @@ uint32_t LazyBindingSection::encode(const Symbol &sym) {
OutputSegment *dataSeg = in.lazyPointers->parent; OutputSegment *dataSeg = in.lazyPointers->parent;
os << static_cast<uint8_t>(BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB | os << static_cast<uint8_t>(BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB |
dataSeg->index); dataSeg->index);
uint64_t offset = in.lazyPointers->addr - dataSeg->addr + uint64_t offset =
sym.stubsIndex * target->wordSize; in.lazyPointers->addr - dataSeg->addr + sym.stubsIndex * target->wordSize;
encodeULEB128(offset, os); encodeULEB128(offset, os);
encodeDylibOrdinal(ordinalForSymbol(sym), os); encodeDylibOrdinal(ordinalForSymbol(sym), os);