diff --git a/lld/MachO/BPSectionOrderer.cpp b/lld/MachO/BPSectionOrderer.cpp index f6a974370836b..568843d72bbb5 100644 --- a/lld/MachO/BPSectionOrderer.cpp +++ b/lld/MachO/BPSectionOrderer.cpp @@ -48,9 +48,9 @@ getRelocHash(const Reloc &reloc, sectionIdx = sectionIdxIt->getSecond(); std::string kind; if (isec) - kind = ("Section " + Twine((uint8_t)isec->kind())).str(); + kind = ("Section " + Twine(static_cast(isec->kind()))).str(); if (auto *sym = reloc.referent.dyn_cast()) { - kind += (" Symbol " + Twine((uint8_t)sym->kind())).str(); + kind += (" Symbol " + Twine(static_cast(sym->kind()))).str(); if (auto *d = dyn_cast(sym)) { if (isa_and_nonnull(isec)) return getRelocHash(kind, 0, isec->getOffset(d->value), reloc.addend); diff --git a/lld/MachO/Options.td b/lld/MachO/Options.td index 75bfaed9e4c08..9c9570cdbeb05 100644 --- a/lld/MachO/Options.td +++ b/lld/MachO/Options.td @@ -126,8 +126,9 @@ def no_call_graph_profile_sort : Flag<["--"], "no-call-graph-profile-sort">, def print_symbol_order_eq: Joined<["--"], "print-symbol-order=">, HelpText<"Print a symbol order specified by --call-graph-profile-sort into the specified file">, Group; -def irpgo_profile_sort: Joined<["--"], "irpgo-profile-sort=">, - MetaVarName<"">, +def irpgo_profile_sort: Separate<["--"], "irpgo-profile-sort">, Group; +def irpgo_profile_sort_eq: Joined<["--"], "irpgo-profile-sort=">, + Alias(irpgo_profile_sort)>, MetaVarName<"">, HelpText<"Read the IRPGO profile at to order sections to improve startup time">, Group; def compression_sort: Joined<["--"], "compression-sort=">, diff --git a/lld/test/MachO/bp-section-orderer-errs.s b/lld/test/MachO/bp-section-orderer-errs.s index f248b860ce5dc..8392b88508481 100644 --- a/lld/test/MachO/bp-section-orderer-errs.s +++ b/lld/test/MachO/bp-section-orderer-errs.s @@ -1,5 +1,6 @@ +# RUN: not %lld -o /dev/null --irpgo-profile-sort %s --call-graph-profile-sort 2>&1 | FileCheck %s --check-prefix=IRPGO-ERR # RUN: not %lld -o /dev/null --irpgo-profile-sort=%s --call-graph-profile-sort 2>&1 | FileCheck %s --check-prefix=IRPGO-ERR -# IRPGO-ERR: --irpgo-profile-sort= is incompatible with --call-graph-profile-sort +# IRPGO-ERR: --irpgo-profile-sort is incompatible with --call-graph-profile-sort # RUN: not %lld -o /dev/null --compression-sort=function --call-graph-profile-sort %s 2>&1 | FileCheck %s --check-prefix=COMPRESSION-ERR # COMPRESSION-ERR: --compression-sort= is incompatible with --call-graph-profile-sort