8022956: Clang: enable return type warnings on BSD
authortwisti
Tue, 20 Aug 2013 10:57:50 -0700
changeset 19336 ddceb0657500
parent 19335 ad762bd4ff48
child 19337 729e74316a18
8022956: Clang: enable return type warnings on BSD Reviewed-by: coleenp, sla
hotspot/make/bsd/makefiles/gcc.make
hotspot/src/cpu/zero/vm/assembler_zero.cpp
hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
hotspot/src/cpu/zero/vm/frame_zero.cpp
hotspot/src/cpu/zero/vm/frame_zero.inline.hpp
hotspot/src/cpu/zero/vm/icBuffer_zero.cpp
hotspot/src/cpu/zero/vm/interp_masm_zero.hpp
hotspot/src/cpu/zero/vm/interpreter_zero.cpp
hotspot/src/cpu/zero/vm/nativeInst_zero.hpp
hotspot/src/cpu/zero/vm/register_zero.cpp
hotspot/src/cpu/zero/vm/relocInfo_zero.cpp
hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp
hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp
hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp
--- a/hotspot/make/bsd/makefiles/gcc.make	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/make/bsd/makefiles/gcc.make	Tue Aug 20 10:57:50 2013 -0700
@@ -247,7 +247,7 @@
 # Not yet supported by clang in Xcode 4.6.2
 #  WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare
   WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess
-  WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
+  WARNINGS_ARE_ERRORS += -Wno-empty-body
 endif
 
 WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
--- a/hotspot/src/cpu/zero/vm/assembler_zero.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/assembler_zero.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -50,6 +50,7 @@
 #ifdef ASSERT
 bool AbstractAssembler::pd_check_instruction_mark() {
   ShouldNotCallThis();
+  return false;
 }
 #endif
 
@@ -73,6 +74,7 @@
 RegisterOrConstant MacroAssembler::delayed_value_impl(
   intptr_t* delayed_value_addr, Register tmpl, int offset) {
   ShouldNotCallThis();
+  return RegisterOrConstant();
 }
 
 void MacroAssembler::store_oop(jobject obj) {
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -1008,6 +1008,7 @@
 
 address CppInterpreter::return_entry(TosState state, int length) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 address CppInterpreter::deopt_entry(TosState state, int length) {
--- a/hotspot/src/cpu/zero/vm/frame_zero.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/frame_zero.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -116,6 +116,7 @@
 
 bool frame::safe_for_sender(JavaThread *thread) {
   ShouldNotCallThis();
+  return false;
 }
 
 void frame::pd_gc_epilog() {
@@ -123,6 +124,7 @@
 
 bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
   ShouldNotCallThis();
+  return false;
 }
 
 BasicType frame::interpreter_frame_result(oop* oop_result,
@@ -184,9 +186,8 @@
 int frame::frame_size(RegisterMap* map) const {
 #ifdef PRODUCT
   ShouldNotCallThis();
-#else
+#endif // PRODUCT
   return 0; // make javaVFrame::print_value work
-#endif // PRODUCT
 }
 
 intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
--- a/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/frame_zero.inline.hpp	Tue Aug 20 10:57:50 2013 -0700
@@ -36,7 +36,7 @@
   _deopt_state = unknown;
 }
 
-inline address  frame::sender_pc()           const { ShouldNotCallThis();  }
+inline address  frame::sender_pc()           const { ShouldNotCallThis(); return NULL; }
 
 inline frame::frame(ZeroFrame* zf, intptr_t* sp) {
   _zeroframe = zf;
@@ -89,6 +89,7 @@
 
 inline intptr_t* frame::link() const {
   ShouldNotCallThis();
+  return NULL;
 }
 
 #ifdef CC_INTERP
@@ -151,14 +152,17 @@
 
 inline oop frame::saved_oop_result(RegisterMap* map) const {
   ShouldNotCallThis();
+  return NULL;
 }
 
 inline bool frame::is_older(intptr_t* id) const {
   ShouldNotCallThis();
+  return false;
 }
 
 inline intptr_t* frame::entry_frame_argument_at(int offset) const {
   ShouldNotCallThis();
+  return NULL;
 }
 
 inline intptr_t* frame::unextended_sp() const {
--- a/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/icBuffer_zero.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -49,8 +49,10 @@
 address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) {
   // NB ic_stub_code_size() must return the size of the code we generate
   ShouldNotCallThis();
+  return NULL;
 }
 
 void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) {
   ShouldNotCallThis();
+  return NULL;
 }
--- a/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/interp_masm_zero.hpp	Tue Aug 20 10:57:50 2013 -0700
@@ -40,6 +40,7 @@
                                         Register  tmp,
                                         int       offset) {
     ShouldNotCallThis();
+    return RegisterOrConstant();
   }
 };
 
--- a/hotspot/src/cpu/zero/vm/interpreter_zero.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/interpreter_zero.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -64,6 +64,7 @@
     return NULL;
 
   Unimplemented();
+  return NULL;
 }
 
 address InterpreterGenerator::generate_abstract_entry() {
--- a/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/nativeInst_zero.hpp	Tue Aug 20 10:57:50 2013 -0700
@@ -51,15 +51,18 @@
  public:
   bool is_jump() {
     ShouldNotCallThis();
+    return false;
   }
 
   bool is_safepoint_poll() {
     ShouldNotCallThis();
+    return false;
   }
 };
 
 inline NativeInstruction* nativeInstruction_at(address address) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 class NativeCall : public NativeInstruction {
@@ -70,18 +73,22 @@
 
   address instruction_address() const {
     ShouldNotCallThis();
+    return NULL;
   }
 
   address next_instruction_address() const {
     ShouldNotCallThis();
+    return NULL;
   }
 
   address return_address() const {
     ShouldNotCallThis();
+    return NULL;
   }
 
   address destination() const {
     ShouldNotCallThis();
+    return NULL;
   }
 
   void set_destination_mt_safe(address dest) {
@@ -98,25 +105,30 @@
 
   static bool is_call_before(address return_address) {
     ShouldNotCallThis();
+    return false;
   }
 };
 
 inline NativeCall* nativeCall_before(address return_address) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 inline NativeCall* nativeCall_at(address address) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 class NativeMovConstReg : public NativeInstruction {
  public:
   address next_instruction_address() const {
     ShouldNotCallThis();
+    return NULL;
   }
 
   intptr_t data() const {
     ShouldNotCallThis();
+    return 0;
   }
 
   void set_data(intptr_t x) {
@@ -126,12 +138,14 @@
 
 inline NativeMovConstReg* nativeMovConstReg_at(address address) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 class NativeMovRegMem : public NativeInstruction {
  public:
   int offset() const {
     ShouldNotCallThis();
+    return 0;
   }
 
   void set_offset(intptr_t x) {
@@ -145,6 +159,7 @@
 
 inline NativeMovRegMem* nativeMovRegMem_at(address address) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 class NativeJump : public NativeInstruction {
@@ -155,6 +170,7 @@
 
   address jump_destination() const {
     ShouldNotCallThis();
+    return NULL;
   }
 
   void set_jump_destination(address dest) {
@@ -172,12 +188,14 @@
 
 inline NativeJump* nativeJump_at(address address) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 class NativeGeneralJump : public NativeInstruction {
  public:
   address jump_destination() const {
     ShouldNotCallThis();
+    return NULL;
   }
 
   static void insert_unconditional(address code_pos, address entry) {
@@ -191,6 +209,7 @@
 
 inline NativeGeneralJump* nativeGeneralJump_at(address address) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 #endif // CPU_ZERO_VM_NATIVEINST_ZERO_HPP
--- a/hotspot/src/cpu/zero/vm/register_zero.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/register_zero.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -32,8 +32,10 @@
 
 const char* RegisterImpl::name() const {
   ShouldNotCallThis();
+  return NULL;
 }
 
 const char* FloatRegisterImpl::name() const {
   ShouldNotCallThis();
+  return NULL;
 }
--- a/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/relocInfo_zero.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -37,6 +37,7 @@
 
 address Relocation::pd_call_destination(address orig_addr) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 void Relocation::pd_set_call_destination(address x) {
@@ -45,6 +46,7 @@
 
 address Relocation::pd_get_address_from_code() {
   ShouldNotCallThis();
+  return NULL;
 }
 
 address* Relocation::pd_address_in_code() {
--- a/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/sharedRuntime_zero.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -89,6 +89,7 @@
                                                             ret_type);
 #else
   ShouldNotCallThis();
+  return NULL;
 #endif // SHARK
 }
 
@@ -99,6 +100,7 @@
 
 uint SharedRuntime::out_preserve_stack_slots() {
   ShouldNotCallThis();
+  return 0;
 }
 
 JRT_LEAF(void, zero_stub())
@@ -135,4 +137,5 @@
                                          VMRegPair *regs,
                                          int total_args_passed) {
   ShouldNotCallThis();
+  return 0;
 }
--- a/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/cpu/zero/vm/vtableStubs_zero.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -39,16 +39,20 @@
 
 VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 VtableStub* VtableStubs::create_itable_stub(int vtable_index) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
   ShouldNotCallThis();
+  return 0;
 }
 
 int VtableStub::pd_code_alignment() {
   ShouldNotCallThis();
+  return 0;
 }
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -715,6 +715,7 @@
   err.report_and_die();
 
   ShouldNotReachHere();
+  return false;
 }
 
 // From solaris_i486.s ported to bsd_i486.s
--- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp	Tue Aug 20 10:57:50 2013 -0700
@@ -66,6 +66,7 @@
 
 frame os::get_sender_for_C_frame(frame* fr) {
   ShouldNotCallThis();
+  return frame();
 }
 
 frame os::current_frame() {
@@ -103,16 +104,19 @@
 
 address os::Bsd::ucontext_get_pc(ucontext_t* uc) {
   ShouldNotCallThis();
+  return NULL;
 }
 
 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
                                         intptr_t** ret_sp,
                                         intptr_t** ret_fp) {
   ShouldNotCallThis();
+  return ExtendedPC();
 }
 
 frame os::fetch_frame_from_context(void* ucVoid) {
   ShouldNotCallThis();
+  return frame();
 }
 
 extern "C" JNIEXPORT int
@@ -240,6 +244,7 @@
 
   sprintf(buf, fmt, sig, info->si_addr);
   fatal(buf);
+  return false;
 }
 
 void os::Bsd::init_thread_fpu_state(void) {
@@ -373,17 +378,7 @@
 
 extern "C" {
   int SpinPause() {
-  }
-
-  int SafeFetch32(int *adr, int errValue) {
-    int value = errValue;
-    value = *adr;
-    return value;
-  }
-  intptr_t SafeFetchN(intptr_t *adr, intptr_t errValue) {
-    intptr_t value = errValue;
-    value = *adr;
-    return value;
+    return 1;
   }
 
   void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
--- a/hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp	Mon Aug 19 09:33:29 2013 +0200
+++ b/hotspot/src/os_cpu/bsd_zero/vm/thread_bsd_zero.hpp	Tue Aug 20 10:57:50 2013 -0700
@@ -110,6 +110,7 @@
                                            void* ucontext,
                                            bool isInJava) {
     ShouldNotCallThis();
+    return false;
   }
 
   // These routines are only used on cpu architectures that