* don't write (stabs)line info when inlining a procedure

This commit is contained in:
peter 2002-08-20 16:55:38 +00:00
parent 70028e433d
commit ecb430a8eb
4 changed files with 42 additions and 27 deletions

View File

@ -338,8 +338,8 @@ var
(cs_gdb_lineinfo in aktglobalswitches) then (cs_gdb_lineinfo in aktglobalswitches) then
WriteFileLineInfo(hp.fileinfo); WriteFileLineInfo(hp.fileinfo);
{$endif GDB} {$endif GDB}
{ no line info for inlined code }
if do_line then if do_line and (inlinelevel=0) then
begin begin
{ load infile } { load infile }
if lastfileinfo.fileindex<>hp.fileinfo.fileindex then if lastfileinfo.fileindex<>hp.fileinfo.fileindex then
@ -800,7 +800,10 @@ var
end. end.
{ {
$Log$ $Log$
Revision 1.10 2002-08-18 22:16:14 florian Revision 1.11 2002-08-20 16:55:38 peter
* don't write (stabs)line info when inlining a procedure
Revision 1.10 2002/08/18 22:16:14 florian
+ the ppc gas assembler writer adds now registers aliases + the ppc gas assembler writer adds now registers aliases
to the assembler file to the assembler file

View File

@ -979,13 +979,16 @@ Implementation
function TInternalAssembler.TreePass1(hp:Tai):Tai; function TInternalAssembler.TreePass1(hp:Tai):Tai;
var var
InlineLevel,
i,l : longint; i,l : longint;
begin begin
inlinelevel:=0;
while assigned(hp) do while assigned(hp) do
begin begin
{$ifdef GDB} {$ifdef GDB}
{ write stabs } { write stabs, no line info for inlined code }
if ((cs_debuginfo in aktmoduleswitches) or if (inlinelevel=0) and
((cs_debuginfo in aktmoduleswitches) or
(cs_gdb_lineinfo in aktglobalswitches)) then (cs_gdb_lineinfo in aktglobalswitches)) then
begin begin
if (objectalloc.currsec<>sec_none) and if (objectalloc.currsec<>sec_none) and
@ -1145,6 +1148,11 @@ Implementation
ait_cut : ait_cut :
if SmartAsm then if SmartAsm then
break; break;
ait_marker :
if tai_marker(hp).kind=InlineStart then
inc(InlineLevel)
else if tai_marker(hp).kind=InlineEnd then
dec(InlineLevel);
end; end;
hp:=Tai(hp.next); hp:=Tai(hp.next);
end; end;
@ -1154,17 +1162,20 @@ Implementation
function TInternalAssembler.TreePass2(hp:Tai):Tai; function TInternalAssembler.TreePass2(hp:Tai):Tai;
var var
InlineLevel,
l : longint; l : longint;
{$ifdef i386} {$ifdef i386}
co : comp; co : comp;
{$endif i386} {$endif i386}
begin begin
inlinelevel:=0;
{ main loop } { main loop }
while assigned(hp) do while assigned(hp) do
begin begin
{$ifdef GDB} {$ifdef GDB}
{ write stabs } { write stabs, no line info for inlined code }
if ((cs_debuginfo in aktmoduleswitches) or if (inlinelevel=0) and
((cs_debuginfo in aktmoduleswitches) or
(cs_gdb_lineinfo in aktglobalswitches)) then (cs_gdb_lineinfo in aktglobalswitches)) then
begin begin
if (objectdata.currsec<>sec_none) and if (objectdata.currsec<>sec_none) and
@ -1277,6 +1288,11 @@ Implementation
ait_cut : ait_cut :
if SmartAsm then if SmartAsm then
break; break;
ait_marker :
if tai_marker(hp).kind=InlineStart then
inc(InlineLevel)
else if tai_marker(hp).kind=InlineEnd then
dec(InlineLevel);
end; end;
hp:=Tai(hp.next); hp:=Tai(hp.next);
end; end;
@ -1592,7 +1608,10 @@ Implementation
end. end.
{ {
$Log$ $Log$
Revision 1.42 2002-08-12 15:08:39 carl Revision 1.43 2002-08-20 16:55:38 peter
* don't write (stabs)line info when inlining a procedure
Revision 1.42 2002/08/12 15:08:39 carl
+ stab register indexes for powerpc (moved from gdb to cpubase) + stab register indexes for powerpc (moved from gdb to cpubase)
+ tprocessor enumeration moved to cpuinfo + tprocessor enumeration moved to cpuinfo
+ linker in target_info is now a class + linker in target_info is now a class

View File

@ -1405,17 +1405,11 @@ implementation
inlineexitcode:=TAAsmoutput.Create; inlineexitcode:=TAAsmoutput.Create;
ps:=para_size; ps:=para_size;
make_global:=false; { to avoid warning } make_global:=false; { to avoid warning }
aktfilepos.line:=0;
aktfilepos.column:=0;
aktfilepos.fileindex:=0;
genentrycode(inlineentrycode,make_global,0,ps,nostackframe,true); genentrycode(inlineentrycode,make_global,0,ps,nostackframe,true);
if po_assembler in aktprocdef.procoptions then if po_assembler in aktprocdef.procoptions then
inlineentrycode.insert(Tai_marker.Create(asmblockstart)); inlineentrycode.insert(Tai_marker.Create(asmblockstart));
exprasmList.concatlist(inlineentrycode); exprasmList.concatlist(inlineentrycode);
secondpass(inlinetree); secondpass(inlinetree);
aktfilepos.line:=0;
aktfilepos.column:=0;
aktfilepos.fileindex:=0;
genexitcode(inlineexitcode,0,false,true); genexitcode(inlineexitcode,0,false,true);
if po_assembler in aktprocdef.procoptions then if po_assembler in aktprocdef.procoptions then
inlineexitcode.concat(Tai_marker.Create(asmblockend)); inlineexitcode.concat(Tai_marker.Create(asmblockend));
@ -1475,7 +1469,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.13 2002-08-19 19:36:42 peter Revision 1.14 2002-08-20 16:55:38 peter
* don't write (stabs)line info when inlining a procedure
Revision 1.13 2002/08/19 19:36:42 peter
* More fixes for cross unit inlining, all tnodes are now implemented * More fixes for cross unit inlining, all tnodes are now implemented
* Moved pocall_internconst to po_internconst because it is not a * Moved pocall_internconst to po_internconst because it is not a
calling type at all and it conflicted when inlining of these small calling type at all and it conflicted when inlining of these small

View File

@ -179,13 +179,6 @@ implementation
curptree:=@p; curptree:=@p;
p^.usableregs:=usablereg32; p^.usableregs:=usablereg32;
{$endif TEMPREGDEBUG} {$endif TEMPREGDEBUG}
if inlining_procedure then
begin
aktfilepos.line:=0;
aktfilepos.column:=0;
aktfilepos.fileindex:=0;
end
else
aktfilepos:=p.fileinfo; aktfilepos:=p.fileinfo;
aktlocalswitches:=p.localswitches; aktlocalswitches:=p.localswitches;
codegenerror:=false; codegenerror:=false;
@ -337,7 +330,10 @@ implementation
end. end.
{ {
$Log$ $Log$
Revision 1.37 2002-08-19 19:36:44 peter Revision 1.38 2002-08-20 16:55:38 peter
* don't write (stabs)line info when inlining a procedure
Revision 1.37 2002/08/19 19:36:44 peter
* More fixes for cross unit inlining, all tnodes are now implemented * More fixes for cross unit inlining, all tnodes are now implemented
* Moved pocall_internconst to po_internconst because it is not a * Moved pocall_internconst to po_internconst because it is not a
calling type at all and it conflicted when inlining of these small calling type at all and it conflicted when inlining of these small