diff options
Diffstat (limited to 'lld/lib/ReaderWriter/MachO')
4 files changed, 7 insertions, 7 deletions
diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFile.h b/lld/lib/ReaderWriter/MachO/MachONormalizedFile.h index c1db36c31c5..940ea639923 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFile.h +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFile.h @@ -108,7 +108,7 @@ LLVM_YAML_STRONG_TYPEDEF(uint32_t, SectionAttr) /// can support either kind. struct Section { Section() : type(llvm::MachO::S_REGULAR), - attributes(0), alignment(0), address(0) { } + attributes(0), alignment(PowerOf2::create(0)), address(0) { } StringRef segmentName; StringRef sectionName; diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp index 5b3d942c0ff..028c3638132 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileBinaryReader.cpp @@ -297,7 +297,7 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb, section.type = (SectionType)(read32(§->flags, isBig) & SECTION_TYPE); section.attributes = read32(§->flags, isBig) & SECTION_ATTRIBUTES; - section.alignment = PowerOf2(read32(§->align, isBig)); + section.alignment = PowerOf2::create(read32(§->align, isBig)); section.address = read64(§->addr, isBig); const uint8_t *content = (const uint8_t *)start + read32(§->offset, isBig); @@ -341,7 +341,7 @@ readBinary(std::unique_ptr<MemoryBuffer> &mb, SECTION_TYPE); section.attributes = read32((const uint8_t *)§->flags, isBig) & SECTION_ATTRIBUTES; - section.alignment = PowerOf2(read32(§->align, isBig)); + section.alignment = PowerOf2::create(read32(§->align, isBig)); section.address = read32(§->addr, isBig); const uint8_t *content = (const uint8_t *)start + read32(§->offset, isBig); diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp index 3f8a944494e..15bdb0aa077 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp @@ -67,9 +67,9 @@ struct SectionInfo { SectionInfo::SectionInfo(StringRef sg, StringRef sct, SectionType t, const MachOLinkingContext &ctxt, uint32_t attrs) : segmentName(sg), sectionName(sct), type(t), attributes(attrs), - address(0), size(0), alignment(0), + address(0), size(0), alignment(PowerOf2::create(0)), normalizedSectionIndex(0), finalSectionIndex(0) { - PowerOf2 align(0); + PowerOf2 align = PowerOf2::create(0); if (ctxt.sectionAligned(segmentName, sectionName, align)) { alignment = align; } diff --git a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp index 3635c62aa7c..79eefd32573 100644 --- a/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp +++ b/lld/lib/ReaderWriter/MachO/MachONormalizedFileYAML.cpp @@ -61,7 +61,7 @@ struct ScalarTraits<lld::PowerOf2> { static StringRef input(StringRef scalar, void*, lld::PowerOf2 &result) { uint32_t value; scalar.getAsInteger(10, value); - result = lld::PowerOf2(value); + result = lld::PowerOf2::create(value); return StringRef(); } static bool mustQuote(StringRef) { return false; } @@ -290,7 +290,7 @@ struct MappingTraits<Section> { io.mapRequired("section", sect.sectionName); io.mapRequired("type", sect.type); io.mapOptional("attributes", sect.attributes); - io.mapOptional("alignment", sect.alignment, lld::PowerOf2(0)); + io.mapOptional("alignment", sect.alignment, lld::PowerOf2::create(0)); io.mapRequired("address", sect.address); if (sect.type == llvm::MachO::S_ZEROFILL) { // S_ZEROFILL sections use "size:" instead of "content:" |

