Add warning/error message about possible problems with nostackframe modifier

git-svn-id: trunk@22677 -
This commit is contained in:
pierre 2012-10-16 22:42:28 +00:00
parent 6bd0e88e6b
commit be5839e44a
5 changed files with 441 additions and 424 deletions

View File

@ -390,7 +390,7 @@ scan_w_unavailable_system_codepage=02091_W_Current system codepage "$1" is not a
#
# Parser
#
# 03322 is the last used one
# 03324 is the last used one
#
% \section{Parser messages}
% This section lists all parser messages. The parser takes care of the
@ -1447,6 +1447,12 @@ parser_e_jvm_invalid_virtual_constructor_call=03321_E_Calling a virtual construc
parser_e_method_lower_visibility=03322_E_Overriding method "$1" cannot have a lower visibility ($2) than in parent class $3 ($4)
% The JVM does not allow lowering the visibility of an overriding method.
% \end{description}
parser_w_nostackframe_without_assembler=03323_W_Procedure/Function declared with call option NOSTACKFRAME but without ASSEMBLER
% nostackframe call modifier is supposed to be used in conjunction with assembler.
parser_e_nostackframe_with_locals=03324_E_Procedure/Function declared with call option NOSTACKFRAME but local stack size is $2
% nostackframe call modifier used without assembler modifier
% might still generate local stack needs.
%
# Type Checking
#
# 04119 is the last used one

View File

@ -417,6 +417,8 @@ const
parser_e_feature_unsupported_for_vm=03320;
parser_e_jvm_invalid_virtual_constructor_call=03321;
parser_e_method_lower_visibility=03322;
parser_w_nostackframe_without_assembler=03323;
parser_e_nostackframe_with_locals=03324;
type_e_mismatch=04000;
type_e_incompatible_types=04001;
type_e_not_equal_types=04002;
@ -954,9 +956,9 @@ const
option_info=11024;
option_help_pages=11025;
MsgTxtSize = 66864;
MsgTxtSize = 67045;
MsgIdxMax : array[1..20] of longint=(
26,92,323,120,87,56,124,26,202,63,
26,92,325,120,87,56,124,26,202,63,
53,20,1,1,1,1,1,1,1,1
);

File diff suppressed because it is too large Load Diff

View File

@ -1323,7 +1323,7 @@ implementation
procedure gen_proc_entry_code(list:TAsmList);
var
hitemp,
lotemp : longint;
lotemp, stack_frame_size : longint;
begin
{ generate call frame marker for dwarf call frame info }
current_asmdata.asmcfi.start_frame(list);
@ -1346,7 +1346,12 @@ implementation
end;
{ generate target specific proc entry code }
hlcg.g_proc_entry(list,current_procinfo.calc_stackframe_size,(po_nostackframe in current_procinfo.procdef.procoptions));
stack_frame_size := current_procinfo.calc_stackframe_size;
if (stack_frame_size <> 0) and
(po_nostackframe in current_procinfo.procdef.procoptions) then
message1(parser_e_nostackframe_with_locals,tostr(stack_frame_size));
hlcg.g_proc_entry(list,stack_frame_size,(po_nostackframe in current_procinfo.procdef.procoptions));
end;

View File

@ -2930,6 +2930,9 @@ const
else
break;
end;
if (po_nostackframe in pd.procoptions) and
not (po_assembler in pd.procoptions) then
message(parser_w_nostackframe_without_assembler);
end;