Parcourir la source

* Use TExternalAssembler.WriteComments() also by nasm and intel assembler writers.

git-svn-id: trunk@46553 -
yury il y a 5 ans
Parent
commit
8cc5842317
2 fichiers modifiés avec 4 ajouts et 42 suppressions
  1. 2 21
      compiler/x86/agx86int.pas
  2. 2 21
      compiler/x86/agx86nsm.pas

+ 2 - 21
compiler/x86/agx86int.pas

@@ -541,26 +541,6 @@ implementation
          DoNotSplitLine:=false;
 
          case hp.typ of
-           ait_comment :
-             Begin
-               writer.AsmWrite(asminfo^.comment);
-               writer.AsmWritePChar(tai_comment(hp).str);
-               writer.AsmLn;
-             End;
-
-           ait_regalloc :
-             begin
-               if (cs_asm_regalloc in current_settings.globalswitches) then
-                 writer.AsmWriteLn(asminfo^.comment+'Register '+masm_regname(tai_regalloc(hp).reg)+
-                   regallocstr[tai_regalloc(hp).ratype]);
-             end;
-
-           ait_tempalloc :
-             begin
-               if (cs_asm_tempalloc in current_settings.globalswitches) then
-                 WriteTempalloc(tai_tempalloc(hp));
-             end;
-
            ait_section :
              begin
                if tai_section(hp).sectype<>sec_none then
@@ -1032,7 +1012,8 @@ implementation
            ait_seh_directive :
              { Ignore for now };
            else
-            internalerror(10000);
+             if not WriteComments(hp) then
+               internalerror(10000);
          end;
          hp:=tai(hp.next);
        end;

+ 2 - 21
compiler/x86/agx86nsm.pas

@@ -751,26 +751,6 @@ interface
           end;
 
          case hp.typ of
-           ait_comment :
-             Begin
-               writer.AsmWrite(asminfo^.comment);
-               writer.AsmWritePChar(tai_comment(hp).str);
-               writer.AsmLn;
-             End;
-
-           ait_regalloc :
-             begin
-               if (cs_asm_regalloc in current_settings.globalswitches) then
-                 writer.AsmWriteLn(#9#9+asminfo^.comment+'Register '+nasm_regname(tai_regalloc(hp).reg)+' '+
-                   regallocstr[tai_regalloc(hp).ratype]);
-             end;
-
-           ait_tempalloc :
-             begin
-               if (cs_asm_tempalloc in current_settings.globalswitches) then
-                 WriteTempalloc(tai_tempalloc(hp));
-             end;
-
            ait_section :
              begin
                if tai_section(hp).sectype<>sec_none then
@@ -1319,7 +1299,8 @@ interface
            ait_seh_directive :
              { Ignore for now };
            else
-             internalerror(10000);
+             if not WriteComments(hp) then
+               internalerror(10000);
          end;
          hp:=tai(hp.next);
        end;