Hotspot build on macOS aarch64 with unused-functions warning reports some unused functions

XMLWordPrintable

    • aarch64
    • os_x

      We currently set a warning for unused functions for gcc and clang, but later disable it for clang in the libjvm build.
      I checked why it might be disabled for clang and there are a few functions/methods reported as unused, probably we can remove some or all of those ?

      macOS aarch64 product build shows:

      /myjdk/jdk/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp:179:20: warning: unused function 'is_thread_local' [-Wunused-function]
      static inline bool is_thread_local(ConstBufferPtr buffer) {
                         ^
      /myjdk/jdk/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp:184:20: warning: unused function 'is_virtual_thread_local' [-Wunused-function]
      static inline bool is_virtual_thread_local(ConstBufferPtr buffer) {
                         ^
      2 warnings generated.
      /myjdk/jdk/src/hotspot/share/jfr/support/jfrDeprecationManager.cpp:197:20: warning: unused function 'jfr_is_started_on_command_line' [-Wunused-function]
      static inline bool jfr_is_started_on_command_line() {
                         ^
      1 warning generated.
      /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:61:20: warning: unused function 'sp_in_stack' [-Wunused-function]
      static inline bool sp_in_stack(const JfrSampleRequest& request, JavaThread* jt) {
                         ^
      /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:69:20: warning: unused function 'update_interpreter_frame_sender_pc' [-Wunused-function]
      static inline void update_interpreter_frame_sender_pc(JfrSampleRequest& request, intptr_t* fp) {
                         ^
      /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:79:23: warning: unused function 'interpreter_frame_return_address' [-Wunused-function]
      static inline address interpreter_frame_return_address(const JfrSampleRequest& request) {
                            ^
      /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:93:20: warning: unused function 'update_frame_sender_sp' [-Wunused-function]
      static inline void update_frame_sender_sp(JfrSampleRequest& request, intptr_t* fp) {
                         ^
      /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:101:20: warning: unused function 'update_sp' [-Wunused-function]
      static inline void update_sp(JfrSampleRequest& request, int frame_size) {
                         ^
      /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:106:20: warning: unused function 'update_pc' [-Wunused-function]
      static inline void update_pc(JfrSampleRequest& request) {
                         ^
      /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrSampleRequest.cpp:111:20: warning: unused function 'update_fp' [-Wunused-function]
      static inline void update_fp(JfrSampleRequest& request) {
                         ^
      7 warnings generated.
      /myjdk/jdk/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampling.cpp:69:20: warning: unused function 'is_interpreter' [-Wunused-function]
      static inline bool is_interpreter(address pc) {
                         ^
      1 warning generated.
      /myjdk/jdk/src/hotspot/os/posix/perfMemory_posix.cpp:646:14: warning: unused function 'get_user_name' [-Wunused-function]
      static char* get_user_name(int vmid, int *nspid, TRAPS) {
                   ^
      1 warning generated.
      /myjdk/jdk/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp:99:23: warning: unused function 'at_rsp' [-Wunused-function]
      static inline Address at_rsp() {

            Assignee:
            Matthias Baesken
            Reporter:
            Matthias Baesken
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: