提交 2b9c5258 编写于 作者: T twisti

8022956: Clang: enable return type warnings on BSD

Reviewed-by: coleenp, sla
上级 bde21775
...@@ -247,7 +247,7 @@ ifeq ($(USE_CLANG), true) ...@@ -247,7 +247,7 @@ ifeq ($(USE_CLANG), true)
# Not yet supported by clang in Xcode 4.6.2 # Not yet supported by clang in Xcode 4.6.2
# WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare # 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-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 endif
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef
......
...@@ -50,6 +50,7 @@ int AbstractAssembler::code_fill_byte() { ...@@ -50,6 +50,7 @@ int AbstractAssembler::code_fill_byte() {
#ifdef ASSERT #ifdef ASSERT
bool AbstractAssembler::pd_check_instruction_mark() { bool AbstractAssembler::pd_check_instruction_mark() {
ShouldNotCallThis(); ShouldNotCallThis();
return false;
} }
#endif #endif
...@@ -73,6 +74,7 @@ void MacroAssembler::advance(int bytes) { ...@@ -73,6 +74,7 @@ void MacroAssembler::advance(int bytes) {
RegisterOrConstant MacroAssembler::delayed_value_impl( RegisterOrConstant MacroAssembler::delayed_value_impl(
intptr_t* delayed_value_addr, Register tmpl, int offset) { intptr_t* delayed_value_addr, Register tmpl, int offset) {
ShouldNotCallThis(); ShouldNotCallThis();
return RegisterOrConstant();
} }
void MacroAssembler::store_oop(jobject obj) { void MacroAssembler::store_oop(jobject obj) {
......
...@@ -1008,6 +1008,7 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState istate, ...@@ -1008,6 +1008,7 @@ void BytecodeInterpreter::layout_interpreterState(interpreterState istate,
address CppInterpreter::return_entry(TosState state, int length) { address CppInterpreter::return_entry(TosState state, int length) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
address CppInterpreter::deopt_entry(TosState state, int length) { address CppInterpreter::deopt_entry(TosState state, int length) {
......
...@@ -116,6 +116,7 @@ void frame::patch_pc(Thread* thread, address pc) { ...@@ -116,6 +116,7 @@ void frame::patch_pc(Thread* thread, address pc) {
bool frame::safe_for_sender(JavaThread *thread) { bool frame::safe_for_sender(JavaThread *thread) {
ShouldNotCallThis(); ShouldNotCallThis();
return false;
} }
void frame::pd_gc_epilog() { void frame::pd_gc_epilog() {
...@@ -123,6 +124,7 @@ void frame::pd_gc_epilog() { ...@@ -123,6 +124,7 @@ void frame::pd_gc_epilog() {
bool frame::is_interpreted_frame_valid(JavaThread *thread) const { bool frame::is_interpreted_frame_valid(JavaThread *thread) const {
ShouldNotCallThis(); ShouldNotCallThis();
return false;
} }
BasicType frame::interpreter_frame_result(oop* oop_result, BasicType frame::interpreter_frame_result(oop* oop_result,
...@@ -184,9 +186,8 @@ BasicType frame::interpreter_frame_result(oop* oop_result, ...@@ -184,9 +186,8 @@ BasicType frame::interpreter_frame_result(oop* oop_result,
int frame::frame_size(RegisterMap* map) const { int frame::frame_size(RegisterMap* map) const {
#ifdef PRODUCT #ifdef PRODUCT
ShouldNotCallThis(); ShouldNotCallThis();
#else
return 0; // make javaVFrame::print_value work
#endif // PRODUCT #endif // PRODUCT
return 0; // make javaVFrame::print_value work
} }
intptr_t* frame::interpreter_frame_tos_at(jint offset) const { intptr_t* frame::interpreter_frame_tos_at(jint offset) const {
......
...@@ -36,7 +36,7 @@ inline frame::frame() { ...@@ -36,7 +36,7 @@ inline frame::frame() {
_deopt_state = unknown; _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) { inline frame::frame(ZeroFrame* zf, intptr_t* sp) {
_zeroframe = zf; _zeroframe = zf;
...@@ -89,6 +89,7 @@ inline intptr_t* frame::real_fp() const { ...@@ -89,6 +89,7 @@ inline intptr_t* frame::real_fp() const {
inline intptr_t* frame::link() const { inline intptr_t* frame::link() const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
#ifdef CC_INTERP #ifdef CC_INTERP
...@@ -151,14 +152,17 @@ inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) { ...@@ -151,14 +152,17 @@ inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
inline oop frame::saved_oop_result(RegisterMap* map) const { inline oop frame::saved_oop_result(RegisterMap* map) const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
inline bool frame::is_older(intptr_t* id) const { inline bool frame::is_older(intptr_t* id) const {
ShouldNotCallThis(); ShouldNotCallThis();
return false;
} }
inline intptr_t* frame::entry_frame_argument_at(int offset) const { inline intptr_t* frame::entry_frame_argument_at(int offset) const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
inline intptr_t* frame::unextended_sp() const { inline intptr_t* frame::unextended_sp() const {
......
...@@ -49,8 +49,10 @@ void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin, ...@@ -49,8 +49,10 @@ void InlineCacheBuffer::assemble_ic_buffer_code(address code_begin,
address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) { address InlineCacheBuffer::ic_buffer_entry_point(address code_begin) {
// NB ic_stub_code_size() must return the size of the code we generate // NB ic_stub_code_size() must return the size of the code we generate
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) { void* InlineCacheBuffer::ic_buffer_cached_value(address code_begin) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
...@@ -40,6 +40,7 @@ class InterpreterMacroAssembler : public MacroAssembler { ...@@ -40,6 +40,7 @@ class InterpreterMacroAssembler : public MacroAssembler {
Register tmp, Register tmp,
int offset) { int offset) {
ShouldNotCallThis(); ShouldNotCallThis();
return RegisterOrConstant();
} }
}; };
......
...@@ -64,6 +64,7 @@ address InterpreterGenerator::generate_math_entry( ...@@ -64,6 +64,7 @@ address InterpreterGenerator::generate_math_entry(
return NULL; return NULL;
Unimplemented(); Unimplemented();
return NULL;
} }
address InterpreterGenerator::generate_abstract_entry() { address InterpreterGenerator::generate_abstract_entry() {
......
...@@ -51,15 +51,18 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC { ...@@ -51,15 +51,18 @@ class NativeInstruction VALUE_OBJ_CLASS_SPEC {
public: public:
bool is_jump() { bool is_jump() {
ShouldNotCallThis(); ShouldNotCallThis();
return false;
} }
bool is_safepoint_poll() { bool is_safepoint_poll() {
ShouldNotCallThis(); ShouldNotCallThis();
return false;
} }
}; };
inline NativeInstruction* nativeInstruction_at(address address) { inline NativeInstruction* nativeInstruction_at(address address) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
class NativeCall : public NativeInstruction { class NativeCall : public NativeInstruction {
...@@ -70,18 +73,22 @@ class NativeCall : public NativeInstruction { ...@@ -70,18 +73,22 @@ class NativeCall : public NativeInstruction {
address instruction_address() const { address instruction_address() const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
address next_instruction_address() const { address next_instruction_address() const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
address return_address() const { address return_address() const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
address destination() const { address destination() const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
void set_destination_mt_safe(address dest) { void set_destination_mt_safe(address dest) {
...@@ -98,25 +105,30 @@ class NativeCall : public NativeInstruction { ...@@ -98,25 +105,30 @@ class NativeCall : public NativeInstruction {
static bool is_call_before(address return_address) { static bool is_call_before(address return_address) {
ShouldNotCallThis(); ShouldNotCallThis();
return false;
} }
}; };
inline NativeCall* nativeCall_before(address return_address) { inline NativeCall* nativeCall_before(address return_address) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
inline NativeCall* nativeCall_at(address address) { inline NativeCall* nativeCall_at(address address) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
class NativeMovConstReg : public NativeInstruction { class NativeMovConstReg : public NativeInstruction {
public: public:
address next_instruction_address() const { address next_instruction_address() const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
intptr_t data() const { intptr_t data() const {
ShouldNotCallThis(); ShouldNotCallThis();
return 0;
} }
void set_data(intptr_t x) { void set_data(intptr_t x) {
...@@ -126,12 +138,14 @@ class NativeMovConstReg : public NativeInstruction { ...@@ -126,12 +138,14 @@ class NativeMovConstReg : public NativeInstruction {
inline NativeMovConstReg* nativeMovConstReg_at(address address) { inline NativeMovConstReg* nativeMovConstReg_at(address address) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
class NativeMovRegMem : public NativeInstruction { class NativeMovRegMem : public NativeInstruction {
public: public:
int offset() const { int offset() const {
ShouldNotCallThis(); ShouldNotCallThis();
return 0;
} }
void set_offset(intptr_t x) { void set_offset(intptr_t x) {
...@@ -145,6 +159,7 @@ class NativeMovRegMem : public NativeInstruction { ...@@ -145,6 +159,7 @@ class NativeMovRegMem : public NativeInstruction {
inline NativeMovRegMem* nativeMovRegMem_at(address address) { inline NativeMovRegMem* nativeMovRegMem_at(address address) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
class NativeJump : public NativeInstruction { class NativeJump : public NativeInstruction {
...@@ -155,6 +170,7 @@ class NativeJump : public NativeInstruction { ...@@ -155,6 +170,7 @@ class NativeJump : public NativeInstruction {
address jump_destination() const { address jump_destination() const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
void set_jump_destination(address dest) { void set_jump_destination(address dest) {
...@@ -172,12 +188,14 @@ class NativeJump : public NativeInstruction { ...@@ -172,12 +188,14 @@ class NativeJump : public NativeInstruction {
inline NativeJump* nativeJump_at(address address) { inline NativeJump* nativeJump_at(address address) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
class NativeGeneralJump : public NativeInstruction { class NativeGeneralJump : public NativeInstruction {
public: public:
address jump_destination() const { address jump_destination() const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
static void insert_unconditional(address code_pos, address entry) { static void insert_unconditional(address code_pos, address entry) {
...@@ -191,6 +209,7 @@ class NativeGeneralJump : public NativeInstruction { ...@@ -191,6 +209,7 @@ class NativeGeneralJump : public NativeInstruction {
inline NativeGeneralJump* nativeGeneralJump_at(address address) { inline NativeGeneralJump* nativeGeneralJump_at(address address) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
#endif // CPU_ZERO_VM_NATIVEINST_ZERO_HPP #endif // CPU_ZERO_VM_NATIVEINST_ZERO_HPP
...@@ -32,8 +32,10 @@ const int ConcreteRegisterImpl::max_fpr = ...@@ -32,8 +32,10 @@ const int ConcreteRegisterImpl::max_fpr =
const char* RegisterImpl::name() const { const char* RegisterImpl::name() const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
const char* FloatRegisterImpl::name() const { const char* FloatRegisterImpl::name() const {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
...@@ -37,6 +37,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { ...@@ -37,6 +37,7 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
address Relocation::pd_call_destination(address orig_addr) { address Relocation::pd_call_destination(address orig_addr) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
void Relocation::pd_set_call_destination(address x) { void Relocation::pd_set_call_destination(address x) {
...@@ -45,6 +46,7 @@ void Relocation::pd_set_call_destination(address x) { ...@@ -45,6 +46,7 @@ void Relocation::pd_set_call_destination(address x) {
address Relocation::pd_get_address_from_code() { address Relocation::pd_get_address_from_code() {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
address* Relocation::pd_address_in_code() { address* Relocation::pd_address_in_code() {
......
...@@ -89,6 +89,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, ...@@ -89,6 +89,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
ret_type); ret_type);
#else #else
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
#endif // SHARK #endif // SHARK
} }
...@@ -99,6 +100,7 @@ int Deoptimization::last_frame_adjust(int callee_parameters, ...@@ -99,6 +100,7 @@ int Deoptimization::last_frame_adjust(int callee_parameters,
uint SharedRuntime::out_preserve_stack_slots() { uint SharedRuntime::out_preserve_stack_slots() {
ShouldNotCallThis(); ShouldNotCallThis();
return 0;
} }
JRT_LEAF(void, zero_stub()) JRT_LEAF(void, zero_stub())
...@@ -135,4 +137,5 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt, ...@@ -135,4 +137,5 @@ int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
VMRegPair *regs, VMRegPair *regs,
int total_args_passed) { int total_args_passed) {
ShouldNotCallThis(); ShouldNotCallThis();
return 0;
} }
...@@ -39,16 +39,20 @@ ...@@ -39,16 +39,20 @@
VtableStub* VtableStubs::create_vtable_stub(int vtable_index) { VtableStub* VtableStubs::create_vtable_stub(int vtable_index) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
VtableStub* VtableStubs::create_itable_stub(int vtable_index) { VtableStub* VtableStubs::create_itable_stub(int vtable_index) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
int VtableStub::pd_code_size_limit(bool is_vtable_stub) { int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
ShouldNotCallThis(); ShouldNotCallThis();
return 0;
} }
int VtableStub::pd_code_alignment() { int VtableStub::pd_code_alignment() {
ShouldNotCallThis(); ShouldNotCallThis();
return 0;
} }
...@@ -715,6 +715,7 @@ JVM_handle_bsd_signal(int sig, ...@@ -715,6 +715,7 @@ JVM_handle_bsd_signal(int sig,
err.report_and_die(); err.report_and_die();
ShouldNotReachHere(); ShouldNotReachHere();
return false;
} }
// From solaris_i486.s ported to bsd_i486.s // From solaris_i486.s ported to bsd_i486.s
......
...@@ -66,6 +66,7 @@ address os::current_stack_pointer() { ...@@ -66,6 +66,7 @@ address os::current_stack_pointer() {
frame os::get_sender_for_C_frame(frame* fr) { frame os::get_sender_for_C_frame(frame* fr) {
ShouldNotCallThis(); ShouldNotCallThis();
return frame();
} }
frame os::current_frame() { frame os::current_frame() {
...@@ -103,16 +104,19 @@ void os::initialize_thread(Thread* thr) { ...@@ -103,16 +104,19 @@ void os::initialize_thread(Thread* thr) {
address os::Bsd::ucontext_get_pc(ucontext_t* uc) { address os::Bsd::ucontext_get_pc(ucontext_t* uc) {
ShouldNotCallThis(); ShouldNotCallThis();
return NULL;
} }
ExtendedPC os::fetch_frame_from_context(void* ucVoid, ExtendedPC os::fetch_frame_from_context(void* ucVoid,
intptr_t** ret_sp, intptr_t** ret_sp,
intptr_t** ret_fp) { intptr_t** ret_fp) {
ShouldNotCallThis(); ShouldNotCallThis();
return ExtendedPC();
} }
frame os::fetch_frame_from_context(void* ucVoid) { frame os::fetch_frame_from_context(void* ucVoid) {
ShouldNotCallThis(); ShouldNotCallThis();
return frame();
} }
extern "C" JNIEXPORT int extern "C" JNIEXPORT int
...@@ -240,6 +244,7 @@ JVM_handle_bsd_signal(int sig, ...@@ -240,6 +244,7 @@ JVM_handle_bsd_signal(int sig,
sprintf(buf, fmt, sig, info->si_addr); sprintf(buf, fmt, sig, info->si_addr);
fatal(buf); fatal(buf);
return false;
} }
void os::Bsd::init_thread_fpu_state(void) { void os::Bsd::init_thread_fpu_state(void) {
...@@ -373,17 +378,7 @@ void os::print_register_info(outputStream *st, void *context) { ...@@ -373,17 +378,7 @@ void os::print_register_info(outputStream *st, void *context) {
extern "C" { extern "C" {
int SpinPause() { int SpinPause() {
} return 1;
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;
} }
void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) { void _Copy_conjoint_jshorts_atomic(jshort* from, jshort* to, size_t count) {
......
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
void* ucontext, void* ucontext,
bool isInJava) { bool isInJava) {
ShouldNotCallThis(); ShouldNotCallThis();
return false;
} }
// These routines are only used on cpu architectures that // These routines are only used on cpu architectures that
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册