Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8338158

Cleanup ShouldNotXXX uses in machnode.cpp

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • 24
    • hotspot
    • b11

      A number of functions in the MachOper and MachNode class (in machnode.cpp) have implementations that just call ShouldNotReachHere() or ShouldNotCallThis().

      Some of those functions return void, and the ShouldNotXXX call is the entire definition.

      Some have a non-void return type, but still just call the ShouldNotXXX function, relying on [[noreturn]] handling to avoid warnings about not returning a value of the appropriate type.

      And some (still) have dummy dead code following the ShouldNotXXX call to suppress no longer generated warnings about needing to return a value of the appropriate type. Some of these are returning literal 0 from a function returning a pointer type, triggering -Wzero-as-null-pointer-constant warnings when enabled.

      Remove all the dead code after ShouldNotXXX calls in machnode.cpp, for consistency and to remove the -Wzero-as-null-pointer-constant warnings.

            kbarrett Kim Barrett
            kbarrett Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: