Pārlūkot izejas kodu

+ introduced [hl]cg.a_label_pascal_goto_target. It is similar to [hl]cg.a_label
and is called by the code generator, when the label generated is the result of
a Pascal label.

Nikolay Nikolov 2 gadi atpakaļ
vecāks
revīzija
9b8af14f47
3 mainītis faili ar 16 papildinājumiem un 1 dzēšanām
  1. 8 0
      compiler/cgobj.pas
  2. 7 0
      compiler/hlcgobj.pas
  3. 1 1
      compiler/ncgflw.pas

+ 8 - 0
compiler/cgobj.pas

@@ -124,6 +124,8 @@ unit cgobj;
 
           {# Emit a label to the instruction stream. }
           procedure a_label(list : TAsmList;l : tasmlabel);virtual;
+          {# Emit a label that can be a target of a Pascal goto statement to the instruction stream. }
+          procedure a_label_pascal_goto_target(list : TAsmList;l : tasmlabel);virtual;
 
           {# Allocates register r by inserting a pai_realloc record }
           procedure a_reg_alloc(list : TAsmList;r : tregister);
@@ -953,6 +955,12 @@ implementation
       end;
 
 
+    procedure tcg.a_label_pascal_goto_target(list : TAsmList;l : tasmlabel);
+      begin
+        a_label(list,l);
+      end;
+
+
 {*****************************************************************************
           for better code generation these methods should be overridden
 ******************************************************************************}

+ 7 - 0
compiler/hlcgobj.pas

@@ -126,6 +126,8 @@ unit hlcgobj;
 
           {# Emit a label to the instruction stream. }
           procedure a_label(list : TAsmList;l : tasmlabel); inline;
+          {# Emit a label that can be a target of a Pascal goto statement to the instruction stream. }
+          procedure a_label_pascal_goto_target(list : TAsmList;l : tasmlabel); inline;
 
           {# Allocates register r by inserting a pai_realloc record }
           procedure a_reg_alloc(list : TAsmList;r : tregister); inline;
@@ -901,6 +903,11 @@ implementation
       cg.a_label(list,l);
     end;
 
+  procedure thlcgobj.a_label_pascal_goto_target(list : TAsmList;l : tasmlabel); inline;
+    begin
+      cg.a_label_pascal_goto_target(list,l);
+    end;
+
   procedure thlcgobj.a_reg_alloc(list: TAsmList; r: tregister);
     begin
       cg.a_reg_alloc(list,r);

+ 1 - 1
compiler/ncgflw.pas

@@ -502,7 +502,7 @@ implementation
          location_reset(location,LOC_VOID,OS_NO);
          if not (nf_internal in flags) then
            include(flowcontrol,fc_gotolabel);
-         hlcg.a_label(current_asmdata.CurrAsmList,getasmlabel);
+         hlcg.a_label_pascal_goto_target(current_asmdata.CurrAsmList,getasmlabel);
 
          { Write also extra label if this label was referenced from
            assembler block }