Browse Source

+ handle -CPPACKENUM and -CPPACKRECORD, resolves #27153

git-svn-id: trunk@29283 -
florian 10 years ago
parent
commit
bb01872821
6 changed files with 270 additions and 244 deletions
  1. 1 0
      .gitattributes
  2. 2 0
      compiler/msg/errore.msg
  3. 1 1
      compiler/msgidx.inc
  4. 223 225
      compiler/msgtxt.inc
  5. 40 18
      compiler/options.pas
  6. 3 0
      tests/webtbs/tw27153.pp

+ 1 - 0
.gitattributes

@@ -14167,6 +14167,7 @@ tests/webtbs/tw2708.pp svneol=native#text/plain
 tests/webtbs/tw2710.pp svneol=native#text/plain
 tests/webtbs/tw2710.pp svneol=native#text/plain
 tests/webtbs/tw27120.pp svneol=native#text/pascal
 tests/webtbs/tw27120.pp svneol=native#text/pascal
 tests/webtbs/tw2713.pp svneol=native#text/plain
 tests/webtbs/tw2713.pp svneol=native#text/plain
+tests/webtbs/tw27153.pp svneol=native#text/pascal
 tests/webtbs/tw2721.pp svneol=native#text/plain
 tests/webtbs/tw2721.pp svneol=native#text/plain
 tests/webtbs/tw2723.pp svneol=native#text/plain
 tests/webtbs/tw2723.pp svneol=native#text/plain
 tests/webtbs/tw2725.pp svneol=native#text/plain
 tests/webtbs/tw2725.pp svneol=native#text/plain

+ 2 - 0
compiler/msg/errore.msg

@@ -3493,6 +3493,8 @@ P*2CN_Generate nil-pointer checks (AIX-only)
 **2Cp<x>_Select instruction set; see fpc -i or fpc -ic for possible values
 **2Cp<x>_Select instruction set; see fpc -i or fpc -ic for possible values
 **2CP<x>=<y>_ packing settings
 **2CP<x>=<y>_ packing settings
 **3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 and 8
 **3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 and 8
+**3CPPACKENUM=<y>_ <y> enum packing: 0, 1, 2 and 4 or DEFAULT or NORMAL
+**3CPPACKRECORD=<y>_ <y> record packing: 0 or DEFAULT or NORMAL, 1, 2, 4, 8, 16 and 32
 **2Cr_Range checking
 **2Cr_Range checking
 **2CR_Verify object method call validity
 **2CR_Verify object method call validity
 **2Cs<n>_Set stack checking size to <n>
 **2Cs<n>_Set stack checking size to <n>

+ 1 - 1
compiler/msgidx.inc

@@ -994,7 +994,7 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 73924;
+  MsgTxtSize = 74049;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
     26,99,339,123,89,57,126,27,202,64,
     26,99,339,123,89,57,126,27,202,64,

File diff suppressed because it is too large
+ 223 - 225
compiler/msgtxt.inc


+ 40 - 18
compiler/options.pas

@@ -1198,24 +1198,46 @@ begin
                     'P':
                     'P':
                       begin
                       begin
                         delete(more,1,1);
                         delete(more,1,1);
-                        if upper(copy(more,1,pos('=',more)-1))='PACKSET' then
-                          begin
-                            delete(more,1,pos('=',more));
-                            if (more='0') or (more='DEFAULT') or (more='NORMAL') then
-                              init_settings.setalloc:=0
-                            else if  more='1' then
-                              init_settings.setalloc:=1
-                            else if more='2' then
-                              init_settings.setalloc:=2
-                            else if more='4' then
-                              init_settings.setalloc:=4
-                            else if more='8' then
-                              init_settings.setalloc:=8
-                            else
-                              IllegalPara(opt);
-                          end
-                        else
-                          IllegalPara(opt);
+                        case upper(copy(more,1,pos('=',more)-1)) of
+                          'PACKSET':
+                            begin
+                              delete(more,1,pos('=',more));
+                              case more of
+                                '0','DEFAULT','NORMAL':
+                                  init_settings.setalloc:=0;
+                                '1','2','4','8':
+                                  init_settings.setalloc:=StrToInt(more);
+                                else
+                                  IllegalPara(opt);
+                              end
+                            end;
+                          'PACKENUM':
+                            begin
+                              delete(more,1,pos('=',more));
+                              case more of
+                                '0','DEFAULT','NORMAL':
+                                  init_settings.packenum:=4;
+                                '1','2','4':
+                                  init_settings.packenum:=StrToInt(more);
+                                else
+                                  IllegalPara(opt);
+                              end;
+                            end;
+                          'PACKRECORD':
+                            begin
+                              delete(more,1,pos('=',more));
+                              case more of
+                                '0','DEFAULT','NORMAL':
+                                  init_settings.packrecords:=default_settings.packrecords;
+                                '1','2','4','8','16','32':
+                                  init_settings.packrecords:=StrToInt(more);
+                                else
+                                  IllegalPara(opt);
+                              end;
+                            end
+                          else
+                            IllegalPara(opt);
+                        end;
                       end;
                       end;
                     'r' :
                     'r' :
                       If UnsetBool(More, j, opt, false) then
                       If UnsetBool(More, j, opt, false) then

+ 3 - 0
tests/webtbs/tw27153.pp

@@ -0,0 +1,3 @@
+{ %OPT=-CPPACKENUM=1 -CPPACKRECORD=1 -CPPACKSET=1}
+begin
+end.

Some files were not shown because too many files changed in this diff