[all-commits] [llvm/llvm-project] 59c6f4: [LLD] [MachO] Fix GCC build warnings

Martin Storsjö via All-commits all-commits at lists.llvm.org
Tue Aug 2 14:15:58 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 59c6f418fa3c5d6f5c8b75ebd817be8113de7931
      https://github.com/llvm/llvm-project/commit/59c6f418fa3c5d6f5c8b75ebd817be8113de7931
  Author: Martin Storsjö <martin at martin.st>
  Date:   2022-08-03 (Wed, 03 Aug 2022)

  Changed paths:
    M lld/MachO/Arch/ARM64.cpp
    M lld/MachO/UnwindInfoSection.cpp

  Log Message:
  -----------
  [LLD] [MachO] Fix GCC build warnings

This fixes the following warnings produced by GCC 9:

    ../tools/lld/MachO/Arch/ARM64.cpp: In member function ‘void {anonymous}::OptimizationHintContext::applyAdrpLdr(const lld::macho::OptimizationHint&)’:
    ../tools/lld/MachO/Arch/ARM64.cpp:448:18: warning: comparison of integer expressions of different signedness: ‘int64_t’ {aka ‘long int’} and ‘uint64_t’ {aka ‘long unsigned int’} [-Wsign-compare]
      448 |   if (ldr.offset != (rel1->referentVA & 0xfff))
          |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../tools/lld/MachO/UnwindInfoSection.cpp: In function ‘bool canFoldEncoding(compact_unwind_encoding_t)’:
    ../tools/lld/MachO/UnwindInfoSection.cpp:404:44: warning: comparison between ‘enum<unnamed>’ and ‘enum<unnamed>’ [-Wenum-compare]
      404 |   static_assert(UNWIND_X86_64_MODE_MASK == UNWIND_X86_MODE_MASK, "");
          |                                            ^~~~~~~~~~~~~~~~~~~~
    ../tools/lld/MachO/UnwindInfoSection.cpp:405:49: warning: comparison between ‘enum<unnamed>’ and ‘enum<unnamed>’ [-Wenum-compare]
      405 |   static_assert(UNWIND_X86_64_MODE_STACK_IND == UNWIND_X86_MODE_STACK_IND, "");
          |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~

Differential Revision: https://reviews.llvm.org/D130970




More information about the All-commits mailing list