diff options
author | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2019-05-12 18:44:05 +0000 |
---|---|---|
committer | jonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2> | 2019-05-12 18:44:05 +0000 |
commit | 08a7bf3d9cae12254ec73dcba54ce179b0e42109 (patch) | |
tree | 889e1841cf8a71aa7ec7728211a8ff2a23eb5e9e | |
parent | 0df7d1db05537a3bf08a08036d5de2733335e902 (diff) | |
parent | e69ad5832da5c1af0a84c3029e1befafa52aa695 (diff) | |
download | fpc-08a7bf3d9cae12254ec73dcba54ce179b0e42109.tar.gz |
* synchronised with trunk till r42049
git-svn-id: https://svn.freepascal.org/svn/fpc/branches/debug_eh@42050 3ad0048d-3df7-0310-abae-a5850022a9f2
287 files changed, 4997 insertions, 1184 deletions
diff --git a/compiler/aarch64/agcpugas.pas b/compiler/aarch64/agcpugas.pas index 2d1665ebbc..9962d3de83 100644 --- a/compiler/aarch64/agcpugas.pas +++ b/compiler/aarch64/agcpugas.pas @@ -180,6 +180,8 @@ unit agcpugas; result:=result+']'; AM_PREINDEXED: result:=result+']!'; + else + ; end; end; end; diff --git a/compiler/aarch64/aoptcpu.pas b/compiler/aarch64/aoptcpu.pas index 07494e8148..73dc255a52 100644 --- a/compiler/aarch64/aoptcpu.pas +++ b/compiler/aarch64/aoptcpu.pas @@ -159,6 +159,8 @@ Implementation begin Result:=LookForPostindexedPattern(taicpu(p)); end; + else + ; end; end; end; diff --git a/compiler/aarch64/aoptcpub.pas b/compiler/aarch64/aoptcpub.pas index d2f19adc0b..37e197804e 100644 --- a/compiler/aarch64/aoptcpub.pas +++ b/compiler/aarch64/aoptcpub.pas @@ -142,6 +142,8 @@ Implementation exit end; end; + else + ; end; end; diff --git a/compiler/aarch64/cgcpu.pas b/compiler/aarch64/cgcpu.pas index 3719b18cba..09db04a688 100644 --- a/compiler/aarch64/cgcpu.pas +++ b/compiler/aarch64/cgcpu.pas @@ -382,8 +382,6 @@ implementation reference_reset_base(ref,preferred_newbasereg,ref.offset,ref.temppos,ref.alignment,ref.volatility); end; end - else - internalerror(2014110904); end; end; A_LDP,A_STP: @@ -1305,6 +1303,8 @@ implementation a_load_const_reg(list,size,a,dst); exit; end; + else + ; end; case op of OP_ADD, @@ -1453,6 +1453,8 @@ implementation check for overflow) } internalerror(2014122101); end; + else + internalerror(2019050936); end; end; a_op_reg_reg_reg(list,op,size,src1,src2,dst); diff --git a/compiler/aarch64/cpupara.pas b/compiler/aarch64/cpupara.pas index 0859e5cac3..b6c48384ff 100644 --- a/compiler/aarch64/cpupara.pas +++ b/compiler/aarch64/cpupara.pas @@ -208,6 +208,8 @@ unit cpupara; result:=def.size>16; stringdef : result:=tstringdef(def).stringtype in [st_shortstring,st_longstring]; + else + ; end; end; @@ -440,6 +442,8 @@ unit cpupara; loc:=LOC_REFERENCE; end; end; + else + ; end; { allocate registers/stack locations } diff --git a/compiler/aarch64/racpu.pas b/compiler/aarch64/racpu.pas index b043e147ed..91d32a2ab5 100644 --- a/compiler/aarch64/racpu.pas +++ b/compiler/aarch64/racpu.pas @@ -73,6 +73,7 @@ unit racpu; { a 32 bit integer register could actually be 16 or 8 bit } if result=OS_32 then case oppostfix of + PF_NONE: ; PF_B: result:=OS_8; PF_SB: @@ -81,6 +82,8 @@ unit racpu; result:=OS_16; PF_SH: result:=OS_S16; + else + Message(asmr_e_invalid_opcode_and_operand) end; end; diff --git a/compiler/aarch64/racpugas.pas b/compiler/aarch64/racpugas.pas index fda8e81f16..fe9eadeb0b 100644 --- a/compiler/aarch64/racpugas.pas +++ b/compiler/aarch64/racpugas.pas @@ -523,6 +523,8 @@ Unit racpugas; end; end; end; + else + ; end; result:=C_None;; end; diff --git a/compiler/aarch64/rgcpu.pas b/compiler/aarch64/rgcpu.pas index 9a75ce3398..328cf41b01 100644 --- a/compiler/aarch64/rgcpu.pas +++ b/compiler/aarch64/rgcpu.pas @@ -140,6 +140,8 @@ implementation { ok in immediate form } if taicpu(p).oper[taicpu(p).ops-1]^.typ=top_const then exit; + else + ; end; { add interferences for other registers } for i:=0 to taicpu(p).ops-1 do @@ -163,6 +165,8 @@ implementation add_edge(getsupreg(taicpu(p).oper[j]^.reg),getsupreg(taicpu(p).oper[i]^.ref^.base)); end; end; + else + ; end; end; end; diff --git a/compiler/aasmsym.pas b/compiler/aasmsym.pas index eafc943832..e3d7c63d1b 100644 --- a/compiler/aasmsym.pas +++ b/compiler/aasmsym.pas @@ -53,6 +53,8 @@ implementation case o.typ of top_local : o.localoper^.localsymderef.build(tlocalvarsym(o.localoper^.localsym)); + else + ; end; end; @@ -65,6 +67,8 @@ implementation end; top_local : o.localoper^.localsym:=tlocalvarsym(o.localoper^.localsymderef.resolve); + else + ; end; end; diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas index cff840c19c..47595b4908 100644 --- a/compiler/aasmtai.pas +++ b/compiler/aasmtai.pas @@ -2108,8 +2108,6 @@ implementation value.s128val:=ppufile.getreal; aitrealconst_s64comp: value.s64compval:=comp(ppufile.getint64); - else - internalerror(2014050602); end; end; @@ -2137,8 +2135,6 @@ implementation c:=comp(value.s64compval); ppufile.putint64(int64(c)); end - else - internalerror(2014050601); end; end; @@ -2167,8 +2163,6 @@ implementation result:=10; aitrealconst_s128bit: result:=16; - else - internalerror(2014050603); end; end; @@ -2833,6 +2827,8 @@ implementation add_reg_instruction_hook(self,shifterop^.rs); end; {$endif ARM} + else + ; end; end; end; @@ -2858,6 +2854,8 @@ implementation top_wstring: donewidestring(pwstrval); {$endif jvm} + else + ; end; typ:=top_none; end; @@ -2911,6 +2909,8 @@ implementation p.oper[i]^.shifterop^:=oper[i]^.shifterop^; end; {$endif ARM} + else + ; end; end; getcopy:=p; @@ -3272,8 +3272,6 @@ implementation ppufile.getdata(data.reg,sizeof(TRegister)); data.offset:=ppufile.getdword; end; - else - InternalError(2011091201); end; end; @@ -3301,8 +3299,6 @@ implementation ppufile.putdata(data.reg,sizeof(TRegister)); ppufile.putdword(data.offset); end; - else - InternalError(2011091202); end; end; diff --git a/compiler/aggas.pas b/compiler/aggas.pas index ffd2e078be..f6a1650d5d 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -378,6 +378,8 @@ implementation secname:='.data.rel.ro'; sec_rodata_norel: secname:='.rodata'; + else + ; end; end; @@ -511,8 +513,6 @@ implementation writer.AsmWrite(',"x"'); SF_None: writer.AsmWrite(',""'); - else - Internalerror(2018101502); end; case secprogbits of SPB_PROGBITS: @@ -521,8 +521,6 @@ implementation writer.AsmWrite(',%nobits'); SPB_None: ; - else - Internalerror(2018101503); end; end else @@ -1062,6 +1060,8 @@ implementation WriteDecodedUleb128(qword(tai_const(hp).value)); aitconst_sleb128bit: WriteDecodedSleb128(int64(tai_const(hp).value)); + else + ; end end else @@ -1814,6 +1814,8 @@ implementation result:='.section '+objc_section_name(atype); exit end; + else + ; end; result := inherited sectionname(atype,aname,aorder); end; diff --git a/compiler/aopt.pas b/compiler/aopt.pas index 97e234f193..fbbb136f8a 100644 --- a/compiler/aopt.pas +++ b/compiler/aopt.pas @@ -234,6 +234,8 @@ Unit aopt; end; End End + else + ; End; P := tai(p.Next); While Assigned(p) and diff --git a/compiler/aoptobj.pas b/compiler/aoptobj.pas index ba1e680a0c..29b33958f3 100644 --- a/compiler/aoptobj.pas +++ b/compiler/aoptobj.pas @@ -443,6 +443,8 @@ Unit AoptObj; Include(UsedRegs, getsupreg(tai_regalloc(p).reg)); ra_dealloc : Exclude(UsedRegs, getsupreg(tai_regalloc(p).reg)); + else + ; end; end; p := tai(p.next); @@ -919,6 +921,8 @@ Unit AoptObj; Include(UsedRegs[getregtype(tai_regalloc(p).reg)].UsedRegs, getsupreg(tai_regalloc(p).reg)); ra_dealloc : Exclude(UsedRegs[getregtype(tai_regalloc(p).reg)].UsedRegs, getsupreg(tai_regalloc(p).reg)); + else + ; end; p := tai(p.next); end; @@ -1689,6 +1693,8 @@ Unit AoptObj; begin end; { if is_jmp } end; + else + ; end; if assigned(p) then begin diff --git a/compiler/arm/aasmcpu.pas b/compiler/arm/aasmcpu.pas index 81c10250cc..fe53b1a12e 100644 --- a/compiler/arm/aasmcpu.pas +++ b/compiler/arm/aasmcpu.pas @@ -381,6 +381,8 @@ implementation if assigned(add_reg_instruction_hook) and (i in regset^) then add_reg_instruction_hook(self,newreg(R_MMREGISTER,i,regsetsubregtype)); end; + else + internalerror(2019050932); end; end; end; @@ -1141,6 +1143,8 @@ implementation begin inc(extradataoffset,multiplier*(((tai_realconst(hp).savesize-4)+3) div 4)); end; + else + ; end; { check if the same constant has been already inserted into the currently handled list, if yes, reuse it } @@ -1200,6 +1204,8 @@ implementation begin inc(curinspos,multiplier*((tai_realconst(hp).savesize+3) div 4)); end; + else + ; end; { special case for case jump tables } penalty:=0; @@ -1270,6 +1276,8 @@ implementation or if we splitted them so split before } CheckLimit(hp,4); end; + else + ; end; end; @@ -1424,8 +1432,11 @@ implementation end; end; end; + else; end; end; + else + ; end; curtai:=tai(curtai.Next); @@ -1489,8 +1500,12 @@ implementation taicpu(curtai).ops:=2; end; end; + else + ; end; end; + else + ; end; curtai:=tai(curtai.Next); @@ -1536,55 +1551,59 @@ implementation begin case curtai.typ of ait_instruction: - if IsIT(taicpu(curtai).opcode) then - begin - levels := GetITLevels(taicpu(curtai).opcode); - if levels < 4 then - begin - i:=levels; - hp1:=tai(curtai.Next); - while assigned(hp1) and - (i > 0) do - begin - if hp1.typ=ait_instruction then - begin - dec(i); - if (i = 0) and - mustbelast(hp1) then - begin - hp1:=nil; - break; - end; - end; - hp1:=tai(hp1.Next); - end; + begin + if IsIT(taicpu(curtai).opcode) then + begin + levels := GetITLevels(taicpu(curtai).opcode); + if levels < 4 then + begin + i:=levels; + hp1:=tai(curtai.Next); + while assigned(hp1) and + (i > 0) do + begin + if hp1.typ=ait_instruction then + begin + dec(i); + if (i = 0) and + mustbelast(hp1) then + begin + hp1:=nil; + break; + end; + end; + hp1:=tai(hp1.Next); + end; - if assigned(hp1) then - begin - // We are pointing at the first instruction after the IT block - while assigned(hp1) and - (hp1.typ<>ait_instruction) do - hp1:=tai(hp1.Next); - - if assigned(hp1) and - (hp1.typ=ait_instruction) and - IsIT(taicpu(hp1).opcode) then - begin - if (levels+GetITLevels(taicpu(hp1).opcode) <= 4) and - ((taicpu(curtai).oper[0]^.cc=taicpu(hp1).oper[0]^.cc) or - (taicpu(curtai).oper[0]^.cc=inverse_cond(taicpu(hp1).oper[0]^.cc))) then - begin - taicpu(curtai).opcode:=getMergedInstruction(taicpu(curtai).opcode, - taicpu(hp1).opcode, - taicpu(curtai).oper[0]^.cc=inverse_cond(taicpu(hp1).oper[0]^.cc)); + if assigned(hp1) then + begin + // We are pointing at the first instruction after the IT block + while assigned(hp1) and + (hp1.typ<>ait_instruction) do + hp1:=tai(hp1.Next); + + if assigned(hp1) and + (hp1.typ=ait_instruction) and + IsIT(taicpu(hp1).opcode) then + begin + if (levels+GetITLevels(taicpu(hp1).opcode) <= 4) and + ((taicpu(curtai).oper[0]^.cc=taicpu(hp1).oper[0]^.cc) or + (taicpu(curtai).oper[0]^.cc=inverse_cond(taicpu(hp1).oper[0]^.cc))) then + begin + taicpu(curtai).opcode:=getMergedInstruction(taicpu(curtai).opcode, + taicpu(hp1).opcode, + taicpu(curtai).oper[0]^.cc=inverse_cond(taicpu(hp1).oper[0]^.cc)); - list.Remove(hp1); - hp1.Free; - end; - end; - end; - end; - end; + list.Remove(hp1); + hp1.Free; + end; + end; + end; + end; + end; + end + else + ; end; curtai:=tai(curtai.Next); @@ -1611,6 +1630,8 @@ implementation case taicpu(curtai).opcode of A_AND: taicpu(curtai).opcode:=A_BIC; A_BIC: taicpu(curtai).opcode:=A_AND; + else + internalerror(2019050931); end; taicpu(curtai).oper[2]^.val:=(not taicpu(curtai).oper[2]^.val) and $FFFFFFFF; end @@ -1623,10 +1644,14 @@ implementation case taicpu(curtai).opcode of A_ADD: taicpu(curtai).opcode:=A_SUB; A_SUB: taicpu(curtai).opcode:=A_ADD; + else + internalerror(2019050930); end; taicpu(curtai).oper[2]^.val:=-taicpu(curtai).oper[2]^.val; end; end; + else + ; end; curtai:=tai(curtai.Next); @@ -1674,6 +1699,8 @@ implementation end; end; end; + else + ; end; curtai:=tai(curtai.Next); @@ -1699,6 +1726,7 @@ implementation (taicpu(curtai).oper[2]^.typ=top_shifterop) then begin case taicpu(curtai).oper[2]^.shifterop^.shiftmode of + SM_NONE: ; SM_LSL: taicpu(curtai).opcode:=A_LSL; SM_LSR: taicpu(curtai).opcode:=A_LSR; SM_ASR: taicpu(curtai).opcode:=A_ASR; @@ -1735,8 +1763,12 @@ implementation begin taicpu(curtai).opcode:=A_SVC; end; + else + ; end; end; + else + ; end; curtai:=tai(curtai.Next); @@ -2971,6 +3003,7 @@ implementation shift:=0; typ:=0; case oper[op]^.shifterop^.shiftmode of + SM_None: ; SM_LSL: begin typ:=0; shift:=oper[op]^.shifterop^.shiftimm; end; SM_LSR: begin typ:=1; shift:=oper[op]^.shifterop^.shiftimm; if shift=32 then shift:=0; end; SM_ASR: begin typ:=2; shift:=oper[op]^.shifterop^.shiftimm; if shift=32 then shift:=0; end; @@ -3983,6 +4016,8 @@ implementation bytes:=bytes or ((Rd and $F) shl 12); bytes:=bytes or (((Rd and $10) shr 4) shl 22); end; + else + Message(asmw_e_invalid_opcode_and_operands); end; end; #$41,#$91: // VMRS/VMSR @@ -4143,6 +4178,8 @@ implementation d:=(rd shr 4) and 1; rd:=rd and $F; end; + else + internalerror(2019050929); end; m:=0; @@ -4163,6 +4200,8 @@ implementation m:=(rm shr 4) and 1; rm:=rm and $F; end; + else + internalerror(2019050928); end; bytes:=bytes or (Rd shl 12); @@ -4179,6 +4218,8 @@ implementation PF_F64S32, PF_F64U32: bytes:=bytes or (1 shl 8); + else + ; end; if oppostfix in [PF_S32F32,PF_S32F64,PF_U32F32,PF_U32F64] then @@ -4187,6 +4228,8 @@ implementation PF_S32F64, PF_S32F32: bytes:=bytes or (1 shl 16); + else + ; end; bytes:=bytes or (1 shl 18); @@ -4257,9 +4300,9 @@ implementation rn:=16; end; - else - Rn:=0; - message(asmw_e_invalid_opcode_and_operands); + else + Rn:=0; + message(asmw_e_invalid_opcode_and_operands); end; case oppostfix of @@ -4271,10 +4314,10 @@ implementation bytes:=bytes or (1 shl 8); D:=(rd shr 4) and $1; Rd:=Rd and $F; end; - else - begin - D:=rd and $1; Rd:=Rd shr 1; - end; + else + begin + D:=rd and $1; Rd:=Rd shr 1; + end; end; case oppostfix of @@ -4283,6 +4326,8 @@ implementation PF_F64U16,PF_F32U16, PF_F32U32,PF_F64U32: bytes:=bytes or (1 shl 16); + else + ; end; if oppostfix in [PF_S32F32,PF_S32F64,PF_U32F32,PF_U32F64,PF_S16F32,PF_S16F64,PF_U16F32,PF_U16F64] then @@ -4335,6 +4380,8 @@ implementation bytes:=bytes or (1 shl 23); PF_DB,PF_DBS,PF_DBD,PF_DBX: bytes:=bytes or (2 shl 23); + else + ; end; case oppostfix of @@ -4343,6 +4390,8 @@ implementation bytes:=bytes or (1 shl 8); bytes:=bytes or (1 shl 0); // Offset is odd end; + else + ; end; dp_operation:=(oper[1]^.subreg=R_SUBFD); @@ -4634,6 +4683,8 @@ implementation bytes:=bytes or ((oper[2]^.val shr 2) and $7F); end; end; + else + internalerror(2019050926); end; end; #$65: { Thumb load/store } @@ -4770,6 +4821,8 @@ implementation else bytes:=bytes or (getsupreg(oper[0]^.reg) shl 8); end; + else + internalerror(2019050925); end; end; #$6A: { Thumb: IT } @@ -5375,6 +5428,8 @@ implementation case oppostfix of PF_None,PF_IA,PF_FD: bytes:=bytes or ($1 shl 23); PF_DB,PF_EA: bytes:=bytes or ($2 shl 23); + else + message1(asmw_e_invalid_opcode_and_operands, '"Invalid Postfix"'); end; end; #$8D: { Thumb-2: BL/BLX } @@ -5525,6 +5580,9 @@ implementation PF_D: bytes:=bytes or (0 shl 22) or (1 shl 15); PF_E: bytes:=bytes or (1 shl 22) or (0 shl 15); PF_P: bytes:=bytes or (1 shl 22) or (1 shl 15); + PF_EP: ; + else + message1(asmw_e_invalid_opcode_and_operands, '"Invalid postfix"'); end; end else @@ -5599,6 +5657,7 @@ implementation end; case roundingmode of + RM_NONE: ; RM_P: bytes:=bytes or (1 shl 5); RM_M: bytes:=bytes or (2 shl 5); RM_Z: bytes:=bytes or (3 shl 5); @@ -5626,6 +5685,7 @@ implementation bytes:=bytes or (getsupreg(oper[1]^.reg) shl 12); case roundingmode of + RM_NONE: ; RM_P: bytes:=bytes or (1 shl 5); RM_M: bytes:=bytes or (2 shl 5); RM_Z: bytes:=bytes or (3 shl 5); @@ -5645,6 +5705,7 @@ implementation bytes:=bytes or (getsupreg(oper[1]^.reg) shl 0); case roundingmode of + RM_NONE: ; RM_P: bytes:=bytes or (1 shl 5); RM_M: bytes:=bytes or (2 shl 5); RM_Z: bytes:=bytes or (3 shl 5); @@ -5674,6 +5735,8 @@ implementation Message(asmw_e_invalid_opcode_and_operands); end; end; + else + Message1(asmw_e_invalid_opcode_and_operands, '"Unsupported opcode"'); end; end; #$fe: // No written data diff --git a/compiler/arm/agarmgas.pas b/compiler/arm/agarmgas.pas index 7668cb4090..7547bd6bd5 100644 --- a/compiler/arm/agarmgas.pas +++ b/compiler/arm/agarmgas.pas @@ -218,6 +218,8 @@ unit agarmgas; s:=s+']'; AM_PREINDEXED: s:=s+']!'; + else + ; end; end; diff --git a/compiler/arm/aoptcpu.pas b/compiler/arm/aoptcpu.pas index 65891e4730..6cee67c7a9 100644 --- a/compiler/arm/aoptcpu.pas +++ b/compiler/arm/aoptcpu.pas @@ -241,6 +241,8 @@ Implementation instructionLoadsFromReg := (p.oper[I]^.ref^.base = reg) or (p.oper[I]^.ref^.index = reg); + else + ; end; if instructionLoadsFromReg then exit; {Bailout if we found something} Inc(I); @@ -300,6 +302,8 @@ Implementation A_POP: Result := (getsupreg(reg) in p.oper[0]^.regset^) or (reg=NR_STACK_POINTER_REG); + else + ; end; if Result then @@ -316,6 +320,8 @@ Implementation Result := (taicpu(p).oper[0]^.ref^.addressmode in [AM_PREINDEXED,AM_POSTINDEXED]) and (taicpu(p).oper[0]^.ref^.base = reg); + else + ; end; end; @@ -2252,8 +2258,12 @@ Implementation RemoveSuperfluousVMov(p, hp1, 'VOpVMov2VOp') then Result:=true; end + else + ; end; end; + else + ; end; end; @@ -2431,8 +2441,12 @@ Implementation end; end; end; + else + ; end; end; + else + ; end; p := tai(p.next) end; @@ -2512,6 +2526,8 @@ Implementation for r:=RS_R0 to RS_R15 do if r in p.oper[i]^.regset^ then CheckLiveStart(newreg(R_INTREGISTER,r,R_SUBWHOLE)); + else + ; end; { if live of any reg used by hp1 ends at hp1 and p uses this register then @@ -2531,6 +2547,8 @@ Implementation for r:=RS_R0 to RS_R15 do if r in hp1.oper[i]^.regset^ then CheckLiveEnd(newreg(R_INTREGISTER,r,R_SUBWHOLE)); + else + ; end; end; @@ -2727,7 +2745,11 @@ Implementation A_ITETT: if l=4 then taicpu(hp).opcode := A_ITET; A_ITTTT: - if l=4 then taicpu(hp).opcode := A_ITTT; + begin + if l=4 then taicpu(hp).opcode := A_ITTT; + end + else + ; end; break; @@ -2958,8 +2980,12 @@ Implementation end; end; end; + else + ; end; end; + else + ; end; p := tai(p.next) end; @@ -3110,6 +3136,8 @@ Implementation SM_LSR: taicpu(p).opcode:=A_LSR; SM_ASR: taicpu(p).opcode:=A_ASR; SM_ROR: taicpu(p).opcode:=A_ROR; + else + internalerror(2019050912); end; if taicpu(p).oper[2]^.shifterop^.rs<>NR_NO then diff --git a/compiler/arm/aoptcpub.pas b/compiler/arm/aoptcpub.pas index 25d2f50bd2..bc4a39e218 100644 --- a/compiler/arm/aoptcpub.pas +++ b/compiler/arm/aoptcpub.pas @@ -121,12 +121,16 @@ Implementation result:=false; case taicpu(p1).opcode of A_LDR: - { special handling for LDRD } - if (taicpu(p1).oppostfix=PF_D) and (getsupreg(taicpu(p1).oper[0]^.reg)+1=getsupreg(Reg)) then - begin - result:=true; - exit; - end; + begin + { special handling for LDRD } + if (taicpu(p1).oppostfix=PF_D) and (getsupreg(taicpu(p1).oper[0]^.reg)+1=getsupreg(Reg)) then + begin + result:=true; + exit; + end; + end; + else + ; end; for i:=0 to taicpu(p1).ops-1 do case taicpu(p1).oper[i]^.typ of @@ -134,8 +138,12 @@ Implementation if (taicpu(p1).oper[i]^.reg=Reg) and (taicpu(p1).spilling_get_operation_type(i) in [operand_write,operand_readwrite]) then exit(true); top_ref: - if (taicpu(p1).spilling_get_operation_type_ref(i,Reg)<>operand_read) then - exit(true); + begin + if (taicpu(p1).spilling_get_operation_type_ref(i,Reg)<>operand_read) then + exit(true); + end + else + ; end; end; diff --git a/compiler/arm/cgcpu.pas b/compiler/arm/cgcpu.pas index 51ac562770..7478e4b70e 100644 --- a/compiler/arm/cgcpu.pas +++ b/compiler/arm/cgcpu.pas @@ -898,9 +898,11 @@ unit cgcpu; a_load_const_reg(list, size, a, dst); exit; end; + else + ; end; ovloc.loc:=LOC_VOID; - if {$ifopt R+}(a<>-2147483648) and{$endif} not setflags and is_shifter_const(-a,shift) then + if (a<>-2147483648) and not setflags and is_shifter_const(-a,shift) then case op of OP_ADD: begin @@ -912,6 +914,8 @@ unit cgcpu; op:=OP_ADD; a:=aint(dword(-a)); end + else + ; end; if is_shifter_const(a,shift) and not(op in [OP_IMUL,OP_MUL]) then @@ -960,6 +964,8 @@ unit cgcpu; ovloc.resflags:=F_CS; OP_SUB: ovloc.resflags:=F_CC; + else + internalerror(2019050922); end; end; end @@ -1871,6 +1877,10 @@ unit cgcpu; firstfloatreg:=RS_NO; mmregs:=[]; case current_settings.fputype of + fpu_none, + fpu_soft, + fpu_libgcc: + ; fpu_fpa, fpu_fpa10, fpu_fpa11: @@ -1896,6 +1906,8 @@ unit cgcpu; as the even ones by with a different subtype as it is done on x86 with al/ah } mmregs:=(rg[R_MMREGISTER].used_in_proc-paramanager.get_volatile_registers_mm(pocall_stdcall))*[0..31]; end; + else + internalerror(2019050924); end; a_reg_alloc(list,NR_STACK_POINTER_REG); if current_procinfo.framepointer<>NR_STACK_POINTER_REG then @@ -2080,6 +2092,8 @@ unit cgcpu; if mmregs<>[] then list.concat(taicpu.op_ref_regset(A_VSTM,ref,R_MMREGISTER,R_SUBFD,mmregs)); end; + else + internalerror(2019050923); end; end; end; @@ -2109,6 +2123,10 @@ unit cgcpu; mmregs:=[]; saveregs:=[]; case current_settings.fputype of + fpu_none, + fpu_soft, + fpu_libgcc: + ; fpu_fpa, fpu_fpa10, fpu_fpa11: @@ -2138,6 +2156,8 @@ unit cgcpu; as the even ones by with a different subtype as it is done on x86 with al/ah } mmregs:=(rg[R_MMREGISTER].used_in_proc-paramanager.get_volatile_registers_mm(pocall_stdcall))*[0..31]; end; + else + internalerror(2019050926); end; if (firstfloatreg<>RS_NO) or @@ -2186,6 +2206,8 @@ unit cgcpu; if mmregs<>[] then list.concat(taicpu.op_ref_regset(A_VLDM,ref,R_MMREGISTER,R_SUBFD,mmregs)); end; + else + internalerror(2019050921); end; end; @@ -3044,6 +3066,8 @@ unit cgcpu; case instr.opcode of A_VMOV: add_move_instruction(instr); + else + ; end; end; @@ -3073,6 +3097,10 @@ unit cgcpu; if (fromsize<>tosize) then internalerror(2009112901); end; + OS_F32,OS_F64: + ; + else + internalerror(2019050920); end; if (fromsize<>tosize) then @@ -3134,6 +3162,10 @@ unit cgcpu; if (fromsize<>tosize) then internalerror(2009112901); end; + OS_F32,OS_F64: + ; + else + internalerror(2019050919); end; if (fromsize<>tosize) then @@ -3347,6 +3379,8 @@ unit cgcpu; OP_NEG, OP_NOT : internalerror(2012022501); + else + ; end; if (setflags or tbasecgarm(cg).cgsetflags) and (op in [OP_ADD,OP_SUB]) then begin @@ -3411,6 +3445,8 @@ unit cgcpu; ovloc.resflags:=F_CS; OP_SUB: ovloc.resflags:=F_CC; + else + internalerror(2019050918); end; end; end @@ -3484,6 +3520,8 @@ unit cgcpu; OP_NEG, OP_NOT : internalerror(2012022502); + else + ; end; if (setflags or tbasecgarm(cg).cgsetflags) and (op in [OP_ADD,OP_SUB]) then begin @@ -3512,6 +3550,8 @@ unit cgcpu; ovloc.resflags:=F_CS; OP_SUB: ovloc.resflags:=F_CC; + else + internalerror(2019050917); end; end; end @@ -4087,6 +4127,8 @@ unit cgcpu; op:=OP_ADD; a:=aint(dword(-a)); end + else + ; end; if is_thumb_imm(a) and (op in [OP_ADD,OP_SUB]) then @@ -4106,6 +4148,8 @@ unit cgcpu; OP_SUB: //!!! ovloc.resflags:=F_CC; ; + else + ; end; end; end @@ -4435,6 +4479,11 @@ unit cgcpu; OS_S8: list.concat(taicpu.op_reg_reg(A_SXTB,dst,dst)); OS_16: list.concat(taicpu.op_reg_reg(A_UXTH,dst,dst)); OS_S16: list.concat(taicpu.op_reg_reg(A_SXTH,dst,dst)); + OS_32, + OS_S32: + ; + else + internalerror(2019050916); end; end else @@ -4450,7 +4499,7 @@ unit cgcpu; l1 : longint; begin ovloc.loc:=LOC_VOID; - if {$ifopt R+}(a<>-2147483648) and{$endif} is_shifter_const(-a,shift) then + if (a<>-2147483648) and is_shifter_const(-a,shift) then case op of OP_ADD: begin @@ -4462,6 +4511,8 @@ unit cgcpu; op:=OP_ADD; a:=aint(dword(-a)); end + else + ; end; if is_shifter_const(a,shift) and not(op in [OP_IMUL,OP_MUL]) then @@ -4566,6 +4617,8 @@ unit cgcpu; ovloc.resflags:=F_CS; OP_SUB: ovloc.resflags:=F_CC; + else + ; end; end; end diff --git a/compiler/arm/cpubase.pas b/compiler/arm/cpubase.pas index 3d1719ff1a..d68c7cae1c 100644 --- a/compiler/arm/cpubase.pas +++ b/compiler/arm/cpubase.pas @@ -780,6 +780,8 @@ unit cpubase; ((((doublerec.bytes[6] and $7f)=$40) and ((doublerec.bytes[7] and $c0)=0)) or (((doublerec.bytes[6] and $7f)=$3f) and ((doublerec.bytes[7] and $c0)=$c0))); end; + else + ; end; end; diff --git a/compiler/arm/cpuelf.pas b/compiler/arm/cpuelf.pas index 4930a113eb..eef6103769 100644 --- a/compiler/arm/cpuelf.pas +++ b/compiler/arm/cpuelf.pas @@ -588,6 +588,8 @@ implementation data.Write(zero,4); continue; end; + else + ; end; if (objreloc.flags and rf_raw)=0 then diff --git a/compiler/arm/cpupara.pas b/compiler/arm/cpupara.pas index 9dae34e7a2..b2655e12a0 100644 --- a/compiler/arm/cpupara.pas +++ b/compiler/arm/cpupara.pas @@ -232,6 +232,8 @@ unit cpupara; result:=not is_smallset(def); stringdef : result:=tstringdef(def).stringtype in [st_shortstring,st_longstring]; + else + ; end; end; diff --git a/compiler/arm/cpupi.pas b/compiler/arm/cpupi.pas index a786d67eba..c232d18954 100644 --- a/compiler/arm/cpupi.pas +++ b/compiler/arm/cpupi.pas @@ -57,7 +57,7 @@ unit cpupi; implementation uses - globals,systems, + globals,systems,verbose, cpubase, tgobj, symconst,symtype,symsym,symcpu,paramgr, @@ -156,6 +156,10 @@ unit cpupi; maxpushedparasize:=align(maxpushedparasize,max(current_settings.alignment.localalignmin,4)); floatsavesize:=0; case current_settings.fputype of + fpu_none, + fpu_soft, + fpu_libgcc: + ; fpu_fpa, fpu_fpa10, fpu_fpa11: diff --git a/compiler/arm/narmadd.pas b/compiler/arm/narmadd.pas index 4594ef14af..dc3fb9c276 100644 --- a/compiler/arm/narmadd.pas +++ b/compiler/arm/narmadd.pas @@ -344,7 +344,7 @@ interface cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); current_asmdata.CurrAsmList.Concat(taicpu.op_reg_reg(A_VMRS, NR_APSR_nzcv, NR_FPSCR)); end; - fpu_soft: + else { this case should be handled already by pass1 } internalerror(2009112404); end; @@ -517,6 +517,8 @@ interface cg.a_reg_dealloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); nodetype:=oldnodetype; end; + else + ; end; cg.a_reg_alloc(current_asmdata.CurrAsmList,NR_DEFAULTFLAGS); current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(A_CMP,left.location.register64.reglo,right.location.register64.reglo)); @@ -647,6 +649,8 @@ interface if notnode then result:=cnotnode.create(result); end; + else + internalerror(2019050933); end; end else diff --git a/compiler/arm/narmcnv.pas b/compiler/arm/narmcnv.pas index 8af7553b07..3779729174 100644 --- a/compiler/arm/narmcnv.pas +++ b/compiler/arm/narmcnv.pas @@ -278,6 +278,9 @@ implementation else current_asmdata.CurrAsmList.concat(setoppostfix(taicpu.op_reg_reg(A_VCVT,location.register,left.location.register), PF_F32U32)); end; + else + { should be handled in pass 1 } + internalerror(2019050934); end; end; diff --git a/compiler/arm/raarmgas.pas b/compiler/arm/raarmgas.pas index 4eb7b29493..7b73c6d8bb 100644 --- a/compiler/arm/raarmgas.pas +++ b/compiler/arm/raarmgas.pas @@ -724,6 +724,8 @@ Unit raarmgas; end; end; end; + else + ; end; end; @@ -817,6 +819,8 @@ Unit raarmgas; oper.opr.ref.base:=NR_PC; oper.opr.ref.symbol:=GetConstLabel(sym,val); end; + else + ; end; end; @@ -1143,6 +1147,8 @@ Unit raarmgas; else Message(asmr_e_invalid_operand_type); // Otherwise it would have been seen as a AS_REGISTER end; + else + Message(asmr_e_invalid_operand_type); end; end; diff --git a/compiler/arm/rgcpu.pas b/compiler/arm/rgcpu.pas index 4802c67698..8f0279a18b 100644 --- a/compiler/arm/rgcpu.pas +++ b/compiler/arm/rgcpu.pas @@ -166,6 +166,8 @@ unit rgcpu; if current_procinfo.framepointer<>r then add_edge(getsupreg(taicpu(p).oper[1]^.ref^.base),getsupreg(r)); end; + else + ; end; end; end; @@ -353,6 +355,8 @@ unit rgcpu; RS_S21,RS_S23,RS_S25,RS_S27,RS_S29,RS_S31] do add_edge(supreg,i); end; + else + ; end; end; @@ -606,6 +610,8 @@ unit rgcpu; if current_procinfo.framepointer<>r then add_edge(getsupreg(taicpu(p).oper[1]^.ref^.base),getsupreg(r)); end; + else + ; end; end; end; @@ -658,6 +664,8 @@ unit rgcpu; add_edge(getsupreg(taicpu(p).oper[0]^.reg),i); end; end; + else + ; end; end; end; diff --git a/compiler/assemble.pas b/compiler/assemble.pas index 9c3b283d89..1d5a7320a7 100644 --- a/compiler/assemble.pas +++ b/compiler/assemble.pas @@ -1690,6 +1690,8 @@ Implementation ait_cutobject : if SmartAsm then break; + else + ; end; hp:=Tai(hp.next); end; @@ -1835,6 +1837,8 @@ Implementation internalerror(2010011102); end; end; + else + ; end; hp:=Tai(hp.next); end; @@ -2101,6 +2105,8 @@ Implementation )); end; {$endif OMFOBJSUPPORT} + else + ; end end; ait_symbolpair: @@ -2121,6 +2127,8 @@ Implementation ait_seh_directive : tai_seh_directive(hp).generate_code(objdata); {$endif DISABLE_WIN64_SEH} + else + ; end; hp:=Tai(hp.next); end; diff --git a/compiler/cfidwarf.pas b/compiler/cfidwarf.pas index 065c606bfd..7dd0144e40 100644 --- a/compiler/cfidwarf.pas +++ b/compiler/cfidwarf.pas @@ -217,8 +217,6 @@ implementation list.concat(tai_const.create_rel_sym(enc2ait_const[oper[i].enc],oper[i].beginsym,oper[i].endsym)); dop_reg : list.concat(tai_const.create(enc2ait_const[oper[i].enc],dwarf_reg(oper[i].register))); - else - internalerror(200404128); end; end; end; diff --git a/compiler/cgobj.pas b/compiler/cgobj.pas index 558345e544..24691f8094 100644 --- a/compiler/cgobj.pas +++ b/compiler/cgobj.pas @@ -1793,10 +1793,14 @@ implementation a:=a and 15; OS_8,OS_S8: a:=a and 7; + else + internalerror(2019050521); end; if a = 0 then op:=OP_NONE; end; + else + ; end; end; @@ -2123,6 +2127,8 @@ implementation a_load_const_reg(list,OS_16,0,dst); exit; end; + else + ; end; end; OP_SHR: @@ -2135,9 +2141,13 @@ implementation a_load_const_reg(list,OS_16,0,GetNextReg(dst)); exit; end; + else + ; end; end; {$endif cpu16bitalu} + else + ; end; a_load_reg_reg(list,size,size,src,dst); a_op_const_reg(list,op,size,a,dst); @@ -2787,6 +2797,8 @@ implementation { a_load_ref_reg will turn this into a pic-load if needed } a_load_ref_reg(list,OS_ADDR,OS_ADDR,ref,result); end; + else + ; end; end; diff --git a/compiler/dbgbase.pas b/compiler/dbgbase.pas index 7656f38dc4..2851aaddf2 100644 --- a/compiler/dbgbase.pas +++ b/compiler/dbgbase.pas @@ -339,8 +339,6 @@ implementation else internalerror(2012072402); end; - else - internalerror(200610054); end; end; looplist.clear; @@ -476,6 +474,8 @@ implementation list.concat(tai_comment.Create(strpnew('Defs - Begin Staticsymtable'))); globalsymtable : list.concat(tai_comment.Create(strpnew('Defs - Begin unit '+st.name^+' has index '+tostr(st.moduleid)))); + else + ; end; repeat nonewadded:=true; @@ -494,6 +494,8 @@ implementation list.concat(tai_comment.Create(strpnew('Defs - End Staticsymtable'))); globalsymtable : list.concat(tai_comment.Create(strpnew('Defs - End unit '+st.name^+' has index '+tostr(st.moduleid)))); + else + ; end; end; @@ -528,6 +530,8 @@ implementation list.concat(tai_comment.Create(strpnew('Syms - Begin Staticsymtable'))); globalsymtable : list.concat(tai_comment.Create(strpnew('Syms - Begin unit '+st.name^+' has index '+tostr(st.moduleid)))); + else + ; end; for i:=0 to st.SymList.Count-1 do begin @@ -545,6 +549,8 @@ implementation list.concat(tai_comment.Create(strpnew('Syms - End Staticsymtable'))); globalsymtable : list.concat(tai_comment.Create(strpnew('Syms - End unit '+st.name^+' has index '+tostr(st.moduleid)))); + else + ; end; end; @@ -568,6 +574,8 @@ implementation begin write_symtable_procdefs(list,tabstractrecorddef(def).symtable); end; + else + ; end; end; end; diff --git a/compiler/dbgcodeview.pas b/compiler/dbgcodeview.pas index abd84ca068..f2a3f6b6dd 100644 --- a/compiler/dbgcodeview.pas +++ b/compiler/dbgcodeview.pas @@ -229,8 +229,12 @@ implementation inc(nolineinfolevel); mark_NoLineInfoEnd: dec(nolineinfolevel); + else + ; end; end; + else + ; end; { OMF LINNUM records do not support multiple source files } diff --git a/compiler/dbgdwarf.pas b/compiler/dbgdwarf.pas index c83ceda72d..3ff81eef60 100644 --- a/compiler/dbgdwarf.pas +++ b/compiler/dbgdwarf.pas @@ -1110,6 +1110,8 @@ implementation appendsym_property(TAsmList(arg),tpropertysym(p)); constsym: appendsym_const_member(TAsmList(arg),tconstsym(p),true); + else + ; end; end; @@ -1365,8 +1367,6 @@ implementation append_attribute(DW_AT_address_class,DW_FORM_data1,[DW_ADDR_far16]); x86pt_huge: append_attribute(DW_AT_address_class,DW_FORM_data1,[DW_ADDR_huge16]); - else - internalerror(2018052401); end; {$else i8086} { Theoretically, we could do this, but it might upset some debuggers, } @@ -3166,8 +3166,6 @@ implementation templist.free; exit; end; - else - internalerror(2013120111); end; append_entry(DW_TAG_variable,false,[ @@ -3511,8 +3509,6 @@ implementation append_attribute(DW_AT_WATCOM_memory_model,DW_FORM_data1,[DW_WATCOM_MEMORY_MODEL_large]); mm_huge: append_attribute(DW_AT_WATCOM_memory_model,DW_FORM_data1,[DW_WATCOM_MEMORY_MODEL_huge]); - else - internalerror(2018052402); end; {$endif i8086} @@ -3681,14 +3677,18 @@ implementation procedure TDebugInfoDwarf.append_visibility(vis: tvisibility); begin case vis of + vis_hidden, vis_private, vis_strictprivate: append_attribute(DW_AT_accessibility,DW_FORM_data1,[ord(DW_ACCESS_private)]); vis_protected, vis_strictprotected: append_attribute(DW_AT_accessibility,DW_FORM_data1,[ord(DW_ACCESS_protected)]); + vis_published, vis_public: { default }; + vis_none: + internalerror(2019050720); end; end; @@ -3754,8 +3754,12 @@ implementation inc(nolineinfolevel); mark_NoLineInfoEnd: dec(nolineinfolevel); + else + ; end; end; + else + ; end; if (currsectype=sec_code) and @@ -4265,7 +4269,7 @@ implementation { now the information about the length of the string } if deref then begin - if (chardef.size=1) then + if not (is_widestring(def) and (tf_winlikewidestring in target_info.flags)) then upperopcodes:=13 else upperopcodes:=15; @@ -4275,7 +4279,7 @@ implementation DW_AT_upper_bound,DW_FORM_block1,upperopcodes ]); - { high(string) is stored sizeof(ptrint) bytes before the string data } + { high(string) is stored sizeof(sizeint) bytes before the string data } current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_push_object_address))); current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref))); current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_dup))); @@ -4287,7 +4291,11 @@ implementation current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_skip))); current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_16bit_unaligned(3)); { no -> load length } - current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit0)+sizeof(ptrint))); + if upperopcodes=15 then + { for Windows WideString the size is always a DWORD } + current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit4))) + else + current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_lit0)+sizesinttype.size)); current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_minus))); current_asmdata.asmlists[al_dwarf_info].concat(tai_const.create_8bit(ord(DW_OP_deref))); @@ -4346,15 +4354,7 @@ implementation end; st_widestring: begin - if not(tf_winlikewidestring in target_info.flags) then - addstringdef('WideString',cwidechartype,true,-1) - else - begin - { looks like a pwidechar (no idea about length location) } - append_entry(DW_TAG_pointer_type,false,[]); - append_labelentry_ref(DW_AT_type,def_dwarf_lab(cwidechartype)); - finish_entry; - end; + addstringdef('WideString',cwidechartype,true,-1) end; end; end; diff --git a/compiler/dbgstabs.pas b/compiler/dbgstabs.pas index 391be2fe15..b3bee7c0cb 100644 --- a/compiler/dbgstabs.pas +++ b/compiler/dbgstabs.pas @@ -516,6 +516,10 @@ implementation argnames:=argnames+'3out'; vs_constref : argnames:=argnames+'8constref'; + vs_value : + ; + vs_final: + internalerror(2019050911); end; end else @@ -1079,6 +1083,8 @@ implementation def.dbg_state:=dbg_state_queued; break; end; + else + ; end; end; appenddef(list,vmtarraytype); @@ -1106,6 +1112,8 @@ implementation appenddef(list,TImplementedInterface(anc.ImplementedInterfaces[i]).IntfDef); end; end; + else + ; end; end; @@ -1760,6 +1768,8 @@ implementation currfuncname:=tai_function_name(hp).funcname; ait_force_line : lastfileinfo.line:=-1; + else + ; end; if (currsectype=sec_code) and diff --git a/compiler/dbgstabx.pas b/compiler/dbgstabx.pas index 8f0b63d0bd..08f214af66 100644 --- a/compiler/dbgstabx.pas +++ b/compiler/dbgstabx.pas @@ -341,8 +341,12 @@ implementation inc(nolineinfolevel); mark_NoLineInfoEnd: dec(nolineinfolevel); + else + ; end; end; + else + ; end; if (currsectype=sec_code) and diff --git a/compiler/defcmp.pas b/compiler/defcmp.pas index 9fc5b29119..95790bee12 100644 --- a/compiler/defcmp.pas +++ b/compiler/defcmp.pas @@ -507,6 +507,8 @@ implementation doconv:=tc_cstring_2_int; end; end; + else + ; end; end; @@ -615,6 +617,8 @@ implementation eq:=te_convert_l6; end; end; + else + ; end; end; end; @@ -794,6 +798,8 @@ implementation end; end; end; + else + ; end; end; @@ -851,6 +857,8 @@ implementation end; end; end; + else + ; end; end; @@ -943,6 +951,8 @@ implementation end; end; end; + else + ; end; end; @@ -1213,6 +1223,8 @@ implementation eq:=te_convert_l1; end; end; + else + ; end; end; end; @@ -1256,6 +1268,8 @@ implementation eq:=te_convert_l1; end; end; + else + ; end; end; end; @@ -1542,6 +1556,8 @@ implementation eq:=te_convert_l2; end; end; + else + ; end; end; @@ -1582,6 +1598,8 @@ implementation eq:=te_convert_l1; end; end; + else + ; end; end; @@ -1638,6 +1656,8 @@ implementation eq:=te_convert_l1; end; end; + else + ; end; end; @@ -1889,6 +1909,8 @@ implementation if not (def_from.typ in [abstractdef,errordef]) then eq:=te_convert_l6; end; + else + ; end; { if we didn't find an appropriate type conversion yet @@ -1978,6 +2000,10 @@ implementation is_subequal:=(torddef(def2).ordtype=uwidechar); customint: is_subequal:=(torddef(def2).low=torddef(def1).low) and (torddef(def2).high=torddef(def1).high); + u128bit, s128bit, + scurrency, + uvoid: + ; end; end else diff --git a/compiler/defutil.pas b/compiler/defutil.pas index 6e4cae6f46..6ac905156b 100644 --- a/compiler/defutil.pas +++ b/compiler/defutil.pas @@ -1057,6 +1057,8 @@ implementation 1: l := l and $ff; 2: l := l and $ffff; 4: l := l and $ffffffff; + else + ; end; {reset sign, i.e. converting -1 to qword changes the value to high(qword)} l.signed:=false; @@ -1067,6 +1069,8 @@ implementation 1: l.svalue := shortint(l.svalue); 2: l.svalue := smallint(l.svalue); 4: l.svalue := longint(l.svalue); + else + ; end; l.signed:=true; end; @@ -1113,6 +1117,8 @@ implementation case tfloatdef(tarraydef(p).elementdef).floattype of s32real: mmx_type:=mmxsingle; + else + ; end else case torddef(tarraydef(p).elementdef).ordtype of @@ -1128,6 +1134,8 @@ implementation mmx_type:=mmxu32bit; s32bit: mmx_type:=mmxs32bit; + else + ; end; end; end; @@ -1462,7 +1470,6 @@ implementation As of today, both signed and unsigned types from 8 to 64 bits are supported. } function is_automatable(p : tdef) : boolean; begin - result:=false; case p.typ of orddef: result:=torddef(p).ordtype in [u8bit,s8bit,u16bit,s16bit,u32bit,s32bit, @@ -1475,6 +1482,8 @@ implementation result:=true; objectdef: result:=tobjectdef(p).objecttype in [odt_interfacecom,odt_dispinterface,odt_interfacecorba]; + else + result:=false; end; end; @@ -1554,6 +1563,8 @@ implementation result:=torddef(s64inttype); s64bit: result:=torddef(u64inttype); + else + ; end; end; @@ -1647,8 +1658,6 @@ implementation result:=tkWString; st_unicodestring: result:=tkUString; - else - result:=tkUnknown; end; enumdef: result:=tkEnumeration; diff --git a/compiler/fppu.pas b/compiler/fppu.pas index fcd6020b47..4546d511c6 100644 --- a/compiler/fppu.pas +++ b/compiler/fppu.pas @@ -1354,8 +1354,6 @@ var list:=publicasmsyms; ualt_extern: list:=externasmsyms; - else - internalerror(2016060301); end; c:=ppufile.getlongint; for i:=0 to c-1 do diff --git a/compiler/gendef.pas b/compiler/gendef.pas index e3e716a510..218bea8be2 100644 --- a/compiler/gendef.pas +++ b/compiler/gendef.pas @@ -136,6 +136,8 @@ begin if dllversion<>'' then writeln(t,'VERSION '+dllversion); end; + else + ; end; {write imports} diff --git a/compiler/globtype.pas b/compiler/globtype.pas index 63055c44fe..f1be8690cf 100644 --- a/compiler/globtype.pas +++ b/compiler/globtype.pas @@ -157,6 +157,7 @@ interface cs_do_inline,cs_fpu_fwait,cs_ieee_errors, cs_check_low_addr_load,cs_imported_data, cs_excessprecision,cs_check_fpu_exceptions, + cs_check_all_case_coverage, { mmx } cs_mmx,cs_mmx_saturation, { parser } @@ -485,7 +486,8 @@ interface m_isolike_io, { I/O as it required by an ISO compatible compiler } m_isolike_program_para, { program parameters as it required by an ISO compatible compiler } m_isolike_mod, { mod operation as it is required by an iso compatible compiler } - m_array_operators { use Delphi compatible array operators instead of custom ones ("+") } + m_array_operators, { use Delphi compatible array operators instead of custom ones ("+") } + m_multi_helpers { helpers can appear in multiple scopes simultaneously } ); tmodeswitches = set of tmodeswitch; @@ -674,7 +676,8 @@ interface 'ISOIO', 'ISOPROGRAMPARAS', 'ISOMOD', - 'ARRAYOPERATORS' + 'ARRAYOPERATORS', + 'MULTIHELPERS' ); diff --git a/compiler/hlcg2ll.pas b/compiler/hlcg2ll.pas index 2100e09acf..570844adca 100644 --- a/compiler/hlcg2ll.pas +++ b/compiler/hlcg2ll.pas @@ -1339,6 +1339,8 @@ implementation if getsupreg(paraloc.register)<first_fpu_imreg then cg.getcpuregister(list,paraloc.register); end; + else + ; end; end; @@ -1620,6 +1622,8 @@ implementation if getsupreg(paraloc.register)<first_fpu_imreg then cg.ungetcpuregister(list,paraloc.register); end; + else + ; end; end; @@ -2151,6 +2155,8 @@ implementation result:=OS_F64; OS_128: result:=OS_M128; + else + ; end; end; end; diff --git a/compiler/hlcgobj.pas b/compiler/hlcgobj.pas index 1e32f270f0..69e0fb98c3 100644 --- a/compiler/hlcgobj.pas +++ b/compiler/hlcgobj.pas @@ -4469,6 +4469,8 @@ implementation inn, asn,isn: result := fen_norecurse_false; + else + ; end; end; @@ -4549,6 +4551,8 @@ implementation potype_unitinit, potype_proginit: TSymtable(current_module.localsymtable).SymList.ForEachCall(@initialize_regvars,list); + else + ; end; { initialises temp. ansi/wide string data } @@ -4599,6 +4603,8 @@ implementation std_regname(vs.initialloc.reference.base)+tostr_with_plus(vs.initialloc.reference.offset)+ ', size='+tcgsize2str(vs.initialloc.size)))); end; + else + ; end; end; vs.localloc:=vs.initialloc; @@ -4881,6 +4887,8 @@ implementation end; end; end; + else + ; end; end; end; diff --git a/compiler/htypechk.pas b/compiler/htypechk.pas index b3f8c71bbe..2a9f378f75 100644 --- a/compiler/htypechk.pas +++ b/compiler/htypechk.pas @@ -605,6 +605,8 @@ implementation result:=true; end; + else + ; end; end; @@ -773,7 +775,11 @@ implementation optoken:=_OP_INC; in_dec_x: optoken:=_OP_DEC; + else + ; end; + else + ; end; if (optoken=NOTOKEN) then begin @@ -897,6 +903,8 @@ implementation optoken:=_GT; _GTE: optoken:=_LT; + else + ; end; candidates:=tcallcandidates.create_operator(optoken,ppn); end; @@ -1259,6 +1267,8 @@ implementation pointer itself is read and never written } newstate := vs_read; end; + else + ; end; p:=tunarynode(p).left; end; @@ -1361,6 +1371,8 @@ implementation vs_readwritten: if not(nf_write in tloadnode(p).flags) then include(tloadnode(p).flags,nf_modify); + else + ; end; break; end; @@ -1484,6 +1496,8 @@ implementation gotrecord:=true; stringdef : gotstring:=true; + else + ; end; if (valid_property in opts) then begin @@ -1626,6 +1640,8 @@ implementation exit end; end; + else + ; end; hp:=ttypeconvnode(hp).left; end; @@ -2056,6 +2072,8 @@ implementation (tfiledef(def_to).filetyp = ft_untyped) then eq:=te_convert_l1; end; + else + ; end; end; @@ -2133,6 +2151,8 @@ implementation end end; end; + else + ; end; end; @@ -2261,6 +2281,33 @@ implementation end; end; + function processhelper(hashedid:THashedIDString;helperdef:tobjectdef):boolean; + var + srsym : tsym; + hasoverload,foundanything : boolean; + begin + result:=false; + srsym:=nil; + hasoverload:=false; + while assigned(helperdef) do + begin + srsym:=tsym(helperdef.symtable.FindWithHash(hashedid)); + if assigned(srsym) and + { Delphi allows hiding a property by a procedure with the same name } + (srsym.typ=procsym) then + begin + hasoverload:=processprocsym(tprocsym(srsym),foundanything); + { when there is no explicit overload we stop searching } + if foundanything and + not hasoverload then + break; + end; + helperdef:=helperdef.childof; + end; + if not hasoverload and assigned(srsym) then + exit(true); + end; + var srsym : tsym; hashedid : THashedIDString; @@ -2268,6 +2315,8 @@ implementation foundanything : boolean; extendeddef : tabstractrecorddef; helperdef : tobjectdef; + helperlist : TFPObjectList; + i : integer; begin if FOperator=NOTOKEN then hashedid.id:=FProcsym.name @@ -2287,27 +2336,24 @@ implementation ) and searchhelpers then begin - if search_last_objectpascal_helper(structdef,nil,helperdef) then + if m_multi_helpers in current_settings.modeswitches then begin - srsym:=nil; - while assigned(helperdef) do + helperlist:=get_objectpascal_helpers(structdef); + if assigned(helperlist) and (helperlist.count>0) then begin - srsym:=tsym(helperdef.symtable.FindWithHash(hashedid)); - if assigned(srsym) and - { Delphi allows hiding a property by a procedure with the same name } - (srsym.typ=procsym) then - begin - hasoverload:=processprocsym(tprocsym(srsym),foundanything); - { when there is no explicit overload we stop searching } - if foundanything and - not hasoverload then - break; - end; - helperdef:=helperdef.childof; + i:=helperlist.count-1; + repeat + helperdef:=tobjectdef(helperlist[i]); + if (helperdef.owner.symtabletype in [staticsymtable,globalsymtable]) or + is_visible_for_object(helperdef.typesym,helperdef) then + if processhelper(hashedid,helperdef) then + exit; + dec(i); + until (i<0); end; - if not hasoverload and assigned(srsym) then - exit; - end; + end + else if search_last_objectpascal_helper(structdef,nil,helperdef) and processhelper(hashedid,helperdef) then + exit; end; { now search in the type itself } srsym:=tsym(structdef.symtable.FindWithHash(hashedid)); @@ -3096,8 +3142,6 @@ implementation inc(hp^.coper_count); te_incompatible : hp^.invalid:=true; - else - internalerror(200212072); end; { stop checking when an incompatible parameter is found } diff --git a/compiler/i386/aoptcpu.pas b/compiler/i386/aoptcpu.pas index 683b087f0f..596dc67a6d 100644 --- a/compiler/i386/aoptcpu.pas +++ b/compiler/i386/aoptcpu.pas @@ -105,17 +105,23 @@ begin if PrePeepholeOptSxx(p) then continue; A_XOR: - if (taicpu(p).oper[0]^.typ = top_reg) and - (taicpu(p).oper[1]^.typ = top_reg) and - (taicpu(p).oper[0]^.reg = taicpu(p).oper[1]^.reg) then - { temporarily change this to 'mov reg,0' to make it easier } - { for the CSE. Will be changed back in pass 2 } - begin - taicpu(p).opcode := A_MOV; - taicpu(p).loadConst(0,0); - end; + begin + if (taicpu(p).oper[0]^.typ = top_reg) and + (taicpu(p).oper[1]^.typ = top_reg) and + (taicpu(p).oper[0]^.reg = taicpu(p).oper[1]^.reg) then + { temporarily change this to 'mov reg,0' to make it easier } + { for the CSE. Will be changed back in pass 2 } + begin + taicpu(p).opcode := A_MOV; + taicpu(p).loadConst(0,0); + end; + end; + else + ; end; end; + else + ; end; p := tai(p.next) end; @@ -398,6 +404,8 @@ begin case taicpu(hp1).condition of C_LE: taicpu(hp3).condition := C_GE; C_BE: taicpu(hp3).condition := C_AE; + else + internalerror(2019050903); end; asml.remove(p); asml.remove(hp1); @@ -576,11 +584,17 @@ begin if OptPass1MOVXX(p) then continue; A_SETcc: - if OptPass1SETcc(p) then - continue; + begin + if OptPass1SETcc(p) then + continue; + end + else + ; end; end; { if is_jmp } end; + else + ; end; updateUsedRegs(UsedRegs,p); p:=tai(p.next); @@ -619,10 +633,16 @@ begin if OptPass2Jmp(p) then continue; A_MOV: - if OptPass2MOV(p) then - continue; + begin + if OptPass2MOV(p) then + continue; + end + else + ; end; end; + else + ; end; p := tai(p.next) end; @@ -687,6 +707,8 @@ begin setsubreg(taicpu(p).oper[1]^.reg,R_SUBL); end; end; + else + ; end else if (taicpu(p).oper[0]^.typ = top_ref) and (taicpu(p).oper[0]^.ref^.base <> taicpu(p).oper[1]^.reg) and @@ -707,10 +729,16 @@ begin end; end; A_TEST, A_OR: - if PostPeepholeOptTestOr(p) then - Continue; + begin + if PostPeepholeOptTestOr(p) then + Continue; + end; + else + ; end; end; + else + ; end; p := tai(p.next) end; diff --git a/compiler/i386/cgcpu.pas b/compiler/i386/cgcpu.pas index 774ae92cd1..aa553e85f5 100644 --- a/compiler/i386/cgcpu.pas +++ b/compiler/i386/cgcpu.pas @@ -514,6 +514,8 @@ unit cgcpu; S_B : list.concat(Taicpu.Op_none(A_MOVSB,S_NO)); S_W : list.concat(Taicpu.Op_none(A_MOVSW,S_NO)); S_L : list.concat(Taicpu.Op_none(A_MOVSD,S_NO)); + else + internalerror(2019050901); end; ungetcpuregister(list,NR_EDI); ungetcpuregister(list,NR_ECX); @@ -873,6 +875,8 @@ unit cgcpu; cg.ungetcpuregister(list,NR_ECX); exit; end; + else + ; end; get_64bit_ops(op,op1,op2); if op in [OP_ADD,OP_SUB] then @@ -940,6 +944,8 @@ unit cgcpu; list.concat(taicpu.op_const_reg(A_RCR,S_L,value,reg.reglo)); cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); end; + else + internalerror(2019050902); end else if value>31 then case op of @@ -1053,6 +1059,8 @@ unit cgcpu; list.concat(taicpu.op_const_ref(A_RCR,S_L,value,tempref)); cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); end; + else + internalerror(2019050901); end else if value>31 then case op of diff --git a/compiler/i386/cpuelf.pas b/compiler/i386/cpuelf.pas index 7c6c36b2f5..70dc3c7a5c 100644 --- a/compiler/i386/cpuelf.pas +++ b/compiler/i386/cpuelf.pas @@ -334,6 +334,8 @@ implementation data.Write(zero,4); continue; end; + else + ; end; if (objreloc.flags and rf_raw)=0 then diff --git a/compiler/i386/cpupara.pas b/compiler/i386/cpupara.pas index 6336981691..31296ec950 100644 --- a/compiler/i386/cpupara.pas +++ b/compiler/i386/cpupara.pas @@ -113,6 +113,8 @@ unit cpupara; exit; end; end; + else + ; end; end; system_i386_os2, @@ -130,6 +132,8 @@ unit cpupara; exit; end; end; + else + ; end; end; system_i386_freebsd, @@ -157,9 +161,13 @@ unit cpupara; result:=false; exit; end; + else + ; end; end; end; + else + ; end; result:=inherited ret_in_param(def,pd); end; @@ -234,6 +242,8 @@ unit cpupara; result:=not(calloption in cdecl_pocalls) and not tprocvardef(def).is_addressonly; setdef : result:=not(calloption in cdecl_pocalls) and (not is_smallset(def)); + else + ; end; end; diff --git a/compiler/i386/n386add.pas b/compiler/i386/n386add.pas index 8f7d746e8d..ae26ff6e20 100644 --- a/compiler/i386/n386add.pas +++ b/compiler/i386/n386add.pas @@ -280,6 +280,8 @@ interface cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.falselabel); unequaln: cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel); + else + internalerror(2019050905); end; end; @@ -305,6 +307,8 @@ interface cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel); cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel); end; + else + internalerror(2019050904); end; end; @@ -332,6 +336,8 @@ interface case getresflags(true) of F_AE: hlab:=location.truelabel ; F_B: hlab:=location.falselabel; + else + ; end; end; diff --git a/compiler/i8086/aoptcpu.pas b/compiler/i8086/aoptcpu.pas index 5c3d8d8d27..c4436ea1fe 100644 --- a/compiler/i8086/aoptcpu.pas +++ b/compiler/i8086/aoptcpu.pas @@ -138,8 +138,12 @@ unit aoptcpu; end; A_SUB: result:=OptPass1Sub(p); + else + ; end; end + else + ; end; end; @@ -159,8 +163,12 @@ unit aoptcpu; A_OR, A_TEST: Result:=PostPeepholeOptTestOr(p); + else + ; end; end; + else + ; end; end; diff --git a/compiler/i8086/cgcpu.pas b/compiler/i8086/cgcpu.pas index a7724760eb..2ca7a15f0f 100644 --- a/compiler/i8086/cgcpu.pas +++ b/compiler/i8086/cgcpu.pas @@ -2286,6 +2286,8 @@ unit cgcpu; list.concat(ai); invf:=FPUFlags2Flags[invf]; end; + else + ; end; a_jmp_flags(list,invf,hl_skip); @@ -2570,6 +2572,8 @@ unit cgcpu; case opsize of S_B : list.concat(Taicpu.Op_none(A_MOVSB,S_NO)); S_W : list.concat(Taicpu.Op_none(A_MOVSW,S_NO)); + else + internalerror(2019051019); end; end; ungetcpuregister(list,NR_DI); @@ -2936,6 +2940,8 @@ unit cgcpu; list.concat(taicpu.op_const_reg(A_RCR,S_W,1,regdst.reglo)); cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); end; + else + internalerror(2019051018); end; ai:=Taicpu.Op_Sym(A_LOOP,S_W,l2); ai.is_jmp := True; @@ -2945,6 +2951,8 @@ unit cgcpu; cg.ungetcpuregister(list,NR_CX); exit; end; + else + ; end; get_64bit_ops(op,op1,op2); if op in [OP_ADD,OP_SUB] then @@ -3030,6 +3038,8 @@ unit cgcpu; list.concat(taicpu.op_const_reg(A_RCR,S_W,1,reg.reglo)); cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); end; + else + internalerror(2019051017); end; 2..15: begin @@ -3056,6 +3066,8 @@ unit cgcpu; list.concat(taicpu.op_const_reg(A_RCR,S_W,1,reg.reglo)); cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); end; + else + internalerror(2019051010); end; ai:=Taicpu.Op_Sym(A_LOOP,S_W,loop_start); ai.is_jmp := True; @@ -3086,6 +3098,8 @@ unit cgcpu; cg.a_load_reg_reg(list,OS_16,OS_16,cg.GetNextReg(reg.reghi),reg.reghi); cg.a_op_const_reg(list,OP_SAR,OS_16,15,cg.GetNextReg(reg.reghi)); end; + else + internalerror(2019051011); end; if value=17 then case op of @@ -3105,6 +3119,8 @@ unit cgcpu; list.concat(taicpu.op_const_reg(A_RCR,S_W,1,reg.reglo)); cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); end; + else + internalerror(2019051012); end; end; 18..31: @@ -3131,6 +3147,8 @@ unit cgcpu; cg.a_load_reg_reg(list,OS_16,OS_16,cg.GetNextReg(reg.reghi),reg.reghi); cg.a_op_const_reg(list,OP_SAR,OS_16,15,cg.GetNextReg(reg.reghi)); end; + else + internalerror(2019051013); end; cg.getcpuregister(list,NR_CX); cg.a_load_const_reg(list,OS_16,value-16,NR_CX); @@ -3153,6 +3171,8 @@ unit cgcpu; list.concat(taicpu.op_const_reg(A_RCR,S_W,1,reg.reglo)); cg.a_reg_dealloc(list,NR_DEFAULTFLAGS); end; + else + internalerror(2019051014); end; ai:=Taicpu.Op_Sym(A_LOOP,S_W,loop_start); ai.is_jmp := True; @@ -3179,6 +3199,8 @@ unit cgcpu; cg.a_op_const_reg_reg(list,OP_SAR,OS_16,15-(value-32),cg.GetNextReg(reg.reglo),reg.reghi); cg.a_load_reg_reg(list,OS_16,OS_16,reg.reghi,cg.GetNextReg(reg.reghi)); end; + else + internalerror(2019051015); end; 48..63: case op of @@ -3213,6 +3235,8 @@ unit cgcpu; cg.a_load_reg_reg(list,OS_16,OS_16,cg.GetNextReg(reg.reglo),reg.reghi); cg.a_load_reg_reg(list,OS_16,OS_16,cg.GetNextReg(reg.reglo),cg.GetNextReg(reg.reghi)); end; + else + internalerror(2019051016); end; end; end; diff --git a/compiler/i8086/cpupara.pas b/compiler/i8086/cpupara.pas index 0f3c76b835..d91956351e 100644 --- a/compiler/i8086/cpupara.pas +++ b/compiler/i8086/cpupara.pas @@ -192,6 +192,8 @@ unit cpupara; result:=not(calloption in cdecl_pocalls) and not tprocvardef(def).is_addressonly; setdef : result:=not(calloption in cdecl_pocalls) and (not is_smallset(def)); + else + ; end; end; diff --git a/compiler/i8086/n8086add.pas b/compiler/i8086/n8086add.pas index 47cf4833d5..261ca5c587 100644 --- a/compiler/i8086/n8086add.pas +++ b/compiler/i8086/n8086add.pas @@ -581,6 +581,8 @@ interface cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.falselabel); unequaln: cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel); + else + internalerror(2019051024); end; end; @@ -625,6 +627,8 @@ interface cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.falselabel); unequaln: cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel); + else + internalerror(2019051023); end; end; @@ -650,6 +654,8 @@ interface cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel); cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel); end; + else + internalerror(2019051022); end; end; @@ -802,6 +808,8 @@ interface cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.falselabel); unequaln: cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel); + else + internalerror(2019051021); end; end; @@ -827,6 +835,8 @@ interface cg.a_jmp_flags(current_asmdata.CurrAsmList,F_NE,location.truelabel); cg.a_jmp_always(current_asmdata.CurrAsmList,location.falselabel); end; + else + internalerror(2019051020); end; end; diff --git a/compiler/i8086/symcpu.pas b/compiler/i8086/symcpu.pas index 6f7c9b8cbb..ea132fe18c 100644 --- a/compiler/i8086/symcpu.pas +++ b/compiler/i8086/symcpu.pas @@ -541,8 +541,6 @@ implementation x86pt_near_fs, x86pt_near_gs: result:=s16inttype; - else - internalerror(2016100403); end; end; @@ -561,8 +559,6 @@ implementation x86pt_near_fs, x86pt_near_gs: result:=u16inttype; - else - internalerror(2016100403); end; end; @@ -582,8 +578,6 @@ implementation x86pt_near_fs, x86pt_near_gs: result:=s16inttype; - else - internalerror(2016100402); end; end; @@ -602,8 +596,6 @@ implementation x86pt_near_fs, x86pt_near_gs: result:=s16inttype; - else - internalerror(2016100401); end; end; diff --git a/compiler/jvm/agjasmin.pas b/compiler/jvm/agjasmin.pas index a3755cb328..12b51ad688 100644 --- a/compiler/jvm/agjasmin.pas +++ b/compiler/jvm/agjasmin.pas @@ -624,6 +624,8 @@ implementation internalerror(2011010906); end; end; + else + ; end; { superclass } if assigned(superclass) then @@ -1014,6 +1016,8 @@ implementation if not(df_generic in tprocdef(tprocsym(sym).procdeflist[j]).defoptions) then WriteSymtableVarSyms(tprocdef(tprocsym(sym).procdeflist[j]).localst); end; + else + ; end; end; end; @@ -1044,6 +1048,8 @@ implementation WriteSymtableProcdefs(tprocdef(def).localst); end; end; + else + ; end; end; end; @@ -1069,6 +1075,8 @@ implementation nestedstructs.add(def); recorddef: nestedstructs.add(def); + else + ; end; end; for i:=0 to nestedstructs.count-1 do diff --git a/compiler/jvm/aoptcpu.pas b/compiler/jvm/aoptcpu.pas index c447ca33d3..877f2b196c 100644 --- a/compiler/jvm/aoptcpu.pas +++ b/compiler/jvm/aoptcpu.pas @@ -135,6 +135,8 @@ Implementation RemoveCommutativeSwap(p) then exit(true) end; + else + ; end; end; diff --git a/compiler/jvm/cpupara.pas b/compiler/jvm/cpupara.pas index e12a1a143b..1cfc1c9266 100644 --- a/compiler/jvm/cpupara.pas +++ b/compiler/jvm/cpupara.pas @@ -291,6 +291,8 @@ implementation paraloc^.loc:=LOC_REFERENCE; paraloc^.reference.index:=NR_STACK_POINTER_REG; end; + else + ; end; { 2 slots for 64 bit integers and floats, 1 slot for the rest } if not(is_64bit(paradef) or diff --git a/compiler/jvm/dbgjasm.pas b/compiler/jvm/dbgjasm.pas index 40c971ad74..7186661093 100644 --- a/compiler/jvm/dbgjasm.pas +++ b/compiler/jvm/dbgjasm.pas @@ -193,8 +193,12 @@ implementation inc(nolineinfolevel); mark_NoLineInfoEnd: dec(nolineinfolevel); + else + ; end; end; + else + ; end; { Java does not support multiple source files } diff --git a/compiler/jvm/hlcgcpu.pas b/compiler/jvm/hlcgcpu.pas index 9cb3add73f..afdda5b1f1 100644 --- a/compiler/jvm/hlcgcpu.pas +++ b/compiler/jvm/hlcgcpu.pas @@ -346,6 +346,8 @@ implementation a:=shortint(a); u16bit: a:=smallint(a); + else + ; end; end; a_load_const_stack(list,size,a,typ); @@ -641,6 +643,8 @@ implementation (fromloc.reference.indexbase<>NR_STACK_POINTER_REG) then g_allocload_reg_reg(list,voidpointertype,fromloc.reference.indexbase,toloc.reference.indexbase,R_ADDRESSREGISTER); end; + else + ; end; end; else @@ -724,6 +728,8 @@ implementation end; procvardef: g_call_system_proc(list,'fpc_initialize_array_procvar',[],nil); + else + internalerror(2019051025); end; tg.ungettemp(list,recref); end; @@ -854,6 +860,8 @@ implementation a_op_const_stack(list,OP_XOR,size,cardinal($80000000)); OS_64,OS_S64: a_op_const_stack(list,OP_XOR,size,tcgint($8000000000000000)); + else + ; end; end; @@ -869,7 +877,11 @@ implementation OS_32,OS_S32: result:=a xor cardinal($80000000); OS_64,OS_S64: +{$push}{$r-} result:=a xor tcgint($8000000000000000); +{$pop} + else + ; end; end; @@ -1518,6 +1530,8 @@ implementation handled:=true; end; end; + else + ; end; if not handled then inherited; @@ -2235,6 +2249,8 @@ implementation a_op_const_stack(list,OP_AND,s32inttype,65535); OS_S16: list.concat(taicpu.op_none(a_i2s)); + else + ; end; end; diff --git a/compiler/jvm/jvmdef.pas b/compiler/jvm/jvmdef.pas index c5c18eefc4..5f712c7752 100644 --- a/compiler/jvm/jvmdef.pas +++ b/compiler/jvm/jvmdef.pas @@ -302,8 +302,6 @@ implementation ft_typed, ft_untyped: result:=jvmaddencodedtype(search_system_type('FILEREC').typedef,false,encodedstr,forcesignature,founderror); - else - internalerror(2015091406); end; end; recorddef : @@ -768,8 +766,12 @@ implementation if torddef(def).high>127 then result:=s8inttype; u16bit: - if torddef(def).high>32767 then - result:=s16inttype; + begin + if torddef(def).high>32767 then + result:=s16inttype; + end + else + ; end; end; @@ -900,6 +902,8 @@ implementation usedef:=s16inttype; u16bit: usedef:=s32inttype; + else + ; end; end; result:=jvmencodetype(usedef,false); diff --git a/compiler/jvm/njvmcnv.pas b/compiler/jvm/njvmcnv.pas index 9044ceb538..c4522dc197 100644 --- a/compiler/jvm/njvmcnv.pas +++ b/compiler/jvm/njvmcnv.pas @@ -1147,8 +1147,6 @@ implementation ft_typed, ft_untyped: result:=def2=search_system_type('FILEREC').typedef; - else - internalerror(2015091401); end else result:=false; diff --git a/compiler/jvm/njvmcon.pas b/compiler/jvm/njvmcon.pas index b52c4211c1..8b98c7670b 100644 --- a/compiler/jvm/njvmcon.pas +++ b/compiler/jvm/njvmcon.pas @@ -400,8 +400,6 @@ implementation inserttypeconv_explicit(result,cpointerdef.getreusable(resultdef)); result:=cderefnode.create(result); end; - else - internalerror(2011060301); end; end; diff --git a/compiler/jvm/njvminl.pas b/compiler/jvm/njvminl.pas index 866fbd01af..34af3952a8 100644 --- a/compiler/jvm/njvminl.pas +++ b/compiler/jvm/njvminl.pas @@ -311,6 +311,8 @@ implementation if left.resultdef.typ in [objectdef,classrefdef] then Message(parser_e_illegal_expression); end; + else + ; end; if not handled then result:=inherited pass_typecheck; diff --git a/compiler/jvm/rgcpu.pas b/compiler/jvm/rgcpu.pas index cc8dc32d28..41606cf263 100644 --- a/compiler/jvm/rgcpu.pas +++ b/compiler/jvm/rgcpu.pas @@ -164,6 +164,8 @@ implementation if (getsupreg(taicpu(p).oper[0]^.ref^.indexbase)=sr) then exit(true); end; + else + ; end; end; @@ -313,6 +315,8 @@ implementation continue; end; end; + else + ; end; p:=tai(p.next); end; @@ -385,6 +389,8 @@ implementation { don't invalidate the temp reference, may still be used one instruction later } end; + else + ; end; { insert the tempallocation/free at the right place } list.insertlistbefore(p,templist); @@ -398,6 +404,8 @@ implementation end; ait_instruction: do_spill_replace_all(list,taicpu(p),spill_temps); + else + ; end; p:=Tai(p.next); end; diff --git a/compiler/jvm/tgcpu.pas b/compiler/jvm/tgcpu.pas index 7c888b0616..fa2b6103a6 100644 --- a/compiler/jvm/tgcpu.pas +++ b/compiler/jvm/tgcpu.pas @@ -219,10 +219,10 @@ unit tgcpu; ft_typed, ft_untyped: result:=getifspecialtemp(list,search_system_type('FILEREC').typedef,forcesize,temptype,ref); - else - internalerror(2015091405); end; end; + else + ; end; end; diff --git a/compiler/llvm/aasmllvm.pas b/compiler/llvm/aasmllvm.pas index fce3d65eb9..dfb7c2d2ca 100644 --- a/compiler/llvm/aasmllvm.pas +++ b/compiler/llvm/aasmllvm.pas @@ -289,6 +289,8 @@ uses _bind:=AB_GLOBAL; AB_EXTERNAL_INDIRECT: _bind:=AB_INDIRECT; + else + ; end; bind:=_bind; end; @@ -353,6 +355,8 @@ uses oper[opidx]^.ai.free; top_asmlist: oper[opidx]^.asmlist.free; + else + ; end; inherited; end; diff --git a/compiler/llvm/agllvm.pas b/compiler/llvm/agllvm.pas index 9381aa5751..6ec1a21f13 100644 --- a/compiler/llvm/agllvm.pas +++ b/compiler/llvm/agllvm.pas @@ -791,6 +791,8 @@ implementation if vol_write in hp.oper[3]^.ref^.volatility then result:=result+' volatile'; end; + else + ; end; end; @@ -1355,6 +1357,8 @@ implementation writer.AsmWrite(objc_section_name(taillvmdecl(hp).sec)); writer.AsmWrite('"'); end; + else + ; end; { sections whose name starts with 'llvm.' are for LLVM internal use and don't have an alignment } @@ -1458,6 +1462,8 @@ implementation asmblock:=true; mark_AsmBlockEnd: asmblock:=false; + else + ; end; ait_directive : diff --git a/compiler/llvm/hlcgllvm.pas b/compiler/llvm/hlcgllvm.pas index fae787325a..fa433cd7f6 100644 --- a/compiler/llvm/hlcgllvm.pas +++ b/compiler/llvm/hlcgllvm.pas @@ -739,6 +739,8 @@ implementation reg1:=tmpreg; fromsize:=tmpintdef; end; + else + ; end; { reg2 = bitcast fromsize reg1 to tosize } list.concat(taillvm.op_reg_size_reg_size(op,reg2,fromsize,reg1,tosize)); @@ -823,6 +825,8 @@ implementation a_loadmm_ref_ref(list,fromsize,fromsize,simpleref,tmpref2,firstshuffle); a_loadmm_ref_reg(list,tosize,tosize,tmpref,register,shuffle); end; + else + internalerror(2019051040); end; tg.ungettemp(list,tmpref); result:=true; @@ -1997,6 +2001,8 @@ implementation a_loadfpu_reg_ref(list,llvmretdef,llvmretdef,resval,rettemp); R_MMREGISTER: a_loadmm_reg_ref(list,llvmretdef,llvmretdef,resval,rettemp,mms_movescalar); + else + ; end; { the return parameter now contains a value whose type matches the one that the high level code generator expects instead of the llvm shim @@ -2082,6 +2088,8 @@ implementation list.concat(Tai_comment.Create(strpnew('Var '+vs.realname+' located at %tmp.'+ tostr(getsupreg(vs.initialloc.reference.base))))); end; + else + ; end; end; vs.localloc:=vs.initialloc; diff --git a/compiler/llvm/llvmdef.pas b/compiler/llvm/llvmdef.pas index c9b3253a78..9d04a24add 100644 --- a/compiler/llvm/llvmdef.pas +++ b/compiler/llvm/llvmdef.pas @@ -393,8 +393,6 @@ implementation {$else} encodedstr:=encodedstr+'fp128'; {$endif} - else - internalerror(2013100202); end; end; filedef : @@ -420,8 +418,6 @@ implementation end; ft_untyped : llvmaddencodedtype_intern(search_system_type('FILEREC').typedef,[lef_inaggregate]+[lef_typedecl]*flags,encodedstr); - else - internalerror(2013100203); end; end; recorddef : diff --git a/compiler/llvm/llvmtype.pas b/compiler/llvm/llvmtype.pas index 88d9136369..70887756ad 100644 --- a/compiler/llvm/llvmtype.pas +++ b/compiler/llvm/llvmtype.pas @@ -222,6 +222,8 @@ implementation case tsym(p).typ of fieldvarsym: appendsym_fieldvar(TAsmList(arg),tfieldvarsym(p)); + else + ; end; end; @@ -259,6 +261,8 @@ implementation if callpara^.typ=top_tai then collect_tai_info(deftypelist,callpara^.ai); end; + else + ; end; end; @@ -292,6 +296,8 @@ implementation collect_tai_info(deftypelist,value); end; end; + else + ; end; end; @@ -383,6 +389,8 @@ implementation end; top_tai: insert_tai_typeconversions(toplevellist,p.oper[i]^.ai); + else + ; end; end; end; @@ -453,6 +461,8 @@ implementation tprocdef(taillvmdecl(p).def).personality); insert_asmlist_typeconversions(toplevellist,taillvmdecl(p).initdata); end; + else + ; end; end; @@ -538,6 +548,8 @@ implementation end; ait_llvmdecl: update_asmlist_alias_types(taillvmdecl(hp).initdata); + else + ; end; hp:=tai(hp.next); end; diff --git a/compiler/llvm/nllvmbas.pas b/compiler/llvm/nllvmbas.pas index 962d8a2d11..533bf50c4c 100644 --- a/compiler/llvm/nllvmbas.pas +++ b/compiler/llvm/nllvmbas.pas @@ -176,6 +176,8 @@ interface internalerror(2016101506); end; end; + else + ; end; end; diff --git a/compiler/llvm/nllvmld.pas b/compiler/llvm/nllvmld.pas index d5d0aa22ed..3efcca31b7 100644 --- a/compiler/llvm/nllvmld.pas +++ b/compiler/llvm/nllvmld.pas @@ -66,6 +66,8 @@ function tllvmloadnode.pass_1: tnode; if assigned(left) then expectloc:=LOC_REFERENCE; end; + else + ; end; end; @@ -133,6 +135,8 @@ procedure tllvmloadnode.pass_generate_code; ); reference_reset_base(location.reference,selfreg,0,ctempposinvalid,location.reference.alignment,location.reference.volatility); end; + else + ; end; end; diff --git a/compiler/llvm/nllvmtcon.pas b/compiler/llvm/nllvmtcon.pas index 9ccef61e0a..8dcef8398b 100644 --- a/compiler/llvm/nllvmtcon.pas +++ b/compiler/llvm/nllvmtcon.pas @@ -660,8 +660,6 @@ implementation st_widestring, st_unicodestring: eledef:=cwidechartype; - else - internalerror(2014062202); end; else internalerror(2014062203); @@ -766,6 +764,8 @@ implementation todef:=tmpintdef; op:=firstop end; + else + ; end; ai:=taillvm.op_reg_tai_size(op,NR_NO,nil,todef); typedai:=wrap_with_type(ai,todef); diff --git a/compiler/llvm/rgllvm.pas b/compiler/llvm/rgllvm.pas index da28954a99..222f561cf9 100644 --- a/compiler/llvm/rgllvm.pas +++ b/compiler/llvm/rgllvm.pas @@ -201,6 +201,8 @@ implementation writtenregs^[sr]:=succ(writtenregs^[sr]); end; end; + else + ; end; hp:=tai(hp.next); end; @@ -249,6 +251,8 @@ implementation end; end; end; + else + ; end; end; if not assigned(def) then diff --git a/compiler/mips/aasmcpu.pas b/compiler/mips/aasmcpu.pas index cc7c13efc3..e4d0cf5f54 100644 --- a/compiler/mips/aasmcpu.pas +++ b/compiler/mips/aasmcpu.pas @@ -1,4 +1,4 @@ -{ + { Copyright (c) 1999-2009 by Mazen Neifer and David Zhang Contains the assembler object for the MIPSEL @@ -558,6 +558,8 @@ procedure fixup_jmps(list: TAsmList); internalerror(2008052101); inc(instrpos); end; + else + ; end; p := tai(p.next); end; @@ -657,10 +659,14 @@ procedure fixup_jmps(list: TAsmList); end; end; end; + else + ; end; end; ait_const: inc(instrpos); + else + ; end; p := tai(p.next); end; diff --git a/compiler/mips/aoptcpu.pas b/compiler/mips/aoptcpu.pas index f1d9349ff8..153b5eae92 100644 --- a/compiler/mips/aoptcpu.pas +++ b/compiler/mips/aoptcpu.pas @@ -167,6 +167,8 @@ unit aoptcpu; result:= (p.oper[I]^.ref^.base=reg) or (p.oper[I]^.ref^.index=reg); + else + ; end; if result then exit; {Bailout if we found something} Inc(I); @@ -190,6 +192,8 @@ unit aoptcpu; A_BA,A_BC, A_SB,A_SH,A_SW,A_SWL,A_SWR,A_SWC1,A_SDC1: exit; + else + ; end; result:=(p.ops>0) and (p.oper[0]^.typ=top_reg) and @@ -716,8 +720,12 @@ unit aoptcpu; A_ABS_d, A_NEG_d, A_SQRT_d, A_CVT_d_w, A_CVT_d_l, A_CVT_d_s: result:=TryRemoveMov(p,A_MOV_d); + else + ; end; end; + else + ; end; end; @@ -867,8 +875,12 @@ unit aoptcpu; end; end; end; + else + ; end; end; + else + ; end; UpdateUsedRegs(p); p:=tai(p.next); diff --git a/compiler/mips/cgcpu.pas b/compiler/mips/cgcpu.pas index a518fa7d03..97754a33af 100644 --- a/compiler/mips/cgcpu.pas +++ b/compiler/mips/cgcpu.pas @@ -1098,6 +1098,8 @@ procedure TCGMIPS.a_jmp_flags(list: tasmlist; const f: TResFlags; l: tasmlabel); end; exit; end; + else + ; end; if f.use_const then a_cmp_const_reg_label(list,OS_INT,f.cond,f.value,f.reg1,l) @@ -1136,6 +1138,8 @@ procedure TCGMIPS.g_flags2reg(list: tasmlist; size: tcgsize; const f: tresflags; end; exit; end; + else + ; end; if (f.cond in [OC_EQ,OC_NE]) then begin diff --git a/compiler/mips/cpubase.pas b/compiler/mips/cpubase.pas index 578af51d0f..3895e1a878 100644 --- a/compiler/mips/cpubase.pas +++ b/compiler/mips/cpubase.pas @@ -357,6 +357,8 @@ unit cpubase; setsubreg(r, R_SUBFS); R_SUBL, R_SUBW, R_SUBD, R_SUBQ: setsubreg(r, R_SUBD); + else + ; end; result:=rgBase.findreg_by_number_table(r,regnumber_index); end; @@ -385,6 +387,8 @@ unit cpubase; setsubreg(hr, R_SUBFS); R_SUBL, R_SUBW, R_SUBD, R_SUBQ: setsubreg(hr, R_SUBD); + else + ; end; p:=findreg_by_number_table(hr,regnumber_index); if p<>0 then @@ -402,6 +406,8 @@ unit cpubase; setsubreg(r, R_SUBFS); R_SUBL, R_SUBW, R_SUBD, R_SUBQ: setsubreg(r, R_SUBD); + else + ; end; result:=regdwarf_table[findreg_by_number(r)]; if result=-1 then @@ -415,6 +421,8 @@ unit cpubase; setsubreg(r, R_SUBFS); R_SUBL, R_SUBW, R_SUBD, R_SUBQ: setsubreg(r, R_SUBD); + else + ; end; result:=regdwarf_table[findreg_by_number(r)]; end; diff --git a/compiler/mips/cpuelf.pas b/compiler/mips/cpuelf.pas index 0890ace7a2..4f529df893 100644 --- a/compiler/mips/cpuelf.pas +++ b/compiler/mips/cpuelf.pas @@ -864,6 +864,8 @@ implementation data.Write(zero,4); continue; end; + else + ; end; if (objreloc.flags and rf_raw)=0 then diff --git a/compiler/mips/cpupara.pas b/compiler/mips/cpupara.pas index 7375136a07..0a2edb415b 100644 --- a/compiler/mips/cpupara.pas +++ b/compiler/mips/cpupara.pas @@ -167,6 +167,8 @@ implementation result:=false; {not tprocvardef(def).is_addressonly;} setdef : result:=not(is_smallset(def)); + else + ; end; end; diff --git a/compiler/mips/hlcgcpu.pas b/compiler/mips/hlcgcpu.pas index 85d0298866..7070bc32bb 100644 --- a/compiler/mips/hlcgcpu.pas +++ b/compiler/mips/hlcgcpu.pas @@ -135,6 +135,8 @@ implementation fromreg:=cg.getintregister(list,OS_INT); cg.a_load_const_reg(list,OS_INT,-1,fromreg); end; + else + ; end; list.concat(taicpu.op_reg_reg_const_const(A_INS,sreg.subsetreg,fromreg, sreg.startbit,sreg.bitlen)); diff --git a/compiler/mips/itcpugas.pas b/compiler/mips/itcpugas.pas index ad9f766d2f..a2f0cb5d06 100644 --- a/compiler/mips/itcpugas.pas +++ b/compiler/mips/itcpugas.pas @@ -84,6 +84,8 @@ begin setsubreg(hr, R_SUBFS); R_SUBL, R_SUBW, R_SUBD, R_SUBQ: setsubreg(hr, R_SUBD); + else + ; end; p := findreg_by_number(hr); if p <> 0 then diff --git a/compiler/mips/ncpuadd.pas b/compiler/mips/ncpuadd.pas index 99589f567f..eba7370cc6 100644 --- a/compiler/mips/ncpuadd.pas +++ b/compiler/mips/ncpuadd.pas @@ -186,6 +186,8 @@ begin cmp64_lt(left_reg, right_reg,unsigned); gten: cmp64_le(left_reg, right_reg,unsigned); + else + internalerror(2019051034); end else case NodeType of @@ -197,6 +199,8 @@ begin cmp64_lt(right_reg, left_reg,unsigned); gten: cmp64_le(right_reg, left_reg,unsigned); + else + internalerror(2019051033); end; end; end; diff --git a/compiler/mips/ncpuld.pas b/compiler/mips/ncpuld.pas index c26223a3ac..5af96b2581 100644 --- a/compiler/mips/ncpuld.pas +++ b/compiler/mips/ncpuld.pas @@ -55,6 +55,8 @@ begin paravarsym : if([vo_is_dll_var,vo_is_external] * tabstractvarsym(symtableentry).varoptions <> []) then include(current_procinfo.flags,pi_needs_got); + else + ; end; end; diff --git a/compiler/msg/errore.msg b/compiler/msg/errore.msg index 2419da3551..4f75ffe097 100644 --- a/compiler/msg/errore.msg +++ b/compiler/msg/errore.msg @@ -2365,7 +2365,7 @@ sym_e_type_must_be_rec_or_object=05098_E_Record or object type expected # # Codegenerator # -# 06049 is the last used one +# 06060 is the last used one # % \section{Code generator messages} % This section lists all messages that can be displayed if the code @@ -2520,6 +2520,9 @@ cg_n_no_inline=06058_N_Call to subroutine "$1" marked as inline is not inlined % The directive inline is only a hint to the compiler. Sometimes the compiler ignores this hint, a subroutine % marked as inline is not inlined. In this case, this hint is given. Compiling with \var{-vd} might result in more information why % the directive inline is ignored. +cg_e_case_incomplete=06059_E_Case statement does not handle all possible cases +cg_w_case_incomplete=06060_W_Case statement does not handle all possible cases +% The case statement does not contain labels for all possible values of the operand, and no else statement is present. % % \end{description} # EndOfTeX diff --git a/compiler/msgidx.inc b/compiler/msgidx.inc index 52f8ceec3e..d1a3cf11a2 100644 --- a/compiler/msgidx.inc +++ b/compiler/msgidx.inc @@ -698,6 +698,8 @@ const cg_e_function_not_support_by_selected_instruction_set=06056; cg_f_max_units_reached=06057; cg_n_no_inline=06058; + cg_e_case_incomplete=06059; + cg_w_case_incomplete=06060; asmr_d_start_reading=07000; asmr_d_finish_reading=07001; asmr_e_none_label_contain_at=07002; @@ -1108,9 +1110,9 @@ const option_info=11024; option_help_pages=11025; - MsgTxtSize = 83258; + MsgTxtSize = 83374; MsgIdxMax : array[1..20] of longint=( - 28,106,351,126,99,59,142,34,221,67, + 28,106,351,126,99,61,142,34,221,67, 62,20,30,1,1,1,1,1,1,1 ); diff --git a/compiler/msgtxt.inc b/compiler/msgtxt.inc index 9f745502af..8c1620c3e2 100644 --- a/compiler/msgtxt.inc +++ b/compiler/msgtxt.inc @@ -1,8 +1,8 @@ const msgtxt_codepage=20127; {$ifdef Delphi} -const msgtxt : array[0..000346] of string[240]=( +const msgtxt : array[0..000347] of string[240]=( {$else Delphi} -const msgtxt : array[0..000346,1..240] of char=( +const msgtxt : array[0..000347,1..240] of char=( {$endif Delphi} '01000_T_Compiler: $1'#000+ '01001_D_Compiler OS: $1'#000+ @@ -874,507 +874,513 @@ const msgtxt : array[0..000346,1..240] of char=( 'on set: $1'#000+ '06057_F_Maximum number of units ($1) reached for the current target'#000+ '06058_N_Call to subroutine "$1" marked as inline is not inlined'#000+ + '06059_E_Case statement does not handle all possible cases'#000+ + '06060_W_Case statement does not handle ','all possible cases'#000+ '07000_DL_Starting $1 styled assembler parsing'#000+ '07001_DL_Finished $1 styled assembler parsing'#000+ - '07002','_E_Non-label pattern contains @'#000+ + '07002_E_Non-label pattern contains @'#000+ '07004_E_Error building record offset'#000+ '07005_E_OFFSET used without identifier'#000+ - '07006_E_TYPE used without identifier'#000+ + '07006_E_TYPE use','d without identifier'#000+ '07007_E_Cannot use local variable or parameters here'#000+ '07008_E_Need to use OFFSET here'#000+ - '07009_E_Ne','ed to use $ here'#000+ + '07009_E_Need to use $ here'#000+ '07010_E_Cannot use multiple relocatable symbols'#000+ '07011_E_Relocatable symbol can only be added'#000+ - '07012_E_Invalid constant expression'#000+ + '07012_E_Invali','d constant expression'#000+ '07013_E_Relocatable symbol is not allowed'#000+ '07014_E_Invalid reference syntax'#000+ - '07015_E_You cannot ','reach $1 from that code'#000+ + '07015_E_You cannot reach $1 from that code'#000+ '07016_E_Local symbols/labels are not allowed as references'#000+ - '07017_E_Invalid base and index register usage'#000+ + '07017_E_Invalid base and index register u','sage'#000+ '07018_W_Possible error in object field handling'#000+ '07019_E_Wrong scale factor specified'#000+ - '07020_E_Multiple index reg','ister usage'#000+ + '07020_E_Multiple index register usage'#000+ '07021_E_Invalid operand type'#000+ '07022_E_Invalid string as opcode operand: $1'#000+ - '07023_W_@CODE and @DATA not supported'#000+ + '07023_W_@CODE and @DATA not supported'#000, '07024_E_Null label references are not allowed'#000+ '07025_E_Divide by zero in asm evaluator'#000+ '07026_E_Illegal expression'#000+ - '070','27_E_Escape sequence ignored: $1'#000+ + '07027_E_Escape sequence ignored: $1'#000+ '07028_E_Invalid symbol reference'#000+ '07029_W_Fwait can cause emulation problems with emu387'#000+ - '07030_W_$1 without operand translated into $1P'#000+ + '070','30_W_$1 without operand translated into $1P'#000+ '07031_W_ENTER instruction is not supported by Linux kernel'#000+ - '07032_W_Calli','ng an overload function in assembler'#000+ + '07032_W_Calling an overload function in assembler'#000+ '07033_E_Unsupported symbol type for operand'#000+ '07034_E_Constant value out of bounds'#000+ - '07035_E_Error converting decimal $1'#000+ + '07035_','E_Error converting decimal $1'#000+ '07036_E_Error converting octal $1'#000+ '07037_E_Error converting binary $1'#000+ - '07038_E_Error con','verting hexadecimal $1'#000+ + '07038_E_Error converting hexadecimal $1'#000+ '07039_H_$1 translated to $2'#000+ '07040_W_$1 is associated to an overloaded function'#000+ - '07041_E_Cannot use SELF outside a method'#000+ + '07041_E_Cannot use SEL','F outside a method'#000+ '07042_E_Cannot use OLDEBP outside a nested procedure'#000+ - '07043_W_Procedures cannot return any value i','n asm code'#000+ + '07043_W_Procedures cannot return any value in asm code'#000+ '07044_E_SEG not supported'#000+ '07045_E_Size suffix and destination or source size do not match'#000+ - '07046_W_Size suffix and destination or source size do not match'#000+ + '07046_W_Size suffix and',' destination or source size do not match'#000+ '07047_E_Assembler syntax error'#000+ - '07048_E_Invalid combination of opcode and op','erands'#000+ + '07048_E_Invalid combination of opcode and operands'#000+ '07049_E_Assembler syntax error in operand'#000+ '07050_E_Assembler syntax error in constant'#000+ - '07051_E_Invalid String expression'#000+ + '07051_E_Invalid String expressio','n'#000+ '07052_W_Constant with symbol $1 for address which is not on a pointer'#000+ '07053_E_Unrecognized opcode $1'#000+ - '07054_E_Inval','id or missing opcode'#000+ + '07054_E_Invalid or missing opcode'#000+ '07055_E_Invalid combination of prefix and opcode: $1'#000+ - '07056_E_Invalid combination of override and opcode: $1'#000+ + '07056_E_Invalid combination of override and opcode',': $1'#000+ '07057_E_Too many operands on line'#000+ '07058_W_NEAR ignored'#000+ '07059_W_FAR ignored'#000+ '07060_E_Duplicate local symbol $1'#000+ - '07','061_E_Undefined local symbol $1'#000+ + '07061_E_Undefined local symbol $1'#000+ '07062_E_Unknown label identifier $1'#000+ '07063_E_Invalid register name'#000+ - '07064_E_Invalid floating point register name'#000+ + '07064_E_Invalid floating p','oint register name'#000+ '07066_W_Modulo not supported'#000+ '07067_E_Invalid floating point constant $1'#000+ - '07068_E_Invalid floating ','point expression'#000+ + '07068_E_Invalid floating point expression'#000+ '07069_E_Wrong symbol type'#000+ '07070_E_Cannot index a local var or parameter with a register'#000+ - '07071_E_Invalid segment override expression'#000+ + '07071_E_Invalid seg','ment override expression'#000+ '07072_W_Identifier $1 supposed external'#000+ '07073_E_Strings not allowed as constants'#000+ - '07074_E_No',' type of variable specified'#000+ + '07074_E_No type of variable specified'#000+ '07075_E_Assembler code not returned to text section'#000+ '07076_E_Not a directive or local symbol $1'#000+ - '07077_E_Using a defined name as a local label'#000+ + '0','7077_E_Using a defined name as a local label'#000+ '07078_E_Dollar token is used without an identifier'#000+ - '07079_W_32bit consta','nt created for address'#000+ + '07079_W_32bit constant created for address'#000+ '07080_N_.align is target specific, use .balign or .p2align'#000+ - '07081_E_Cannot directly access fields of pointer-based parameters'#000+ + '07081_E_Cannot directly access fields of p','ointer-based parameters'#000+ '07082_E_Can'#039't access fields of objects/classes directly'#000+ - '07083_E_No size specified and unable',' to determine the size of the op'+ - 'erands'#000+ + '07083_E_No size specified and unable to determine the size of the oper'+ + 'ands'#000+ '07084_E_Cannot use RESULT in this function'#000+ - '07086_W_"$1" without operand translated into "$1 %st,%st(1)"'#000+ + '07086_W_"$1" without operand translated in','to "$1 %st,%st(1)"'#000+ '07087_W_"$1 %st(n)" translated into "$1 %st,%st(n)"'#000+ - '07088_W_"$1 %st(n)" translated into "$1 %st(n','),%st"'#000+ + '07088_W_"$1 %st(n)" translated into "$1 %st(n),%st"'#000+ '07089_E_Char < not allowed here'#000+ '07090_E_Char > not allowed here'#000+ '07093_W_ALIGN not supported'#000+ - '07094_E_Inc and Dec cannot be together'#000+ + '07094_E_Inc and Dec canno','t be together'#000+ '07095_E_Invalid register list for MOVEM or FMOVEM'#000+ '07096_E_Reglist invalid for opcode'#000+ - '07097_E_Higher cp','u mode required ($1)'#000+ + '07097_E_Higher cpu mode required ($1)'#000+ '07098_W_No size specified and unable to determine the size of the oper'+ 'ands, using DWORD as default'#000+ - '07099_E_Syntax error while trying to parse a shifter operand'#000+ - '07100_E_Address of packed component is not at a byte bounda','ry'#000+ + '0709','9_E_Syntax error while trying to parse a shifter operand'#000+ + '07100_E_Address of packed component is not at a byte boundary'#000+ '07101_W_No size specified and unable to determine the size of the oper'+ 'ands, using BYTE as default'#000+ - '07102_W_Use of +offset(%ebp) for parameters invalid here'#000+ + '07102_W_Use of +offset(','%ebp) for parameters invalid here'#000+ '07103_W_Use of +offset(%ebp) is not compatible with regcall convention'+ #000+ - '07104_W_Use',' of -offset(%ebp) is not recommended for local variable a'+ - 'ccess'#000+ - '07105_W_Use of -offset(%esp), access may cause a crash or value may be'+ - ' lost'#000+ + '07104_W_Use of -offset(%ebp) is not recommended for local variable acc'+ + 'ess'#000+ + '07105_W_Use of -offset(%esp), access may cause a crash or val','ue may '+ + 'be lost'#000+ '07106_E_VMTOffset must be used in combination with a virtual method, a'+ 'nd "$1" is not virtual'#000+ - '07107_E_','Generating PIC, but reference is not PIC-safe'#000+ + '07107_E_Generating PIC, but reference is not PIC-safe'#000+ '07108_E_All registers in a register set must be of the same kind and w'+ 'idth'#000+ - '07109_E_A register set cannot be empty'#000+ + '071','09_E_A register set cannot be empty'#000+ '07110_W_@GOTPCREL is useless and potentially dangerous for local symbo'+ 'ls'#000+ - '07111_W','_Constant with general purpose segment register'#000+ + '07111_W_Constant with general purpose segment register'#000+ '07112_E_Invalid offset value for $1'#000+ '07113_E_Invalid register for $1'#000+ - '07114_E_SEH directives are allowed only in pure assembler procedures'#000+ - '07115_E_Directive "$1" is not supported for the current',' target'#000+ + '07114_E_','SEH directives are allowed only in pure assembler procedures'+ + #000+ + '07115_E_Directive "$1" is not supported for the current target'#000+ '07116_E_This function'#039's result location cannot be encoded directly'+ ' in a single operand when "nostackframe" is used'#000+ - '07117_E_GOTPCREL references in Intel assembler syntax cannot contain a'+ - ' base or index register, and their offset must ','0.'#000+ + '0','7117_E_GOTPCREL references in Intel assembler syntax cannot contain'+ + ' a base or index register, and their offset must 0.'#000+ '07118_E_The current target does not support GOTPCREL relocations'#000+ - '07119_W_Exported/global symbols should be accessed via the GOT'#000+ + '07119_W_Exported/global symbols should be accessed via t','he GOT'#000+ '07120_W_Check size of memory operand "$1"'#000+ - '07121_W_Check size of memory operand "$1: memory-operand-size is $2',' '+ - 'bits, but expected [$3 bits]"'#000+ + '07121_W_Check size of memory operand "$1: memory-operand-size is $2 bi'+ + 'ts, but expected [$3 bits]"'#000+ '07122_W_Check size of memory operand "$1: memory-operand-size is $2 bi'+ - 'ts, but expected [$3 bits + $4 byte offset]"'#000+ + 'ts, but expected [$3 bi','ts + $4 byte offset]"'#000+ '07123_W_Check "$1: offset of memory operand is negative "$2 byte"'#000+ - '07124_W_Check "$1: size of m','emory operand is empty, but es exists di'+ - 'fferent definitions of the memory size =>> map to $2 (smallest option)'+ - '"'#000+ - '07125_E_Invalid register used in memory reference expression: "$1"'#000+ + '07124_W_Check "$1: size of memory operand is empty, but es exists diff'+ + 'erent definitions of the memory size =>> map to $2 (smallest option)"'#000+ + '07125_E_Inva','lid register used in memory reference expression: "$1"'#000+ '07126_E_SEG used without identifier'#000+ - '07127_E_@CODE and @DATA c','an only be used with the SEG operator'#000+ + '07127_E_@CODE and @DATA can only be used with the SEG operator'#000+ '07128_E_Not enough space (16 bits required) for the segment constant o'+ 'f symbol $1'#000+ - '07129_E_Invalid value of .code directive constant'#000+ - '07130_W_No size specified and unable to determine the size of the cons', + '0712','9_E_Invalid value of .code directive constant'#000+ + '07130_W_No size specified and unable to determine the size of the cons'+ 'tant, using BYTE as default'#000+ '07131_W_No size specified and unable to determine the size of the cons'+ - 'tant, using WORD as default'#000+ + 'tant, using WORD as defaul','t'#000+ '07132_E_Cannot override ES segment'#000+ '07133_W_Reference is not valid here (expected "$1")'#000+ - '07134_E_Address sizes do no','t match'#000+ + '07134_E_Address sizes do not match'#000+ '07135_E_Instruction "POP CS" is not valid for the current target'#000+ - '07136_W_Instruction "POP CS" is not portable (it only works on 8086 an'+ - 'd 8088 CPUs)'#000+ + '07136_W_Instruction "POP CS" is not portable (it on','ly works on 8086 '+ + 'and 8088 CPUs)'#000+ '07137_E_Label $1 can only be declared public before it'#039's defined'#000+ - '07138_E_Local label',' $1 cannot be declared public'#000+ + '07138_E_Local label $1 cannot be declared public'#000+ '07139_E_Cannot use multiple segment overrides'#000+ - '07140_W_Multiple segment overrides (only the last one will take effect'+ - ')'#000+ + '07140_W_Multiple segment overrides (only the las','t one will take effe'+ + 'ct)'#000+ '07141_W_Segment base $1 will be generated, but is ignored by the CPU i'+ 'n 64-bit mode'#000+ - '08000_F_','Too many assembler files'#000+ + '08000_F_Too many assembler files'#000+ '08001_F_Selected assembler output not supported'#000+ '08002_F_Comp not supported'#000+ - '08003_F_Direct not support for binary writers'#000+ + '08003_F_Direct not suppo','rt for binary writers'#000+ '08004_E_Allocating of data is only allowed in bss section'#000+ '08005_F_No binary writer selected'#000+ - '08','006_E_Asm: Opcode $1 not in table'#000+ + '08006_E_Asm: Opcode $1 not in table'#000+ '08007_E_Asm: $1 invalid combination of opcode and operands'#000+ - '08008_E_Asm: 16 Bit references not supported'#000+ + '08008_E_Asm: 16 Bit references ','not supported'#000+ '08009_E_Asm: Invalid effective address'#000+ '08010_E_Asm: Immediate or reference expected'#000+ - '08011_E_Asm: $1 va','lue exceeds bounds $2'#000+ + '08011_E_Asm: $1 value exceeds bounds $2'#000+ '08012_E_Asm: Short jump is out of range $1'#000+ '08013_E_Asm: Undefined label $1'#000+ - '08014_E_Asm: Comp type not supported for this target'#000+ + '08014_E_Asm: Comp type not ','supported for this target'#000+ '08015_E_Asm: Extended type not supported for this target'#000+ '08016_E_Asm: Duplicate label $1'#000+ - '0','8017_E_Asm: Redefined label $1'#000+ + '08017_E_Asm: Redefined label $1'#000+ '08018_E_Asm: First defined here'#000+ '08019_E_Asm: Invalid register $1'#000+ - '08020_E_Asm: 16 or 32 Bit references not supported'#000+ + '08020_E_Asm: 16 or 32 Bit re','ferences not supported'#000+ '08021_E_Asm: 64 Bit operands not supported'#000+ - '08022_E_Asm: AH,BH,CH or DH cannot be used in an i','nstruction requiri'+ - 'ng REX prefix'#000+ + '08022_E_Asm: AH,BH,CH or DH cannot be used in an instruction requiring'+ + ' REX prefix'#000+ '08023_E_Missing .seh_endprologue directive'#000+ '08024_E_Function prologue exceeds 255 bytes'#000+ - '08025_E_.seh_handlerdata directive without preceding .seh_handler'#000+ + '08025','_E_.seh_handlerdata directive without preceding .seh_handler'#000+ '08026_F_Relocation count for section $1 exceeds 65535'#000+ - '0','8027_N_Change of bind type of symbol $1 from $2 to $3 after use'#000+ - '08028_H_Change of bind type of symbol $1 from $2 to $3 after use'#000+ + '08027_N_Change of bind type of symbol $1 from $2 to $3 after use'#000+ + '08028_H_Change of bind type of symbol $1 from $2 to $3 after',' use'#000+ '08029_E_Asm: 32 Bit references not supported'#000+ '08030_F_Code segment too large'#000+ '08031_F_Data segment too large'#000+ - '0803','2_E_Instruction not supported by the selected instruction set'#000+ + '08032_E_Instruction not supported by the selected instruction set'#000+ '08033_E_Asm: conditional branch destination is out of range'#000+ - '09000_W_Source operating system redefined'#000+ + '09','000_W_Source operating system redefined'#000+ '09001_I_Assembling (pipe) $1'#000+ '09002_E_Can'#039't create assembler file: $1'#000+ - '09003_E','_Can'#039't create object file: $1 (error code: $2)'#000+ + '09003_E_Can'#039't create object file: $1 (error code: $2)'#000+ '09004_E_Can'#039't create archive file: $1'#000+ - '09005_E_Assembler $1 not found, switching to external assembling'#000+ + '09005_E_Assembler $1 not found, switchi','ng to external assembling'#000+ '09006_T_Using assembler: $1'#000+ '09007_E_Error while assembling exitcode $1'#000+ - '09008_E_Can'#039't call ','the assembler, error $1 switching to external'+ - ' assembling'#000+ + '09008_E_Can'#039't call the assembler, error $1 switching to external a'+ + 'ssembling'#000+ '09009_I_Assembling $1'#000+ '09010_I_Assembling with smartlinking $1'#000+ - '09011_W_Object $1 not found, Linking may fail !'#000+ + '09011','_W_Object $1 not found, Linking may fail !'#000+ '09012_W_Library $1 not found, Linking may fail !'#000+ - '09013_E_Error while link','ing'#000+ + '09013_E_Error while linking'#000+ '09014_E_Can'#039't call the linker, switching to external linking'#000+ '09015_I_Linking $1'#000+ - '09016_E_Util $1 not found, switching to external linking'#000+ + '09016_E_Util $1 not found, switching to ','external linking'#000+ '09017_T_Using util $1'#000+ '09018_E_Creation of Executables not supported'#000+ - '09019_E_Creation of Dynamic/Sha','red Libraries not supported'#000+ + '09019_E_Creation of Dynamic/Shared Libraries not supported'#000+ '09035_E_Creation of Static Libraries not supported'#000+ '09020_I_Closing script $1'#000+ - '09021_E_Resource compiler "$1" not found, switching to external mode'#000+ + '09021_E_Resource co','mpiler "$1" not found, switching to external mode'+ + #000+ '09022_I_Compiling resource $1'#000+ - '09023_T_Unit $1 cannot be statically',' linked, switching to smart link'+ - 'ing'#000+ + '09023_T_Unit $1 cannot be statically linked, switching to smart linkin'+ + 'g'#000+ '09024_T_Unit $1 cannot be smart linked, switching to static linking'#000+ - '09025_T_Unit $1 cannot be shared linked, switching to static linking'#000+ + '09025_T_Unit $1 cann','ot be shared linked, switching to static linking'+ + #000+ '09026_E_Unit $1 cannot be smart or static linked'#000+ - '09027_E_Unit $1 ca','nnot be shared or static linked'#000+ + '09027_E_Unit $1 cannot be shared or static linked'#000+ '09028_D_Calling resource compiler "$1" with "$2" as command line'#000+ - '09029_E_Error while compiling resources'#000+ + '09029_E_Error while compili','ng resources'#000+ '09030_E_Can'#039't call the resource compiler "$1", switching to extern'+ 'al mode'#000+ - '09031_E_Can'#039't open resource f','ile "$1"'#000+ + '09031_E_Can'#039't open resource file "$1"'#000+ '09032_E_Can'#039't write resource file "$1"'#000+ '09033_N_File "$1" not found for backquoted cat command'#000+ - '09034_W_"$1" not found, this will probably cause a linking failure'#000+ + '09034_W_"$1" not foun','d, this will probably cause a linking failure'#000+ '09128_F_Can'#039't post process executable $1'#000+ - '09129_F_Can'#039't open executable',' $1'#000+ + '09129_F_Can'#039't open executable $1'#000+ '09130_X_Size of Code: $1 bytes'#000+ '09131_X_Size of initialized data: $1 bytes'#000+ '09132_X_Size of uninitialized data: $1 bytes'#000+ - '09133_X_Stack space reserved: $1 bytes'#000+ + '0','9133_X_Stack space reserved: $1 bytes'#000+ '09134_X_Stack space committed: $1 bytes'#000+ - '09200_F_Executable image size is too b','ig for $1 target.'#000+ + '09200_F_Executable image size is too big for $1 target.'#000+ '09201_W_Object file "$1" contains 32-bit absolute relocation to symbol'+ ' "$2".'#000+ - '09202_E_Program segment too large (exceeds 64k by $1 bytes)'#000+ + '09202_E_Program segment too l','arge (exceeds 64k by $1 bytes)'#000+ '09203_E_Code segment "$1" too large (exceeds 64k by $2 bytes)'#000+ - '09204_E_Data segment "$','1" too large (exceeds 64k by $2 bytes)'#000+ + '09204_E_Data segment "$1" too large (exceeds 64k by $2 bytes)'#000+ '09205_E_Segment "$1" too large (exceeds 64k by $2 bytes)'#000+ - '09206_E_Group "$1" too large (exceeds 64k by $2 bytes)'#000+ + '09206_E_Group "$1" too large',' (exceeds 64k by $2 bytes)'#000+ '09207_E_Cannot create a .COM file, because the program contains segmen'+ 't relocations'#000+ - '09208','_W_Program "$1" uses experimental CheckPointer option'#000+ + '09208_W_Program "$1" uses experimental CheckPointer option'#000+ '09209_E_Multiple defined symbol "$1"'#000+ - '09210_E_COMDAT selection mode $1 not supported (section: "$1")'#000+ + '09210_E_COMDAT selection mode $1 ','not supported (section: "$1")'#000+ '09211_E_Associative section expected for COMDAT section "$1"'#000+ - '09212_E_COMDAT section se','lection mode doesn'#039't match for section '+ - '"$1" and symbol "$2"'#000+ + '09212_E_COMDAT section selection mode doesn'#039't match for section "$'+ + '1" and symbol "$2"'#000+ '09213_E_Associative COMDAT section for section "$1" not found'#000+ - '09214_D_Discarding duplicate symbol "$1" due to COMDAT selection mode'#000+ - '09215_D_Discarding duplicate symbol "$1" with sa','me size due to COMDA'+ - 'T selection mode'#000+ + '09','214_D_Discarding duplicate symbol "$1" due to COMDAT selection mod'+ + 'e'#000+ + '09215_D_Discarding duplicate symbol "$1" with same size due to COMDAT '+ + 'selection mode'#000+ '09216_D_Discarding duplicate symbol "$1" with same content due to COMD'+ - 'AT selection mode'#000+ + 'AT selection mode',#000+ '09217_D_Replacing duplicate symbol "$1" with smaller size due to COMDA'+ 'T selection mode'#000+ - '09218_E_Size of duplicate CO','MDAT symbol "$1" differs'#000+ + '09218_E_Size of duplicate COMDAT symbol "$1" differs'#000+ '09219_E_Content of duplicate COMDAT symbol "$1" differs'#000+ - '09220_E_COMDAT selection mode for symbol "$1" differs'#000+ + '09220_E_COMDAT selection mode for symbol "$','1" differs'#000+ '10000_T_Unitsearch: $1'#000+ '10001_T_PPU Loading $1'#000+ '10002_U_PPU Name: $1'#000+ '10003_U_PPU Flags: $1'#000+ - '10004_U_PPU Crc:',' $1'#000+ + '10004_U_PPU Crc: $1'#000+ '10005_U_PPU Time: $1'#000+ '10006_U_PPU File too short'#000+ '10007_U_PPU Invalid Header (no PPU at the begin)'#000+ - '10008_U_PPU Invalid Version $1'#000+ + '10008_U_PPU Invalid Ver','sion $1'#000+ '10009_U_PPU is compiled for another processor'#000+ '10010_U_PPU is compiled for another target'#000+ - '10011_U_PPU Source:',' $1'#000+ + '10011_U_PPU Source: $1'#000+ '10012_U_Writing $1'#000+ '10013_F_Can'#039't Write PPU-File'#000+ '10014_F_Error reading PPU-File'#000+ '10015_F_Unexpected end of PPU-File'#000+ - '10016_F_Invalid PPU-File entry: $1'#000+ + '10016_','F_Invalid PPU-File entry: $1'#000+ '10017_F_PPU Dbx count problem'#000+ '10018_E_Illegal unit name: $1 (expecting $2)'#000+ - '10019_F_Too ','much units'#000+ + '10019_F_Too much units'#000+ '10020_F_Circular unit reference between $1 and $2'#000+ '10021_F_Can'#039't compile unit $1, no sources available'#000+ - '10022_F_Can'#039't find unit $1 used by $2'#000+ + '10022_F_Can',#039't find unit $1 used by $2'#000+ '10023_W_Unit $1 was not found but $2 exists'#000+ '10024_F_Unit $1 searched but $2 found'#000+ - '10025_W','_Compiling the system unit requires the -Us switch'#000+ + '10025_W_Compiling the system unit requires the -Us switch'#000+ '10026_F_There were $1 errors compiling module, stopping'#000+ - '10027_U_Load from $1 ($2) unit $3'#000+ + '10027_U_Load from',' $1 ($2) unit $3'#000+ '10028_U_Recompiling $1, checksum changed for $2'#000+ '10029_U_Recompiling $1, source found only'#000+ - '10030_U_R','ecompiling unit, static lib is older than ppufile'#000+ + '10030_U_Recompiling unit, static lib is older than ppufile'#000+ '10031_U_Recompiling unit, shared lib is older than ppufile'#000+ - '10032_U_Recompiling unit, obj and asm are older than ppufile'#000+ + '10032_U_Recompi','ling unit, obj and asm are older than ppufile'#000+ '10033_U_Recompiling unit, obj is older than asm'#000+ - '10034_U_Parsing interf','ace of $1'#000+ + '10034_U_Parsing interface of $1'#000+ '10035_U_Parsing implementation of $1'#000+ '10036_U_Second load for unit $1'#000+ '10037_U_PPU Check file $1 time $2'#000+ - '10040_W_Can'#039't recompile unit $1, but found modified include files'#000+ - '10041_U_File $1 is newer than the one used for creating PPU f','ile $2'#000+ + '10040_W_Can',#039't recompile unit $1, but found modified include files'#000+ + '10041_U_File $1 is newer than the one used for creating PPU file $2'#000+ '10042_U_Trying to use a unit which was compiled with a different FPU m'+ 'ode'#000+ '10043_U_Loading interface units from $1'#000+ - '10044_U_Loading implementation units from $1'#000+ + '100','44_U_Loading implementation units from $1'#000+ '10045_U_Interface CRC changed for unit $1'#000+ - '10046_U_Implementation CRC chang','ed for unit $1'#000+ + '10046_U_Implementation CRC changed for unit $1'#000+ '10047_U_Finished compiling unit $1'#000+ '10048_U_Adding dependency: $1 depends on $2'#000+ - '10049_U_No reload, is caller: $1'#000+ + '10049_U_No reload, is caller: ','$1'#000+ '10050_U_No reload, already in second compile: $1'#000+ '10051_U_Flag for reload: $1'#000+ '10052_U_Forced reloading'#000+ - '10053_U_Pre','vious state of $1: $2'#000+ + '10053_U_Previous state of $1: $2'#000+ '10054_U_Already compiling $1, setting second compile'#000+ '10055_U_Loading unit $1'#000+ - '10056_U_Finished loading unit $1'#000+ + '10056_U_Finished loading ','unit $1'#000+ '10057_U_Registering new unit $1'#000+ '10058_U_Re-resolving unit $1'#000+ - '10059_U_Skipping re-resolving unit $1, still lo','ading used units'#000+ + '10059_U_Skipping re-resolving unit $1, still loading used units'#000+ '10060_U_Unloading resource unit $1 (not needed)'#000+ - '10061_E_Unit $1 was compiled using a different whole program optimizat'+ - 'ion feedback input ($2, $3); recompile it without wpo or use the same '+ - 'wpo feedback input file for this co','mpilation invocation'#000+ + '10061_E_Unit $1 was compiled using a different whole progra','m optimiz'+ + 'ation feedback input ($2, $3); recompile it without wpo or use the sam'+ + 'e wpo feedback input file for this compilation invocation'#000+ '10062_U_Indirect interface (objects/classes) CRC changed for unit $1'#000+ - '10063_U_PPU is compiled for another i8086 memory model'#000+ + '10063_U_PPU is compiled for anothe','r i8086 memory model'#000+ '10064_U_Loading unit $1 from package $2'#000+ - '10065_F_Internal type "$1" was not found. Check if you ','use the corre'+ - 'ct run time library.'#000+ + '10065_F_Internal type "$1" was not found. Check if you use the correct'+ + ' run time library.'#000+ '10066_F_Internal type "$1" does not look as expected. Check if you use'+ - ' the correct run time library.'#000+ + ' the correct run tim','e library.'#000+ '11000_O_$1 [options] <inputfile> [options]'#000+ - '11001_W_Only one source file supported, changing source file t','o comp'+ - 'ile from "$1" into "$2"'#000+ + '11001_W_Only one source file supported, changing source file to compil'+ + 'e from "$1" into "$2"'#000+ '11002_W_DEF file can be created only for OS/2'#000+ - '11003_E_Nested response files are not supported'#000+ + '11003_E_Nested response files are not supported'#000, '11004_F_No source file name in command line'#000+ '11005_N_No option inside $1 config file'#000+ '11006_E_Illegal parameter: $1'#000+ - '11','007_H_-? writes help pages'#000+ + '11007_H_-? writes help pages'#000+ '11008_F_Too many config files nested'#000+ '11009_F_Unable to open file $1'#000+ - '11010_D_Reading further options from $1'#000+ + '11010_D_Reading further optio','ns from $1'#000+ '11011_W_Target is already set to: $1'#000+ - '11012_W_Shared libs not supported on DOS platform, reverting to stat','i'+ - 'c'#000+ + '11012_W_Shared libs not supported on DOS platform, reverting to static'+ + #000+ '11013_F_In options file $1 at line $2 too many #IF(N)DEFs encountered'#000+ - '11014_F_In options file $1 at line $2 unexpected #ENDIFs encountered'#000+ + '11014_F_In options file $1 at line $2 unexpected #E','NDIFs encountered'+ + #000+ '11015_F_Open conditional at the end of the options file'#000+ - '11016_W_Debug information generation is no','t supported by this execut'+ - 'able'#000+ + '11016_W_Debug information generation is not supported by this executab'+ + 'le'#000+ '11017_H_Try recompiling with -dGDB'#000+ '11018_W_You are using the obsolete switch $1'#000+ - '11019_W_You are using the obsolete switch $1, please use $2'#000+ + '11019_W_You a','re using the obsolete switch $1, please use $2'#000+ '11020_N_Switching assembler to default source writing assembler'#000+ - '11021','_W_Assembler output selected "$1" is not compatible with "$2"'#000+ + '11021_W_Assembler output selected "$1" is not compatible with "$2"'#000+ '11022_W_"$1" assembler use forced'#000+ - '11026_T_Reading options from file $1'#000+ + '11026_T_Reading options from',' file $1'#000+ '11027_T_Reading options from environment $1'#000+ '11028_D_Handling option "$1"'#000+ '11029_O_*** press enter ***'#000+ - '11030_','H_Start of reading config file $1'#000+ + '11030_H_Start of reading config file $1'#000+ '11031_H_End of reading config file $1'#000+ '11032_D_Interpreting option "$1"'#000+ - '11036_D_Interpreting firstpass option "$1"'#000+ + '11036_D_Interpretin','g firstpass option "$1"'#000+ '11033_D_Interpreting file option "$1"'#000+ '11034_D_Reading config file "$1"'#000+ - '11035_D_Found source ','file name "$1"'#000+ + '11035_D_Found source file name "$1"'#000+ '11039_E_Unknown codepage "$1"'#000+ '11040_F_Config file $1 is a directory'#000+ - '11041_W_Assembler output selected "$1" cannot generate debug info, deb'+ - 'ugging disabled'#000+ + '11041_W_Assembler output selected "$1" ca','nnot generate debug info, d'+ + 'ebugging disabled'#000+ '11042_W_Use of ppc386.cfg is deprecated, please use fpc.cfg instead'#000+ - '110','43_F_In options file $1 at line $2 #ELSE directive without #IF(N)'+ - 'DEF found'#000+ - '11044_F_Option "$1" is not, or not yet, supported on the current targe'+ - 't platform'#000+ + '11043_F_In options file $1 at line $2 #ELSE directive without #IF(N)DE'+ + 'F found'#000+ + '11044_F_Option "$1" is not, or not yet, supported',' on the current tar'+ + 'get platform'#000+ '11045_F_The feature "$1" is not, or not yet, supported on the selected'+ - ' target platfo','rm'#000+ + ' target platform'#000+ '11046_N_DWARF debug information cannot be used with smart linking on t'+ 'his target, switching to static linking'#000+ - '11047_W_Option "$1" is ignored for the current target platform.'#000+ - '11048_W_Disabling external debug information because it is unsu','pport'+ - 'ed for the selected target/debug format combination.'#000+ - '11049_N_DWARF debug information cannot be used with smart linking with'+ - ' external assembler, disabling static library creation.'#000+ - '11050_E_Invalid value for MACOSX_DEPLOYMENT_TARGET envir','onment varia'+ - 'ble: $1'#000+ + '11047_W_Opt','ion "$1" is ignored for the current target platform.'#000+ + '11048_W_Disabling external debug information because it is unsupported'+ + ' for the selected target/debug format combination.'#000+ + '11049_N_DWARF debug information cannot be used with smart linking ','wi'+ + 'th external assembler, disabling static library creation.'#000+ + '11050_E_Invalid value for MACOSX_DEPLOYMENT_TARGET environment variabl'+ + 'e: $1'#000+ '11051_E_Invalid value for IPHONEOS_DEPLOYMENT_TARGET environment varia'+ 'ble: $1'#000+ - '11052_E_You must use a FPU type of VFPV2, VFPV3 or VFPV3_D16 when usin'+ - 'g the EABIHF ABI target'#000+ - '11053_W_The selected debug format is not support','ed on the current ta'+ - 'rget, not changing the current setting'#000+ + '11052_E_You must use a FPU',' type of VFPV2, VFPV3 or VFPV3_D16 when us'+ + 'ing the EABIHF ABI target'#000+ + '11053_W_The selected debug format is not supported on the current targ'+ + 'et, not changing the current setting'#000+ '11054_E_Argument to "$1" is missing'#000+ - '11055_E_Malformed parameter: $1'#000+ + '11055_E_Malformed parameter: ','$1'#000+ '11056_W_Smart linking requires external linker'#000+ - '11057_E_Creating .COM files is not supported in the current memory',' m'+ - 'odel. Only the tiny memory model supports making .COM files.'#000+ - '11058_W_Experimental CheckPointer option not enabled because it is inc'+ - 'omptatible with -Ur option.'#000+ + '11057_E_Creating .COM files is not supported in the current memory mod'+ + 'el. Only the tiny memory model supports making .COM files.'#000+ + '11058_W_Experimental CheckPointer option not enabled because ','it is i'+ + 'ncomptatible with -Ur option.'#000+ '11059_E_Unsupported target architecture -P$1, invoke the "fpc" compile'+ - 'r driver ','instead.'#000+ + 'r driver instead.'#000+ '11060_E_Feature switches are only supported while compiling the system'+ ' unit.'#000+ - '11061_N_The selected debug format is not supported by the internal lin'+ - 'ker, switching to external linking'#000+ - '12000_F_Cannot open whole program optimization fe','edback file "$1"'#000+ + '11061_N_The selected debug format is n','ot supported by the internal l'+ + 'inker, switching to external linking'#000+ + '12000_F_Cannot open whole program optimization feedback file "$1"'#000+ '12001_D_Processing whole program optimization information in wpo feedb'+ 'ack file "$1"'#000+ - '12002_D_Finished processing the whole program optimization information'+ - ' in wpo feedback file "$1"'#000+ - '12003_E_Expected section header, but got "','$2" at line $1 of wpo feed'+ - 'back file'#000+ + '12002_D_Finished proces','sing the whole program optimization informati'+ + 'on in wpo feedback file "$1"'#000+ + '12003_E_Expected section header, but got "$2" at line $1 of wpo feedba'+ + 'ck file'#000+ '12004_W_No handler registered for whole program optimization section "'+ - '$2" at line $1 of wpo feedback file, ignoring'#000+ + '$2" at line $1 of ','wpo feedback file, ignoring'#000+ '12005_D_Found whole program optimization section "$1" with information'+ ' about "$2"'#000+ - '12006_','F_The selected whole program optimizations require a previousl'+ - 'y generated feedback file (use -Fw to specify)'#000+ - '12007_E_No collected information necessary to perform "$1" whole progr'+ - 'am optimization found'#000+ - '12008_F_Specify a whole program optimiz','ation feedback file to store '+ - 'the generated info in (using -FW)'#000+ - '12009_E_Not generating any whole program optimization information, yet'+ - ' a feedback file was specified (using -FW)'#000+ - '12010_E_Not performing any whole program optimizations, yet an i','nput'+ - ' feedback file was specified (using -Fw)'#000+ + '12006_F_The selected whole program optimizations require a previously '+ + 'generated feedback file (use -Fw to specify)'#000+ + '12007_E_No coll','ected information necessary to perform "$1" whole pro'+ + 'gram optimization found'#000+ + '12008_F_Specify a whole program optimization feedback file to store th'+ + 'e generated info in (using -FW)'#000+ + '12009_E_Not generating any whole program optimization informa','tion, y'+ + 'et a feedback file was specified (using -FW)'#000+ + '12010_E_Not performing any whole program optimizations, yet an input f'+ + 'eedback file was specified (using -Fw)'#000+ '12011_D_Skipping whole program optimization section "$1", because not '+ - 'needed by the requested optimizations'#000+ + 'needed by',' the requested optimizations'#000+ '12012_W_Overriding previously read information for "$1" from feedback '+ - 'input file using ','information in section "$2"'#000+ + 'input file using information in section "$2"'#000+ '12013_E_Cannot extract symbol liveness information from program when s'+ - 'tripping symbols, use -Xs-'#000+ + 'tripping symbols, use -Xs-',#000+ '12014_E_Cannot extract symbol liveness information from program when w'+ 'hen not linking'#000+ - '12015_F_Cannot find "$1" or "','$2" to extract symbol liveness informat'+ - 'ion from linked program'#000+ - '12016_E_Error during reading symbol liveness information produced by "'+ - '$1"'#000+ + '12015_F_Cannot find "$1" or "$2" to extract symbol liveness informatio'+ + 'n from linked program'#000+ + '12016_E_Error during reading symbol liveness information prod','uced by'+ + ' "$1"'#000+ '12017_F_Error executing "$1" (exitcode: $2) to extract symbol informat'+ 'ion from linked program'#000+ - '12018_E_C','ollection of symbol liveness information can only help when'+ - ' using smart linking, use -CX -XX'#000+ - '12019_E_Cannot create specified whole program optimisation feedback fi'+ - 'le "$1"'#000+ + '12018_E_Collection of symbol liveness information can only help when u'+ + 'sing smart linking, use -CX -XX'#000+ + '12019_E_Cannot create specified',' whole program optimisation feedback '+ + 'file "$1"'#000+ '13001_F_Can'#039't find package $1'#000+ '13002_U_PCP file for package $1 found'#000+ - '1','3003_E_Duplicate package $1'#000+ + '13003_E_Duplicate package $1'#000+ '13004_E_Unit $1 can not be part of a package'#000+ - '13005_N_Unit $1 is implicitely imported into package $2'#000+ + '13005_N_Unit $1 is implicitely imported into packag','e $2'#000+ '13006_F_Failed to create PCP file $2 for package $1'#000+ '13007_F_Failed to read PCP file for package $1'#000+ - '13008_T_PCP ','loading $1'#000+ + '13008_T_PCP loading $1'#000+ '13009_U_PCP Name: $1'#000+ '13010_U_PCP Flags: $1'#000+ '13011_U_PCP Crc: $1'#000+ '13012_U_PCP Time: $1'#000+ '13013_U_PCP File too short'#000+ - '13014_U_PCP Invalid Header (no PCP at the begin)'#000+ + '13','014_U_PCP Invalid Header (no PCP at the begin)'#000+ '13015_U_PCP Invalid Version $1'#000+ - '13016_U_PCP is compiled for another pr','ocessor'#000+ + '13016_U_PCP is compiled for another processor'#000+ '13017_U_PCP is compiled for another target'#000+ '13018_U_Writing $1'#000+ '13019_F_Can'#039't Write PCP-File'#000+ - '13020_F_Error reading PCP-File'#000+ + '13020_F_Error reading PCP','-File'#000+ '13021_F_Unexpected end of PCP-File'#000+ '13022_F_Invalid PCP-File entry: $1'#000+ - '13023_U_Trying to use a unit which was c','ompiled with a different FPU'+ - ' mode'#000+ + '13023_U_Trying to use a unit which was compiled with a different FPU m'+ + 'ode'#000+ '13024_T_Packagesearch: $1'#000+ '13025_U_Required package $1'#000+ '13026_U_Contained unit $1'#000+ - '13027_E_Unit $1 is already contained in package $2'#000+ + '13027_E_Un','it $1 is already contained in package $2'#000+ '13028_W_Unit $1 is imported from indirectly required package $2'#000+ - '13029_U_PPL',' filename $1'#000+ + '13029_U_PPL filename $1'#000+ '11023_Free Pascal Compiler version $FPCFULLVERSION [$FPCDATE] for $FPC'+ 'CPU'#010+ - 'Copyright (c) 1993-2018 by Florian Klaempfl and others'#000+ + 'Copyright (c) 1993-2018 by Florian Kl','aempfl and others'#000+ '11024_Free Pascal Compiler version $FPCVERSION'#010+ #010+ 'Compiler date : $FPCDATE'#010+ - 'Compiler CPU target:',' $FPCCPU'#010+ + 'Compiler CPU target: $FPCCPU'#010+ #010+ 'Supported targets (targets marked with '#039'{*}'#039' are under develop'+ 'ment):'#010+ ' $OSTARGETS'#010+ #010+ - 'Supported CPU instruction sets:'#010+ + 'Supported CPU instruction sets:',#010+ ' $INSTRUCTIONSETS'#010+ #010+ 'Supported FPU instruction sets:'#010+ ' $FPUINSTRUCTIONSETS'#010+ #010+ 'Supported inline assembler modes:'#010+ - ' $ASM','MODES'#010+ + ' $ASMMODES'#010+ #010+ 'Recognized compiler and RTL features:'#010+ ' $FEATURELIST'#010+ @@ -1382,542 +1388,540 @@ const msgtxt : array[0..000346,1..240] of char=( 'Supported ABI targets:'#010+ ' $ABITARGETS'#010+ #010+ - 'Supported Optimizations:'#010+ + 'Supported Optimizations:'#010, ' $OPTIMIZATIONS'#010+ #010+ 'Supported Whole Program Optimizations:'#010+ ' All'#010+ ' $WPOPTIMIZATIONS'#010+ #010+ - 'Supported Microcontroller types:$','\n $CONTROLLERTYPES$\n'#010+ + 'Supported Microcontroller types:$\n $CONTROLLERTYPES$\n'#010+ 'This program comes under the GNU General Public Licence'#010+ 'For more information read COPYING.v2'#010+ #010+ - 'Please report bugs in our bug tracker on:'#010+ + 'Please',' report bugs in our bug tracker on:'#010+ ' http://bugs.freepascal.org'#010+ #010+ - 'More information may be found on ou','r WWW pages (including directions'+ - #010+ + 'More information may be found on our WWW pages (including directions'#010+ 'for mailing lists useful for asking questions or discussing potential'#010+ - 'new features, etc.):'#010+ + 'new features, etc.):',#010+ ' http://www.freepascal.org'#000+ '11025_F*0*_Only options valid for the default or selected platform are'+ - ' l','isted.'#010+ + ' listed.'#010+ '**0*_Put + after a boolean switch option to enable it, - to disable it'+ '.'#010+ - '**1@<x>_Read compiler options from <x> in addition to the default fpc.'+ - 'cfg'#010+ + '**1@<x>_Read compiler options from <x> in add','ition to the default fp'+ + 'c.cfg'#010+ '**1a_The compiler does not delete the generated assembler file'#010+ - '**2a5_Don'#039't generate Big',' Obj COFF files for GNU Binutils older t'+ - 'han 2.25 (Windows, NativeNT)'#010+ + '**2a5_Don'#039't generate Big Obj COFF files for GNU Binutils older tha'+ + 'n 2.25 (Windows, NativeNT)'#010+ '**2al_List sourcecode lines in assembler file'#010+ - '**2an_List node info in assembler file (-dEXTDEBUG compiler)'#010+ - '**2ao_Add an extra option to external assembler call (ignored fo','r in'+ - 'ternal)'#010+ + '**2an_Lis','t node info in assembler file (-dEXTDEBUG compiler)'#010+ + '**2ao_Add an extra option to external assembler call (ignored for inte'+ + 'rnal)'#010+ '*L2ap_Use pipes instead of creating temporary assembler files'#010+ - '**2ar_List register allocation/release info in assembler file'#010+ + '**2ar_List register allocation/release info in ass','embler file'#010+ '**2at_List temp allocation/release info in assembler file'#010+ '**1A<x>_Output format:'#010+ - '**2Adefault_Use default',' assembler'#010+ + '**2Adefault_Use default assembler'#010+ '3*2Aas_Assemble using GNU AS'#010+ '3*2Amacho_Mach-O (Darwin, Intel 32 bit) using internal writer'#010+ - '8*2Anasm_Assemble using Nasm'#010+ + '8*2Anasm_Assemble usin','g Nasm'#010+ '8*2Anasmobj_Assemble using Nasm'#010+ '3*2Anasm_Assemble using Nasm'#010+ '3*2Anasmcoff_COFF (Go32v2) file using Nasm'#010+ - '3*2An','asmelf_ELF32 (Linux) file using Nasm'#010+ + '3*2Anasmelf_ELF32 (Linux) file using Nasm'#010+ '3*2Anasmwin32_Win32 object file using Nasm'#010+ - '3*2Anasmwdosx_Win32/WDOSX object file using Nasm'#010+ + '3*2Anasmwdosx_Win32/WDOSX object file using ','Nasm'#010+ '3*2Anasmdarwin_macho32 object file using Nasm (experimental)'#010+ '3*2Awasm_Obj file using Wasm (Watcom)'#010+ - '3*2Anasmobj_','Obj file using Nasm'#010+ + '3*2Anasmobj_Obj file using Nasm'#010+ '3*2Amasm_Obj file using Masm (Microsoft)'#010+ '3*2Atasm_Obj file using Tasm (Borland)'#010+ - '3*2Aelf_ELF (Linux) using internal writer'#010+ + '3*2Aelf_ELF (Linux) usin','g internal writer'#010+ '3*2Acoff_COFF (Go32v2) using internal writer'#010+ '3*2Apecoff_PE-COFF (Win32) using internal writer'#010+ - '3*2A','yasm_Assemble using Yasm (experimental)'#010+ + '3*2Ayasm_Assemble using Yasm (experimental)'#010+ '4*2Aas_Assemble using GNU AS'#010+ '4*2Agas_Assemble using GNU GAS'#010+ - '4*2Agas-darwin_Assemble darwin Mach-O64 using GNU GAS'#010+ + '4*2Agas-darwin_Assemble ','darwin Mach-O64 using GNU GAS'#010+ '4*2Amasm_Win64 object file using ml64 (Microsoft)'#010+ - '4*2Apecoff_PE-COFF (Win64) using int','ernal writer'#010+ + '4*2Apecoff_PE-COFF (Win64) using internal writer'#010+ '4*2Aelf_ELF (Linux-64bit) using internal writer'#010+ '4*2Ayasm_Assemble using Yasm (experimental)'#010+ - '4*2Anasm_Assemble using Nasm (experimental)'#010+ + '4*2Anasm_Assemble u','sing Nasm (experimental)'#010+ '4*2Anasmwin64_Assemble Win64 object file using Nasm (experimental)'#010+ - '4*2Anasmelf_Assemble Lin','ux-64bit object file using Nasm (experimenta'+ - 'l)'#010+ + '4*2Anasmelf_Assemble Linux-64bit object file using Nasm (experimental)'+ + #010+ '4*2Anasmdarwin_Assemble darwin macho64 object file using Nasm (experim'+ - 'ental)'#010+ + 'ental)'#010, '6*2Aas_Unix o-file using GNU AS'#010+ '6*2Agas_GNU Motorola assembler'#010+ '6*2Amit_MIT Syntax (old GAS)'#010+ - '6*2Amot_Standard Motorol','a assembler'#010+ + '6*2Amot_Standard Motorola assembler'#010+ 'A*2Aas_Assemble using GNU AS'#010+ 'P*2Aas_Assemble using GNU AS'#010+ 'S*2Aas_Assemble using GNU AS'#010+ - '**1b_Generate browser info'#010+ + '**1b_Generate browser inf','o'#010+ '**2bl_Generate local symbol info'#010+ '**1B_Build all modules'#010+ '**1C<x>_Code generation options:'#010+ - '**2C3_Turn on ieee error ','checking for constants'#010+ + '**2C3_Turn on ieee error checking for constants'#010+ '**2Ca<x>_Select ABI; see fpc -i or fpc -ia for possible values'#010+ - '**2Cb_Generate code for a big-endian variant of the target architectur'+ - 'e'#010+ + '**2Cb_Generate code for a big-endian v','ariant of the target architect'+ + 'ure'#010+ '**2Cc<x>_Set default calling convention to <x>'#010+ - '**2CD_Create also dynamic library (','not supported)'#010+ + '**2CD_Create also dynamic library (not supported)'#010+ '**2Ce_Compilation with emulated floating point opcodes'#010+ '**2CE_Generate FPU code which can raise exceptions'#010+ - '**2Cf<x>_Select fpu instruction set to use; see fpc -i or fpc -if for '+ - 'possible values'#010+ - '**2CF<x>_Minimal floating point c','onstant precision (default, 32, 64)'+ - #010+ + '**2','Cf<x>_Select fpu instruction set to use; see fpc -i or fpc -if fo'+ + 'r possible values'#010+ + '**2CF<x>_Minimal floating point constant precision (default, 32, 64)'#010+ '**2Cg_Generate PIC code'#010+ - '**2Ch<n>[,m]_<n> bytes min heap size (between 1023 and 67107840) and o'+ - 'ptionally [m] max heap size'#010+ + '**2Ch<n>[,m]_<n> bytes min heap size (between 1023 and 67107840)',' and'+ + ' optionally [m] max heap size'#010+ '**2Ci_IO-checking'#010+ 'A*2CI<x>_Select instruction set on ARM: ARM or THUMB'#010+ - 'L*2CL<x>_LL','VM code generation options'#010+ + 'L*2CL<x>_LLVM code generation options'#010+ 'L*3CLflto_Enable Link-time optimisation (needed both when compiling un'+ - 'its and programs/libraries)'#010+ + 'its and programs/libraries)',#010+ 'L*3CLfltonosystem_Disable LTO for the system unit (needed with at leas'+ - 't Xcode 10.2 and earlier due to linker bugs)'#010, + 't Xcode 10.2 and earlier due to linker bugs)'#010+ 'L*3CLv<x>_LLVM target version: 3.3, 3.4, .., Xcode-6.4, .., Xcode-10.1'+ ', 7.0, 8.0'#010+ '**2Cn_Omit linking stage'#010+ - 'P*2CN_Generate nil-pointer checks (AIX-only)'#010+ + 'P*2CN_Generate nil','-pointer checks (AIX-only)'#010+ '**2Co_Check overflow of integer operations'#010+ - '**2CO_Check for possible overflow of integer o','perations'#010+ + '**2CO_Check for possible overflow of integer operations'#010+ '**2Cp<x>_Select instruction set; see fpc -i or fpc -ic for possible va'+ 'lues'#010+ '**2CP<x>=<y>_ packing settings'#010+ - '**3CPPACKSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, 4 '+ - 'and 8'#010+ - '**3CPPACKENUM=<y>_ <y> enum packing: 0, 1, 2 and',' 4 or DEFAULT or NOR'+ - 'MAL'#010+ + '**3CPPAC','KSET=<y>_ <y> set allocation: 0, 1 or DEFAULT or NORMAL, 2, '+ + '4 and 8'#010+ + '**3CPPACKENUM=<y>_ <y> enum packing: 0, 1, 2 and 4 or DEFAULT or NORMA'+ + 'L'#010+ '**3CPPACKRECORD=<y>_ <y> record packing: 0 or DEFAULT or NORMAL, 1, 2,'+ ' 4, 8, 16 and 32'#010+ - '**2Cr_Range checking'#010+ + '**2Cr_Range c','hecking'#010+ '**2CR_Verify object method call validity'#010+ '**2Cs<n>_Set stack checking size to <n>'#010+ - '**2Ct_Stack checking (for t','esting only, see manual)'#010+ + '**2Ct_Stack checking (for testing only, see manual)'#010+ '8*2CT<x>_Target-specific code generation options'#010+ '3*2CT<x>_Target-specific code generation options'#010+ - '4*2CT<x>_Target-specific code generation options'#010+ + '4','*2CT<x>_Target-specific code generation options'#010+ 'p*2CT<x>_Target-specific code generation options'#010+ - 'P*2CT<x>_Target-spe','cific code generation options'#010+ + 'P*2CT<x>_Target-specific code generation options'#010+ 'J*2CT<x>_Target-specific code generation options'#010+ - 'A*2CT<x>_Target-specific code generation options'#010+ + 'A*2CT<x>_Target-specific code generation opti','ons'#010+ 'p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed'+ ' (AIX)'#010+ - 'P*3CTsmalltoc_ Generate smaller TOC','s at the expense of execution spe'+ - 'ed (AIX)'#010+ + 'P*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed'+ + ' (AIX)'#010+ 'J*3CTautogetterprefix=X_ Automatically create getters for properties '+ - 'with prefix X (empty string disables)'#010+ + 'with prefix ','X (empty string disables)'#010+ 'J*3CTautosetterprefix=X_ Automatically create setters for properties '+ - 'with prefix X (empty',' string disables)'#010+ + 'with prefix X (empty string disables)'#010+ '8*3CTcld_ Emit a CLD instruction before using the x86 '+ 'string instructions'#010+ - '3*3CTcld_ Emit a CLD instruction before using the x86 '+ - 'string instructions'#010+ - '4*3CTcld_ Emit a CLD instr','uction before using the x8'+ + '3*3CTcld_ ',' Emit a CLD instruction before using the x8'+ '6 string instructions'#010+ + '4*3CTcld_ Emit a CLD instruction before using the x86 '+ + 'string instructions'#010+ '8*3CTfarprocspushoddbp_ Increment BP before pushing it in the pr'+ - 'ologue of far functions'#010+ + 'ologue',' of far functions'#010+ 'J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) co'+ - 'de for initializing integer ','array constants'#010+ + 'de for initializing integer array constants'#010+ 'J*3CTenumfieldinit_ Initialize enumeration fields in constructor'+ - 's to enumtype(0), after calling inherited constructors'#010+ + 's to enumtype(0), after calling inheri','ted constructors'#010+ 'J*3CTinitlocals_ Initialize local variables that trigger a JV'+ - 'M bytecode verification error',' if used uninitialized (slows down code'+ - ')'#010+ + 'M bytecode verification error if used uninitialized (slows down code)'#010+ 'J*3CTlowercaseprocstart_ Lowercase the first character of procedure/f'+ - 'unction/method names'#010+ + 'unction/metho','d names'#010+ 'A*3CTthumbinterworking_ Generate Thumb interworking-safe code if possi'+ 'ble'#010+ - 'J*2Cv_Var/out parameter copy-out c','hecking'#010+ + 'J*2Cv_Var/out parameter copy-out checking'#010+ '**2CX_Create also smartlinked library'#010+ '**1d<x>_Defines the symbol <x>'#010+ '**1D_Generate a DEF file'#010+ - '**2Dd<x>_Set description to <x>'#010+ + '**2Dd<x>_Set descripti','on to <x>'#010+ '**2Dv<x>_Set DLL version to <x>'#010+ '*O2Dw_PM application'#010+ '**1e<x>_Set path to executable'#010+ '**1E_Same as -Cn'#010+ - '**1fP','IC_Same as -Cg'#010+ + '**1fPIC_Same as -Cg'#010+ '**1F<x>_Set file names and paths:'#010+ '**2Fa<x>[,y]_(for a program) load units <x> and [y] before uses is par'+ 'sed'#010+ - '**2Fc<x>_Set input codepage to <x>'#010+ + '*','*2Fc<x>_Set input codepage to <x>'#010+ '**2FC<x>_Set RC compiler binary name to <x>'#010+ - '**2Fd_Disable the compiler'#039's internal ','directory cache'#010+ + '**2Fd_Disable the compiler'#039's internal directory cache'#010+ '**2FD<x>_Set the directory where to search for compiler utilities'#010+ '**2Fe<x>_Redirect error output to <x>'#010+ - '**2Ff<x>_Add <x> to framework path (Darwin only)'#010+ + '**2F','f<x>_Add <x> to framework path (Darwin only)'#010+ '**2FE<x>_Set exe/unit output path to <x>'#010+ - '**2Fi<x>_Add <x> to include pa','th'#010+ + '**2Fi<x>_Add <x> to include path'#010+ '**2Fl<x>_Add <x> to library path'#010+ '**2FL<x>_Use <x> as dynamic linker'#010+ - '**2Fm<x>_Load unicode conversion table from <x>.txt in the compiler di'+ - 'r'#010+ + '**2Fm<x>_Load unicode conversion table from <x>.txt i','n the compiler '+ + 'dir'#010+ '**2FM<x>_Set the directory where to search for unicode binary files'#010+ - '**2FN<x>_Add <x> to list of d','efault unit scopes (namespaces)'#010+ + '**2FN<x>_Add <x> to list of default unit scopes (namespaces)'#010+ '**2Fo<x>_Add <x> to object path'#010+ '**2Fr<x>_Load error message file <x>'#010+ - '**2FR<x>_Set resource (.res) linker to <x>'#010+ + '**2FR<x>_Set resource (','.res) linker to <x>'#010+ '**2Fu<x>_Add <x> to unit path'#010+ '**2FU<x>_Set unit output path to <x>, overrides -FE'#010+ - '**2FW<x>_Store',' generated whole-program optimization feedback in <x>'#010+ - '**2Fw<x>_Load previously stored whole-program optimization feedback fr'+ + '**2FW<x>_Store generated whole-program optimization feedback in <x>'#010+ + '**2Fw<x>_Load previously stored whole-program optimization feedback fr', 'om <x>'#010+ '*g1g_Generate debug information (default format for target)'#010+ - '*g2gc_Generate checks for pointers (experimental,',' only available on '+ - 'some targets, might generate false positive)'#010+ - '*g2gh_Use heaptrace unit (for memory leak/corruption debugging)'#010+ + '*g2gc_Generate checks for pointers (experimental, only available on so'+ + 'me targets, might generate false positive)'#010+ + '*g2gh_Use heaptrace unit (for memory leak/corruption debuggi','ng)'#010+ '*g2gl_Use line info unit (show more info with backtraces)'#010+ - '*g2gm_Generate Microsoft CodeView debug information (e','xperimental)'#010+ + '*g2gm_Generate Microsoft CodeView debug information (experimental)'#010+ '*g2go<x>_Set debug information options'#010+ '*g3godwarfsets_ Enable DWARF '#039'set'#039' type debug information (bre'+ - 'aks gdb < 6.5)'#010+ + 'aks gdb < ','6.5)'#010+ '*g3gostabsabsincludes_ Store absolute/full include file paths in Stabs'+ #010+ - '*g3godwarfmethodclassprefix_ Prefix meth','od names in DWARF with class'+ - ' name'#010+ + '*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class n'+ + 'ame'#010+ '*g3godwarfcpp_ Simulate C++ debug information in DWARF'#010+ - '*g3godwarfomflinnum_ Generate line number information in OMF LINNUM re'+ - 'cords in MS LINK format in addition to the DWARF debug information (Op'+ - 'en Watcom D','ebugger/Linker compatibility)'#010+ + '*g3godwarfomflinnum_ Generate line ','number information in OMF LINNUM '+ + 'records in MS LINK format in addition to the DWARF debug information ('+ + 'Open Watcom Debugger/Linker compatibility)'#010+ '*g2gp_Preserve case in stabs symbol names'#010+ '*g2gs_Generate Stabs debug information'#010+ - '*g2gt_Trash local variables (to detect uninitialized uses; multiple '#039+ - 't'#039' changes the trashing value)'#010+ - '*g2gv_Generates programs trac','eable with Valgrind'#010+ + '*g2gt_Trash l','ocal variables (to detect uninitialized uses; multiple '+ + #039't'#039' changes the trashing value)'#010+ + '*g2gv_Generates programs traceable with Valgrind'#010+ '*g2gw_Generate DWARFv2 debug information (same as -gw2)'#010+ '*g2gw2_Generate DWARFv2 debug information'#010+ - '*g2gw3_Generate DWARFv3 debug information'#010+ + '*g2gw3','_Generate DWARFv3 debug information'#010+ '*g2gw4_Generate DWARFv4 debug information (experimental)'#010+ '**1i_Information'#010+ - '**2iD_','Return compiler date'#010+ + '**2iD_Return compiler date'#010+ '**2iSO_Return compiler OS'#010+ '**2iSP_Return compiler host processor'#010+ '**2iTO_Return target OS'#010+ - '**2iTP_Return target processor'#010+ + '**2iTP_Return t','arget processor'#010+ '**2iV_Return short compiler version'#010+ '**2iW_Return full compiler version'#010+ - '**2ia_Return list of supporte','d ABI targets'#010+ + '**2ia_Return list of supported ABI targets'#010+ '**2ic_Return list of supported CPU instruction sets'#010+ '**2if_Return list of supported FPU instruction sets'#010+ - '**2ii_Return list of supported inline assembler modes'#010+ + '**2ii_','Return list of supported inline assembler modes'#010+ '**2io_Return list of supported optimizations'#010+ - '**2ir_Return list of re','cognized compiler and RTL features'#010+ + '**2ir_Return list of recognized compiler and RTL features'#010+ '**2it_Return list of supported targets'#010+ - '**2iu_Return list of supported microcontroller types'#010+ + '**2iu_Return list of supported microcontroller typ','es'#010+ '**2iw_Return list of supported whole program optimizations'#010+ '**1I<x>_Add <x> to include path'#010+ - '**1k<x>_Pass <x> to th','e linker'#010+ + '**1k<x>_Pass <x> to the linker'#010+ '**1l_Write logo'#010+ '**1M<x>_Set language mode to <x>'#010+ '**2Mfpc_Free Pascal dialect (default)'#010+ - '**2Mobjfpc_FPC mode with Object Pascal support'#010+ + '**2Mobjfpc_FPC mode with Obj','ect Pascal support'#010+ '**2Mdelphi_Delphi 7 compatibility mode'#010+ '**2Mtp_TP/BP 7.0 compatibility mode'#010+ - '**2Mmacpas_Macintosh P','ascal dialects compatibility mode'#010+ + '**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+ '**2Miso_ISO 7185 mode'#010+ '**2Mextendedpascal_ISO 10206 mode'#010+ - '**2Mdelphiunicode_Delphi 2009 and later compatibility mode'#010+ + '**2Mdelphiunicode_Delphi 2009 and ','later compatibility mode'#010+ '**1n_Do not read the default config files'#010+ - '**1o<x>_Change the name of the executable produce','d to <x>'#010+ + '**1o<x>_Change the name of the executable produced to <x>'#010+ '**1O<x>_Optimizations:'#010+ '**2O-_Disable optimizations'#010+ '**2O1_Level 1 optimizations (quick and debugger friendly)'#010+ - '**2O2_Level 2 optimizations (-O1 + quick optimizations)'#010+ + '**2O2_','Level 2 optimizations (-O1 + quick optimizations)'#010+ '**2O3_Level 3 optimizations (-O2 + slow optimizations)'#010+ - '**2O4_Level',' 4 optimizations (-O3 + optimizations which might have un'+ - 'expected side effects)'#010+ + '**2O4_Level 4 optimizations (-O3 + optimizations which might have unex'+ + 'pected side effects)'#010+ '**2Oa<x>=<y>_Set alignment'#010+ - '**2Oo[NO]<x>_Enable or disable optimizations; see fpc -i or fpc -io fo'+ - 'r possible values'#010+ - '**2Op<x>_Set target cpu for optimizing; see f','pc -i or fpc -ic for po'+ - 'ssible values'#010+ + '**2Oo[NO]<x>_Enab','le or disable optimizations; see fpc -i or fpc -io '+ + 'for possible values'#010+ + '**2Op<x>_Set target cpu for optimizing; see fpc -i or fpc -ic for poss'+ + 'ible values'#010+ '**2OW<x>_Generate whole-program optimization feedback for optimization'+ - ' <x>; see fpc -i or fpc -iw for possible values'#010+ + ' <x>; see fpc -i ','or fpc -iw for possible values'#010+ '**2Ow<x>_Perform whole-program optimization <x>; see fpc -i or fpc -iw'+ - ' for possible v','alues'#010+ + ' for possible values'#010+ '**2Os_Optimize for size rather than speed'#010+ '**1pg_Generate profile code for gprof (defines FPC_PROFILE)'#010+ - 'F*1P<x>_Target CPU / compiler related options:'#010+ + 'F*1P<x>_Target C','PU / compiler related options:'#010+ 'F*2PB_Show default compiler binary'#010+ 'F*2PP_Show default target cpu'#010+ - 'F*2P<x>_Set target C','PU (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mip'+ - 'sel,powerpc,powerpc64,sparc,x86_64)'#010+ + 'F*2P<x>_Set target CPU (aarch64,arm,avr,i386,i8086,jvm,m68k,mips,mipse'+ + 'l,powerpc,powerpc64,sparc,x86_64)'#010+ '**1R<x>_Assembler reading style:'#010+ - '**2Rdefault_Use default assembler for target'#010+ + '**2Rdef','ault_Use default assembler for target'#010+ '3*2Ratt_Read AT&T style assembler'#010+ '3*2Rintel_Read Intel style assembler'#010+ - '4*2Ratt','_Read AT&T style assembler'#010+ + '4*2Ratt_Read AT&T style assembler'#010+ '4*2Rintel_Read Intel style assembler'#010+ '8*2Ratt_Read AT&T style assembler'#010+ - '8*2Rintel_Read Intel style assembler'#010+ + '8*2Rintel_Read Intel style',' assembler'#010+ '6*2RMOT_Read Motorola style assembler'#010+ '**1S<x>_Syntax options:'#010+ '**2S2_Same as -Mobjfpc'#010+ - '**2Sc_Support operat','ors like C (*=,+=,/= and -=)'#010+ + '**2Sc_Support operators like C (*=,+=,/= and -=)'#010+ '**2Sa_Turn on assertions'#010+ '**2Sd_Same as -Mdelphi'#010+ - '**2Se<x>_Error options. <x> is a combination of the following:'#010+ + '**2Se<x>_Error options. <x> is a combination of',' the following:'#010+ '**3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+ - '**3*_w : Compiler also halts after war','nings'#010+ + '**3*_w : Compiler also halts after warnings'#010+ '**3*_n : Compiler also halts after notes'#010+ '**3*_h : Compiler also halts after hints'#010+ - '**2Sf_Enable certain features in compiler and RTL; see fpc -i or fpc -'+ - 'ir for possible values)'#010+ - '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)',#010+ + '**2Sf_Enable certain features in com','piler and RTL; see fpc -i or fpc'+ + ' -ir for possible values)'#010+ + '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)'#010+ '**2Sh_Use reference counted strings (ansistring by default) instead of'+ ' shortstrings'#010+ - '**2Si_Turn on inlining of procedures/functions declared as "inline"'#010+ + '**2Si_Turn on inlining of procedures/fu','nctions declared as "inline"'#010+ '**2Sj_Allows typed constants to be writeable (default in all modes)'#010+ - '**2Sk_Load fpcylix ','unit'#010+ + '**2Sk_Load fpcylix unit'#010+ '**2SI<x>_Set interface style to <x>'#010+ '**3SIcom_COM compatible interface (default)'#010+ '**3SIcorba_CORBA compatible interface'#010+ - '**2Sm_Support macros like C (global)'#010+ + '*','*2Sm_Support macros like C (global)'#010+ '**2So_Same as -Mtp'#010+ '**2Sr_Transparent file names in ISO mode'#010+ - '**2Ss_Constructor na','me must be init (destructor must be done)'#010+ + '**2Ss_Constructor name must be init (destructor must be done)'#010+ '**2Sv_Support vector processing (use CPU vector extensions if availabl'+ 'e)'#010+ - '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+ + '**2Sx_Ena','ble exception keywords (default in Delphi/ObjFPC modes)'#010+ '**2Sy_@<pointer> returns a typed pointer, same as $T+'#010+ - '**1s_D','o not call assembler and linker'#010+ + '**1s_Do not call assembler and linker'#010+ '**2sh_Generate script to link on host'#010+ '**2st_Generate script to link on target'#010+ - '**2sr_Skip register allocation phase (use with -alr)'#010+ + '**2sr_Skip reg','ister allocation phase (use with -alr)'#010+ '**1T<x>_Target operating system:'#010+ '3*2Tandroid_Android'#010+ '3*2Taros_AROS'#010+ - '3*2Tbeos_B','eOS'#010+ + '3*2Tbeos_BeOS'#010+ '3*2Tdarwin_Darwin/Mac OS X'#010+ '3*2Tembedded_Embedded'#010+ '3*2Temx_OS/2 via EMX (including EMX/RSX extender)'#010+ '3*2Tfreebsd_FreeBSD'#010+ - '3*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+ + '3','*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+ '3*2Thaiku_Haiku'#010+ - '3*2Tiphonesim_iPhoneSimulator from iOS SDK 3.2+ (olde','r versions: -Td'+ - 'arwin)'#010+ + '3*2Tiphonesim_iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tdar'+ + 'win)'#010+ '3*2Tlinux_Linux'#010+ '3*2Tnativent_Native NT API (experimental)'#010+ '3*2Tnetbsd_NetBSD'#010+ - '3*2Tnetware_Novell Netware Module (clib)'#010+ + '3*2Tnetware_Novell Netware',' Module (clib)'#010+ '3*2Tnetwlibc_Novell Netware Module (libc)'#010+ '3*2Topenbsd_OpenBSD'#010+ '3*2Tos2_OS/2 / eComStation'#010+ - '3*2Tsymbian_','Symbian OS'#010+ + '3*2Tsymbian_Symbian OS'#010+ '3*2Tsolaris_Solaris'#010+ '3*2Twatcom_Watcom compatible DOS extender'#010+ '3*2Twdosx_WDOSX DOS extender'#010+ - '3*2Twin32_Windows 32 Bit'#010+ + '3*2Twin32_Windows 32 B','it'#010+ '3*2Twince_Windows CE'#010+ '4*2Taros_AROS'#010+ '4*2Tdarwin_Darwin/Mac OS X'#010+ '4*2Tdragonfly_DragonFly BSD'#010+ '4*2Tembedded_Embedded'#010+ - '4','*2Tfreebsd_FreeBSD'#010+ + '4*2Tfreebsd_FreeBSD'#010+ '4*2Tiphonesim_iPhoneSimulator'#010+ '4*2Tlinux_Linux'#010+ '4*2Tnetbsd_NetBSD'#010+ '4*2Topenbsd_OpenBSD'#010+ '4*2Tsolaris_Solaris'#010+ - '4*2Twin64_Win64 (64 bit Windows systems)'#010+ + '4','*2Twin64_Win64 (64 bit Windows systems)'#010+ '6*2Tamiga_Commodore Amiga'#010+ '6*2Tatari_Atari ST/STe/TT'#010+ '6*2Tembedded_Embedded'#010+ - '6*','2Tlinux_Linux'#010+ + '6*2Tlinux_Linux'#010+ '6*2Tnetbsd_NetBSD'#010+ '6*2Tmacos_Mac OS'#010+ '6*2Tpalmos_PalmOS'#010+ '8*2Tembedded_Embedded'#010+ '8*2Tmsdos_MS-DOS (and compatible)'#010+ - '8*2Twin16_Windows 16 Bit'#010+ + '8','*2Twin16_Windows 16 Bit'#010+ 'A*2Tandroid_Android'#010+ 'A*2Taros_AROS'#010+ 'A*2Tdarwin_Darwin/iPhoneOS/iOS'#010+ 'A*2Tembedded_Embedded'#010+ - 'A*2Tg','ba_Game Boy Advance'#010+ + 'A*2Tgba_Game Boy Advance'#010+ 'A*2Tlinux_Linux'#010+ 'A*2Tnds_Nintendo DS'#010+ 'A*2Tnetbsd_NetBSD'#010+ 'A*2Tpalmos_PalmOS'#010+ 'A*2Tsymbian_Symbian'#010+ - 'A*2Twince_Windows CE'#010+ + 'A*2Twince_Wi','ndows CE'#010+ 'a*2Tdarwin_Darwin/iOS'#010+ 'a*2Tlinux_Linux'#010+ 'J*2Tandroid_Android'#010+ 'J*2Tjava_Java'#010+ 'm*2Tandroid_Android'#010+ - 'm*2Tembedded_Em','bedded'#010+ + 'm*2Tembedded_Embedded'#010+ 'm*2Tlinux_Linux'#010+ 'M*2Tembedded_Embedded'#010+ 'M*2Tlinux_Linux'#010+ 'P*2Taix_AIX'#010+ 'P*2Tamiga_AmigaOS'#010+ 'P*2Tdarwin_Darwin/Mac OS X'#010+ - 'P*2Tembedded_Embedded'#010+ + 'P*2Tem','bedded_Embedded'#010+ 'P*2Tlinux_Linux'#010+ 'P*2Tmacos_Mac OS (classic)'#010+ 'P*2Tmorphos_MorphOS'#010+ 'P*2Tnetbsd_NetBSD'#010+ 'P*2Twii_Wii'#010+ - 'p*2Taix','_AIX'#010+ + 'p*2Taix_AIX'#010+ 'p*2Tdarwin_Darwin/Mac OS X'#010+ 'p*2Tembedded_Embedded'#010+ 'p*2Tlinux_Linux'#010+ 'R*2Tlinux_Linux'#010+ 'R*2Tembedded_Embedded'#010+ - 'r*2Tlinux_Linux'#010+ + 'r*2Tlinux_Linux'#010, 'r*2Tembedded_Embedded'#010+ 'S*2Tlinux_Linux'#010+ 'S*2Tsolaris_Solaris'#010+ 's*2Tlinux_Linux'#010+ 'V*2Tembedded_Embedded'#010+ - '**1u<x>_Undefines th','e symbol <x>'#010+ + '**1u<x>_Undefines the symbol <x>'#010+ '**1U_Unit options:'#010+ '**2Un_Do not check where the unit name matches the file name'#010+ - '**2Ur_Generate release unit files (never automatically recompiled)'#010+ + '**2Ur_Generate release unit fil','es (never automatically recompiled)'#010+ '**2Us_Compile a system unit'#010+ - '**1v<x>_Be verbose. <x> is a combination of the foll','owing letters:'#010+ + '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+ '**2*_e : Show errors (default) 0 : Show nothing (except errors)'#010+ - '**2*_w : Show warnings u : Show unit info'#010+ + '**2*_w : Show warnings u ',': Show unit info'#010+ '**2*_n : Show notes t : Show tried/used files'#010+ - '**2*_h : Show hints ',' c : Show conditionals'#010+ + '**2*_h : Show hints c : Show conditionals'#010+ '**2*_i : Show general info d : Show debug info'#010+ - '**2*_l : Show linenumbers r : Rhide/GCC compatibility mode'#010+ + '**2*_l : Show linenumbers r : Rhi','de/GCC compatibility mod'+ + 'e'#010+ '**2*_s : Show time stamps q : Show message numbers'#010+ - '**2*_a : Show everything ',' x : Show info about invoked too'+ - 'ls'#010+ + '**2*_a : Show everything x : Show info about invoked tools'+ + #010+ '**2*_b : Write file names messages p : Write tree.log with parse tre'+ 'e'#010+ - '**2*_ with full path v : Write fpcdebug.txt with'#010+ - '**2*_z : Write output to stderr lots of debugging i','nfo'#010+ + '**2*_ ','with full path v : Write fpcdebug.txt with'#010+ + '**2*_z : Write output to stderr lots of debugging info'#010+ '**2*_m<x>,<y> : Do not show messages numbered <x> and <y>'#010+ - 'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binary name (e.g. f'+ + 'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binary name (e.g. f', 'or version)'#010+ '**1W<x>_Target-specific options (targets)'#010+ '3*2WA_Specify native type application (Windows)'#010+ - '4*2WA_Specify ','native type application (Windows)'#010+ + '4*2WA_Specify native type application (Windows)'#010+ 'A*2WA_Specify native type application (Windows)'#010+ - '3*2Wb_Create a bundle instead of a library (Darwin)'#010+ + '3*2Wb_Create a bundle instead of a library',' (Darwin)'#010+ 'P*2Wb_Create a bundle instead of a library (Darwin)'#010+ 'p*2Wb_Create a bundle instead of a library (Darwin)'#010+ - 'a*','2Wb_Create a bundle instead of a library (Darwin)'#010+ + 'a*2Wb_Create a bundle instead of a library (Darwin)'#010+ 'A*2Wb_Create a bundle instead of a library (Darwin)'#010+ - '4*2Wb_Create a bundle instead of a library (Darwin)'#010+ + '4*2Wb_Create a bundle ','instead of a library (Darwin)'#010+ '3*2WB_Create a relocatable image (Windows, Symbian)'#010+ - '3*2WB<x>_Set image base to <x> (Wi','ndows, Symbian)'#010+ + '3*2WB<x>_Set image base to <x> (Windows, Symbian)'#010+ '4*2WB_Create a relocatable image (Windows)'#010+ '4*2WB<x>_Set image base to <x> (Windows)'#010+ - 'A*2WB_Create a relocatable image (Windows, Symbian)'#010+ + 'A*2WB_Create a relocatab','le image (Windows, Symbian)'#010+ 'A*2WB<x>_Set image base to <x> (Windows, Symbian)'#010+ - '3*2WC_Specify console type application',' (EMX, OS/2, Windows)'#010+ + '3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+ '4*2WC_Specify console type application (Windows)'#010+ 'A*2WC_Specify console type application (Windows)'#010+ - 'P*2WC_Specify console type application (Classic Mac OS)'#010+ + 'P*2W','C_Specify console type application (Classic Mac OS)'#010+ '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+ - '4*','2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+ + '4*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+ 'A*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+ - '3*2We_Use external resources (Darwin)'#010+ + '3*','2We_Use external resources (Darwin)'#010+ '4*2We_Use external resources (Darwin)'#010+ 'a*2We_Use external resources (Darwin)'#010+ - 'A*2W','e_Use external resources (Darwin)'#010+ + 'A*2We_Use external resources (Darwin)'#010+ 'P*2We_Use external resources (Darwin)'#010+ 'p*2We_Use external resources (Darwin)'#010+ - '3*2WF_Specify full-screen type application (EMX, OS/2)'#010+ + '3*2WF_Specify ','full-screen type application (EMX, OS/2)'#010+ '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+ - '4*2WG_Specify g','raphic type application (Windows)'#010+ + '4*2WG_Specify graphic type application (Windows)'#010+ 'A*2WG_Specify graphic type application (Windows)'#010+ - 'P*2WG_Specify graphic type application (Classic Mac OS)'#010+ + 'P*2WG_Specify graphic type application (C','lassic Mac OS)'#010+ '3*2Wi_Use internal resources (Darwin)'#010+ '4*2Wi_Use internal resources (Darwin)'#010+ - 'a*2Wi_Use internal resour','ces (Darwin)'#010+ + 'a*2Wi_Use internal resources (Darwin)'#010+ 'A*2Wi_Use internal resources (Darwin)'#010+ 'P*2Wi_Use internal resources (Darwin)'#010+ - 'p*2Wi_Use internal resources (Darwin)'#010+ + 'p*2Wi_Use internal resources (Darwi','n)'#010+ '3*2WI_Turn on/off the usage of import sections (Windows)'#010+ - '4*2WI_Turn on/off the usage of import sections (Windows)',#010+ + '4*2WI_Turn on/off the usage of import sections (Windows)'#010+ 'A*2WI_Turn on/off the usage of import sections (Windows)'#010+ - '8*2Wh_Use huge code for units (ignored for models with CODE in a uniqu'+ - 'e segment)'#010+ + '8*2Wh_Use huge code for units (ignored for models with CODE in a u','ni'+ + 'que segment)'#010+ '8*2Wm<x>_Set memory model'#010+ '8*3WmTiny_Tiny memory model'#010+ '8*3WmSmall_Small memory model (default)'#010+ - '8*3WmMe','dium_Medium memory model'#010+ + '8*3WmMedium_Medium memory model'#010+ '8*3WmCompact_Compact memory model'#010+ '8*3WmLarge_Large memory model'#010+ '8*3WmHuge_Huge memory model'#010+ - '3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+ - 'n)'#010+ - '4*2WM<x>_Minimum Mac OS X deployment version: 10.4',', 10.5.1, ... (Dar'+ + '3*2WM<x','>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Dar'+ 'win)'#010+ - 'p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+ + '4*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+ 'n)'#010+ - 'P*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+ + 'p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+ 'n)'#010+ + 'P*2WM<x>_Minimum Mac OS X de','ployment version: 10.4, 10.5.1, ... (Dar'+ + 'win)'#010+ '3*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+ - '4','*2WN_Do not generate relocation code, needed for debugging (Windows'+ + '4*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+ + 'A*2WN_Do not generate relocation code, needed for debug','ging (Windows'+ ')'#010+ - 'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+ 'A*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+ 'le values'#010+ - 'm*2Wp<x>_Specify the ','controller type; see fpc -i or fpc -iu for poss'+ - 'ible values'#010+ - 'V*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+ + 'm*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for possib'+ 'le values'#010+ + 'V*2Wp<x>_Specify the controller type; see fpc -i or fpc -iu for p','oss'+ + 'ible values'#010+ '3*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)'#010+ - '4*2WP<x>_Minimum iOS deployment ','version: 8.0, 8.0.2, ... (iphonesim)'+ - #010+ + '4*2WP<x>_Minimum iOS deployment version: 8.0, 8.0.2, ... (iphonesim)'#010+ 'a*2WP<x>_Minimum iOS deployment version: 7.0, 7.1.2, ... (Darwin)'#010+ - 'A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)'#010+ + 'A*2WP<x>_Minimum iOS ','deployment version: 3.0, 5.0.1, ... (Darwin)'#010+ '3*2WR_Generate relocation code (Windows)'#010+ - '4*2WR_Generate relocation code',' (Windows)'#010+ + '4*2WR_Generate relocation code (Windows)'#010+ 'A*2WR_Generate relocation code (Windows)'#010+ '8*2Wt<x>_Set the target executable format'#010+ - '8*3Wtexe_Create a DOS .EXE file (default)'#010+ + '8*3Wtexe_Create a DOS .EXE fil','e (default)'#010+ '8*3Wtcom_Create a DOS .COM file (requires tiny memory model)'#010+ - 'P*2WT_Specify MPW tool type application (Cl','assic Mac OS)'#010+ + 'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+ '**2WX_Enable executable stack (Linux)'#010+ '**1X_Executable options:'#010+ - '**2X9_Generate linkerscript for GNU Binutils ld older than version 2.1'+ - '9.1 (Linux)'#010+ + '**2X9_Generate linkerscript for GNU Binutils ld',' older than version 2'+ + '.19.1 (Linux)'#010+ '**2Xc_Pass --shared/-dynamic to the linker (BeOS, Darwin, FreeBSD, Lin'+ 'ux)'#010+ - '**2Xd_D','o not search default library path (sometimes required for cro'+ - 'ss-compiling when not using -XR)'#010+ + '**2Xd_Do not search default library path (sometimes required for cross'+ + '-compiling when not using -XR)'#010+ '**2Xe_Use external linker'#010+ - '**2Xf_Substitute pthread library name for linking (BSD)'#010+ - '**2Xg_Create debuginfo in a separate file and add a debuglink se','ctio'+ - 'n to executable'#010+ + '**2X','f_Substitute pthread library name for linking (BSD)'#010+ + '**2Xg_Create debuginfo in a separate file and add a debuglink section '+ + 'to executable'#010+ '**2XD_Try to link units dynamically (defines FPC_LINK_DYNAMIC)'#010+ '**2Xi_Use internal linker'#010+ - '**2XLA_Define library substitutions for linking'#010+ + '**2XLA_Def','ine library substitutions for linking'#010+ '**2XLO_Define order of library linking'#010+ - '**2XLD_Exclude default order of standar','d libraries'#010+ + '**2XLD_Exclude default order of standard libraries'#010+ '**2Xm_Generate link map'#010+ '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+ 's '#039'main'#039')'#010+ - '**2Xn_Use target system native linker instead of GNU ld (Solaris, AIX)'+ - #010+ - 'F*2Xp<x>_First search for the compiler binary in the director','y <x>'#010+ + '**2Xn_Use target',' system native linker instead of GNU ld (Solaris, AI'+ + 'X)'#010+ + 'F*2Xp<x>_First search for the compiler binary in the directory <x>'#010+ '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+ - '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross comp'+ - 'ile, see the ld manual for more information) (BeOS, Linux)'#010+ - '**2XR<x>_Prepend <x> to all linker search paths (BeOS',', Darwin, FreeB'+ - 'SD, Linux, Mac OS, Solaris)'#010+ + '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross ','co'+ + 'mpile, see the ld manual for more information) (BeOS, Linux)'#010+ + '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+ + ', Linux, Mac OS, Solaris)'#010+ '**2Xs_Strip all symbols from executable'#010+ - '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+ + '**2XS_Try to link units statically (defau','lt, defines FPC_LINK_STATIC'+ + ')'#010+ '**2Xt_Link with static libraries (-static is passed to linker)'#010+ - '**2Xv_Generate table for',' Virtual Entry calls'#010+ + '**2Xv_Generate table for Virtual Entry calls'#010+ '**2XV_Use VLink as external linker (default on Amiga, MorphOS)'#010+ - '**2XX_Try to smartlink units (defines FPC_LINK_SMART)'#010+ + '**2XX_Try to smartlink units ',' (defines FPC_LINK_SMART)'#010+ '**1*_'#010+ '**1?_Show this help'#010+ '**1h_Shows this help without waiting' diff --git a/compiler/nadd.pas b/compiler/nadd.pas index b7880b61c3..5bf8f28e76 100644 --- a/compiler/nadd.pas +++ b/compiler/nadd.pas @@ -310,6 +310,8 @@ implementation result:=true; res:=true; end; + else + ; end else with torddef(realdef) do @@ -370,6 +372,8 @@ implementation result:=true; res:=true; end; + else + ; end; end; end; @@ -667,11 +671,15 @@ implementation begin case nodetype of addn,subn,orn,xorn: - result := left.getcopy; + result := left.getcopy; andn,muln: - if (cs_opt_level4 in current_settings.optimizerswitches) or - not might_have_sideeffects(left) then - result:=cordconstnode.create(0,resultdef,true); + begin + if (cs_opt_level4 in current_settings.optimizerswitches) or + not might_have_sideeffects(left) then + result:=cordconstnode.create(0,resultdef,true); + end + else + ; end; end else if tordconstnode(right).value = 1 then @@ -679,6 +687,8 @@ implementation case nodetype of muln: result := left.getcopy; + else + ; end; end else if tordconstnode(right).value = -1 then @@ -686,6 +696,8 @@ implementation case nodetype of muln: result := cunaryminusnode.create(left.getcopy); + else + ; end; end; if assigned(result) then @@ -701,9 +713,13 @@ implementation subn: result := cunaryminusnode.create(right.getcopy); andn,muln: - if (cs_opt_level4 in current_settings.optimizerswitches) or - not might_have_sideeffects(right) then - result:=cordconstnode.create(0,resultdef,true); + begin + if (cs_opt_level4 in current_settings.optimizerswitches) or + not might_have_sideeffects(right) then + result:=cordconstnode.create(0,resultdef,true); + end; + else + ; end; end else if tordconstnode(left).value = 1 then @@ -711,6 +727,8 @@ implementation case nodetype of muln: result := right.getcopy; + else + ; end; end {$ifdef VER2_2} @@ -722,6 +740,8 @@ implementation case nodetype of muln: result := cunaryminusnode.create(right.getcopy); + else + ; end; end; if assigned(result) then @@ -818,6 +838,8 @@ implementation trealconstnode(right).value_real:=1.0/trealconstnode(right).value_real; exit; end; + else + ; end; {$endif FPC_FULLVERSION>20700} @@ -1095,6 +1117,8 @@ implementation exit; end; } + else + ; end; end { short to full boolean evalution possible and useful? } @@ -1102,16 +1126,20 @@ implementation begin case nodetype of andn,orn: - { full boolean evaluation is only useful if the nodes are not too complex and if no flags/jumps must be converted, - further, we need to know the expectloc } - if (node_complexity(right)<=2) and - not(left.expectloc in [LOC_FLAGS,LOC_JUMP,LOC_INVALID]) and not(right.expectloc in [LOC_FLAGS,LOC_JUMP,LOC_INVALID]) then - begin - { we need to copy the whole tree to force another pass_1 } - include(localswitches,cs_full_boolean_eval); - result:=getcopy; - exit; - end; + begin + { full boolean evaluation is only useful if the nodes are not too complex and if no flags/jumps must be converted, + further, we need to know the expectloc } + if (node_complexity(right)<=2) and + not(left.expectloc in [LOC_FLAGS,LOC_JUMP,LOC_INVALID]) and not(right.expectloc in [LOC_FLAGS,LOC_JUMP,LOC_INVALID]) then + begin + { we need to copy the whole tree to force another pass_1 } + include(localswitches,cs_full_boolean_eval); + result:=getcopy; + exit; + end; + end; + else + ; end; end end; @@ -1144,6 +1172,8 @@ implementation result:=cordconstnode.create(1,resultdef,true); exit; end; + else + ; end; end; end; @@ -2211,8 +2241,6 @@ implementation if not(is_shortstring(rd) or is_char(rd)) then inserttypeconv(right,cshortstringtype); end; - else - internalerror(2005101); end; end else @@ -2586,6 +2614,8 @@ implementation result:=hp end; + else + ; end; end; @@ -2793,6 +2823,8 @@ implementation left := nil; right := nil; end; + else + internalerror(2019050520); end; end; diff --git a/compiler/nbas.pas b/compiler/nbas.pas index 2028ca4b35..f082162704 100644 --- a/compiler/nbas.pas +++ b/compiler/nbas.pas @@ -675,6 +675,8 @@ implementation left:=nil; exit; end; + else + ; end; end; end; diff --git a/compiler/ncal.pas b/compiler/ncal.pas index 6b79d9d7cf..546a1a0d99 100644 --- a/compiler/ncal.pas +++ b/compiler/ncal.pas @@ -1342,6 +1342,8 @@ implementation typecheckpass(left); end; end; + else + ; end; end else @@ -1992,6 +1994,8 @@ implementation result:=(tabstractvarsym(tloadnode(hp).symtableentry).varregable in [vr_none,vr_addr]); temprefn: result:=not(ti_may_be_in_reg in ttemprefnode(hp).tempflags); + else + ; end; end; @@ -4094,6 +4098,8 @@ implementation LOC_REGISTER, LOC_FPUREGISTER : break; + else + ; end; end; LOC_MMREGISTER, @@ -4104,6 +4110,8 @@ implementation (node_complexity(hpcurr)>node_complexity(hp)) then break; end; + else + ; end; hpprev:=hp; hp:=tcallparanode(hp.right); @@ -4550,6 +4558,8 @@ implementation typecheckpass(n); result := fen_true; end; + else + ; end; end; end; diff --git a/compiler/ncgbas.pas b/compiler/ncgbas.pas index f8d8178f42..23bb631f3f 100644 --- a/compiler/ncgbas.pas +++ b/compiler/ncgbas.pas @@ -339,6 +339,8 @@ interface taicpu(hp2).segprefix:=ref^.segment; {$endif x86} end; + else + ; end; end; end; @@ -348,6 +350,8 @@ interface taicpu(hp2).CheckIfValid; {$endif x86} end; + else + ; end; current_asmdata.CurrAsmList.concat(hp2); hp:=tai(hp.next); @@ -381,6 +385,8 @@ interface top_ref : if (ref^.segment<>NR_NO) and (ref^.segment<>get_default_segment_of_ref(ref^)) then taicpu(hp).segprefix:=ref^.segment; + else + ; end; end; {$endif x86} @@ -391,6 +397,8 @@ interface taicpu(hp).CheckIfValid; {$endif x86} end; + else + ; end; hp:=tai(hp.next); end; @@ -529,6 +537,8 @@ interface { in case reference contains CREGISTERS, that doesn't matter: we want to write to the location indicated by the current value of those registers, and we can save those values } + else + ; end; hlcg.g_reference_loc(current_asmdata.CurrAsmList,tempinfo^.typedef,tempinfo^.tempinitcode.location,tempinfo^.location); end; @@ -546,6 +556,8 @@ interface LOC_FPUREGISTER, LOC_MMREGISTER : excludetempflag(ti_valid); + else + ; end; end; diff --git a/compiler/ncgcal.pas b/compiler/ncgcal.pas index 9453d2aa8c..462fc24989 100644 --- a/compiler/ncgcal.pas +++ b/compiler/ncgcal.pas @@ -549,6 +549,8 @@ implementation hlcg.g_finalize(current_asmdata.CurrAsmList,resultdef,location.reference); tg.ungetiftemp(current_asmdata.CurrAsmList,location.reference); end; + else + ; end; end; @@ -822,6 +824,10 @@ implementation end; end; end; + LOC_VOID: + ; + else + internalerror(2019050707); end; dec(sizeleft,tcgsize2size[tmpparaloc^.size]); callerparaloc:=callerparaloc^.next; diff --git a/compiler/ncgcnv.pas b/compiler/ncgcnv.pas index 71e0025843..9feed4676d 100644 --- a/compiler/ncgcnv.pas +++ b/compiler/ncgcnv.pas @@ -334,8 +334,6 @@ interface {!!!!!!!} internalerror(8888); end; - else - internalerror(200808241); end; end; diff --git a/compiler/ncgcon.pas b/compiler/ncgcon.pas index 4619a7a591..2f9aef3b8e 100644 --- a/compiler/ncgcon.pas +++ b/compiler/ncgcon.pas @@ -173,8 +173,10 @@ implementation message(parser_e_range_check_error) else current_asmdata.asmlists[al_typedconsts].concat(tai_realconst.create_s64compreal(round(value_real))); - else - internalerror(10120); +{$ifndef cpufloat128} + else + internalerror(10120); +{$endif not cpufloat128} end; end; end; diff --git a/compiler/ncgld.pas b/compiler/ncgld.pas index 636e864838..3dd459cd8e 100644 --- a/compiler/ncgld.pas +++ b/compiler/ncgld.pas @@ -161,6 +161,8 @@ implementation inn, asn,isn: result := fen_norecurse_false; + else + ; end; end; @@ -1167,6 +1169,10 @@ implementation end; end; {$endif cpuflags} + LOC_VOID: + ; + else + internalerror(2019050706); end; end; @@ -1301,6 +1307,8 @@ implementation vtype:=vtQWord; varfield:=tfieldvarsym(search_struct_member_no_helper(trecorddef(eledef),'VQWORD')); end; + else + ; end; freetemp:=false; vaddr:=true; @@ -1331,6 +1339,8 @@ implementation vtype:=vtWideChar; varfield:=tfieldvarsym(search_struct_member_no_helper(trecorddef(eledef),'VINTEGER')); end; + else + ; end; end; end; @@ -1425,6 +1435,8 @@ implementation freetemp:=false; end; end; + else + ; end; if vtype=$ff then internalerror(14357); diff --git a/compiler/ncgmem.pas b/compiler/ncgmem.pas index 48523bf02a..a38849f939 100644 --- a/compiler/ncgmem.pas +++ b/compiler/ncgmem.pas @@ -945,6 +945,8 @@ implementation LOC_REGISTER, LOC_MMREGISTER: hlcg.location_force_mem(current_asmdata.CurrAsmList,left.location,left.resultdef); + else + ; end; location_copy(location,left.location); end; @@ -978,6 +980,8 @@ implementation rangecheck_array; stringdef : rangecheck_string; + else + ; end; end; if not(is_packed_array(left.resultdef)) or diff --git a/compiler/ncgnstld.pas b/compiler/ncgnstld.pas index f989ad8094..7c7b55ed49 100644 --- a/compiler/ncgnstld.pas +++ b/compiler/ncgnstld.pas @@ -134,6 +134,8 @@ implementation typecheckpass(left); end; end; + else + ; end; end; @@ -182,6 +184,8 @@ implementation include(flags,nf_internal); end; end; + else + ; end; end; diff --git a/compiler/ncgrtti.pas b/compiler/ncgrtti.pas index bbf19fec1a..2dd7eba4fb 100644 --- a/compiler/ncgrtti.pas +++ b/compiler/ncgrtti.pas @@ -146,6 +146,8 @@ implementation undefineddef: { don't write any RTTI for these } continue; + else + ; end; { always generate persistent tables for types in the interface so they can be reused in other units and give always the same pointer @@ -694,6 +696,8 @@ implementation write_rtti(tpropertysym(sym).propdef,rt); fieldvarsym: write_rtti(tfieldvarsym(sym).vardef,rt); + else + ; end; end; end; @@ -806,6 +810,8 @@ implementation internalerror(200706101); inc(address,int64(def.size*hp^.value)); end; + else + internalerror(2019050523); end; hp:=hp^.next; end; @@ -1662,6 +1668,8 @@ implementation objectdef_rtti_interface_full(def); end; end; + else + ; end; tcb.end_anonymous_record; end; @@ -1943,6 +1951,8 @@ implementation begin enumdef_rtti_extrasyms(Tenumdef(def)); end; + else + ; end; end; @@ -1999,6 +2009,8 @@ implementation write_rtti(tabstractpointerdef(def).pointeddef,rt); procvardef: params_write_rtti(tabstractprocdef(def),rt,false); + else + ; end; end; diff --git a/compiler/ncgset.pas b/compiler/ncgset.pas index 6397403e9c..bfe6ef4d6e 100644 --- a/compiler/ncgset.pas +++ b/compiler/ncgset.pas @@ -73,11 +73,6 @@ interface jumptable_no_range : boolean; { has the implementation jumptable support } min_label : tconstexprint; - { Number of labels } - labelcnt: TCgInt; - { Number of individual values checked, counting each value in a range - individually (e.g. 0..2 counts as 3). } - TrueCount: TCgInt; function GetBranchLabel(Block: TNode; out _Label: TAsmLabel): Boolean; @@ -594,6 +589,8 @@ implementation Block := TStatementNode(Block).Left; Continue; end; + else + ; end; Break; @@ -1136,7 +1133,7 @@ implementation begin labelarray:=nil; - SetLength(labelarray,case_count_labels(root)); + SetLength(labelarray,labelcnt); nextarrayentry:=0; addarrayentry(root); rebuild(0,high(labelarray),root); @@ -1146,18 +1143,6 @@ implementation end; procedure tcgcasenode.pass_generate_code; - - { Combines "case_count_labels" and "case_true_count" } - procedure CountBoth(p : pcaselabel); - begin - Inc(labelcnt); - Inc(TrueCount, (p^._high.svalue - p^._low.svalue) + 1); - if assigned(p^.less) then - CountBoth(p^.less); - if assigned(p^.greater) then - CountBoth(p^.greater); - end; - var oldflowcontrol: tflowcontrol; i : longint; @@ -1230,9 +1215,6 @@ implementation else {$endif not cpu64bitalu and not cpuhighleveltarget} begin - labelcnt := 0; - TrueCount := 0; - if cs_opt_level1 in current_settings.optimizerswitches then begin { procedures are empirically passed on } @@ -1243,8 +1225,6 @@ implementation { ximated as it is not known if rel8, } { rel16 or rel32 jumps are used } - CountBoth(labels); - max_label := case_get_max(labels); { can we omit the range check of the jump table ? } @@ -1278,7 +1258,7 @@ implementation end else begin - max_dist:=4*TrueCount; + max_dist:=4*labelcoverage; { Don't allow jump tables to get too large } if max_dist>4*labelcnt then diff --git a/compiler/ncgutil.pas b/compiler/ncgutil.pas index cf186b3157..bf4e76dbb8 100644 --- a/compiler/ncgutil.pas +++ b/compiler/ncgutil.pas @@ -390,8 +390,6 @@ implementation begin if (setbase<>0) then begin - if not(l.loc in [LOC_REGISTER,LOC_CREGISTER]) then - internalerror(2007091502); { subtract the setbase } case l.loc of LOC_CREGISTER: @@ -405,6 +403,8 @@ implementation begin hlcg.a_op_const_reg(list,OP_SUB,opdef,setbase,l.register); end; + else + internalerror(2007091502); end; end; end; @@ -545,6 +545,8 @@ implementation else hlcg.g_initialize(list,tparavarsym(p).vardef,href); end; + else + ; end; end; end; @@ -583,6 +585,8 @@ implementation begin loc.register:=cg.getmmregister(list,loc.size); end; + else + ; end; end; @@ -951,6 +955,8 @@ implementation end; hlcg.varsym_set_localloc(list,vs); end; + else + ; end; end; end; @@ -1025,6 +1031,8 @@ implementation rv.fpuregvars.addnodup(getsupreg(location.register)); LOC_CMMREGISTER: rv.mmregvars.addnodup(getsupreg(location.register)); + else + ; end; end; @@ -1052,13 +1060,16 @@ implementation if (tloadnode(n).symtableentry.typ in [staticvarsym,localvarsym,paravarsym]) then add_regvars(rv^,tabstractnormalvarsym(tloadnode(n).symtableentry).localloc); vecn: - { range checks sometimes need the high parameter } - if (cs_check_range in current_settings.localswitches) and - (is_open_array(tvecnode(n).left.resultdef) or - is_array_of_const(tvecnode(n).left.resultdef)) and - not(current_procinfo.procdef.proccalloption in cdecl_pocalls) then - add_regvars(rv^,tabstractnormalvarsym(get_high_value_sym(tparavarsym(tloadnode(tvecnode(n).left).symtableentry))).localloc) - + begin + { range checks sometimes need the high parameter } + if (cs_check_range in current_settings.localswitches) and + (is_open_array(tvecnode(n).left.resultdef) or + is_array_of_const(tvecnode(n).left.resultdef)) and + not(current_procinfo.procdef.proccalloption in cdecl_pocalls) then + add_regvars(rv^,tabstractnormalvarsym(get_high_value_sym(tparavarsym(tloadnode(tvecnode(n).left).symtableentry))).localloc) + end; + else + ; end; result := fen_true; end; @@ -1201,7 +1212,8 @@ implementation {$endif} cg.a_reg_sync(list,localloc.register); LOC_CFPUREGISTER, - LOC_CMMREGISTER: + LOC_CMMREGISTER, + LOC_CMMXREGISTER: if (pi_has_label in current_procinfo.flags) then cg.a_reg_sync(list,localloc.register); LOC_REFERENCE : @@ -1215,6 +1227,18 @@ implementation not(vo_is_self in varoptions)) then tg.Ungetlocal(list,localloc.reference); end; + {Â function results in pure assembler routines } + LOC_REGISTER, + LOC_FPUREGISTER, + LOC_MMREGISTER, + { empty parameter } + LOC_VOID, + { global variables in memory and typed constants don't get a location assigned, + and neither does an unused $result variable in pure assembler routines } + LOC_INVALID: + ; + else + internalerror(2019050538); end; end; end; diff --git a/compiler/ncgvmt.pas b/compiler/ncgvmt.pas index ab93c7fe07..690688e8b9 100644 --- a/compiler/ncgvmt.pas +++ b/compiler/ncgvmt.pas @@ -792,8 +792,6 @@ implementation pd:=tprocdef(tpropertysym(AImplIntf.ImplementsGetter).propaccesslist[palt_read].procdef); tcb.emit_tai(Tai_const.Create_sizeint(tobjectdef(pd.struct).vmtmethodoffset(pd.extnumber)),sizeuinttype); end; - else - internalerror(200802162); end; { IIDStr } @@ -1332,6 +1330,8 @@ implementation if assigned(tprocdef(def).parast) then do_write_vmts(tprocdef(def).parast,false); end; + else + ; end; end; end; diff --git a/compiler/ncnv.pas b/compiler/ncnv.pas index f70e6864bf..5fd1e9605e 100644 --- a/compiler/ncnv.pas +++ b/compiler/ncnv.pas @@ -950,6 +950,8 @@ implementation cgmessage1(type_h_convert_sub_operands_to_prevent_overflow,def.typename); muln: cgmessage1(type_h_convert_mul_operands_to_prevent_overflow,def.typename); + else + ; end; end; @@ -2698,9 +2700,6 @@ implementation else IncompatibleTypes(left.resultdef,resultdef); end; - - else - internalerror(200211231); end; end; { Give hint or warning for unportable code, exceptions are @@ -2793,7 +2792,6 @@ implementation function docheckremoveinttypeconvs(n: tnode): boolean; begin - result:=false; if wasoriginallysmallerint(n) then exit(true); case n.nodetype of @@ -2819,6 +2817,8 @@ implementation (((n.nodetype=andn) and wasoriginallysmallerint(tbinarynode(n).left)) or ((n.nodetype=andn) and wasoriginallysmallerint(tbinarynode(n).right)))); end; + else + result:=false; end; end; @@ -3113,6 +3113,8 @@ implementation exit; end; end; + else + ; end; {$ifndef CPUNO32BITOPS} { must be done before code below, because we need the @@ -3154,6 +3156,8 @@ implementation end; end; end; + else + ; end; {$endif not CPUNO32BITOPS} end; @@ -3683,8 +3687,6 @@ implementation end else internalerror(200802231); - else - internalerror(200802165); end; break; end; @@ -4250,6 +4252,8 @@ implementation resultdef:=pasbool1type; asn: resultdef:=tclassrefdef(right.resultdef).pointeddef; + else + ; end; end else if is_interface(right.resultdef) or @@ -4261,6 +4265,8 @@ implementation resultdef:=pasbool1type; asn: resultdef:=right.resultdef; + else + ; end; { left is a class or interface } diff --git a/compiler/ncon.pas b/compiler/ncon.pas index 392e11ea1d..594d2f54a5 100644 --- a/compiler/ncon.pas +++ b/compiler/ncon.pas @@ -353,8 +353,6 @@ implementation v:=extended(v); s128real: internalerror(2013102701); - else - internalerror(2013102702); end; value_real:=v; value_currency:=v; @@ -454,8 +452,6 @@ implementation if ts128real(value_real)=MathInf.Value then CGMessage(parser_e_range_check_error); end; - else - internalerror(2016112902); end; end; end; diff --git a/compiler/ngenutil.pas b/compiler/ngenutil.pas index aa2179e32c..a60167331b 100644 --- a/compiler/ngenutil.pas +++ b/compiler/ngenutil.pas @@ -415,6 +415,8 @@ implementation pd.localst.SymList.ForEachCall(@static_syms_finalize,arg); end; end; + else + ; end; end; @@ -675,6 +677,8 @@ implementation result:=block end end; + else + ; end; end; end; diff --git a/compiler/ngtcon.pas b/compiler/ngtcon.pas index 36bfd6ed91..fda8728d4f 100644 --- a/compiler/ngtcon.pas +++ b/compiler/ngtcon.pas @@ -213,6 +213,8 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis wpoinfomanager.symbol_live(current_procinfo.procdef.mangledname) then tobjectdef(tclassrefdef(n.resultdef).pointeddef).register_maybe_created_object_type; end; + else + ; end; tc_emit_classrefdef(def,n); n.free; @@ -720,8 +722,6 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis ftcb.emit_tai(tai_realconst.create_s64compreal(round(value*10000)),def); s128real: ftcb.emit_tai(tai_realconst.create_s128real(value),def); - else - internalerror(200611053); end; end; diff --git a/compiler/ninl.pas b/compiler/ninl.pas index 79d9e0a523..3ba81a434e 100644 --- a/compiler/ninl.pas +++ b/compiler/ninl.pas @@ -620,9 +620,6 @@ implementation ordtype: tordtype; begin ordtype := torddef(def).ordtype; - if not (ordtype in [s64bit,u64bit,s32bit,u32bit,s16bit,u16bit,s8bit,u8bit]) then - internalerror(2013032601); - if is_oversizedint(def) then begin case ordtype of @@ -679,6 +676,8 @@ implementation func_suffix := 'uint'; readfunctype := uinttype; end; + else + internalerror(2013032601); end; end; end; @@ -1096,6 +1095,8 @@ implementation end; in_writeln_x: name:='fpc_writeln_end'; + else + internalerror(2019050516); end; addstatement(Tstatementnode(newstatement),ccallnode.createintern(name,filepara.getcopy)); end; @@ -1634,6 +1635,8 @@ implementation Crttinode.create(Tenumdef(destpara.resultdef),fullrtti,rdt_str2ord) ),nil); end; + else + internalerror(2019050515); end; procname := procname + suffix; @@ -2336,6 +2339,8 @@ implementation result:=cordconstnode.create(tordconstnode(left).value and $ffffffff,u32inttype,true); in_hi_qword : result:=cordconstnode.create(tordconstnode(left).value shr 32,u32inttype,true); + else + internalerror(2019050514); end; end; end; @@ -2419,6 +2424,8 @@ implementation left:=nil; end end; + else + internalerror(2019050513); end; (* if (left.nodetype=ordconstn) then @@ -2472,6 +2479,8 @@ implementation tarraydef(left.resultdef).lowrange+1, sinttype,true); end; + else + ; end; end; in_assigned_x: @@ -2533,6 +2542,8 @@ implementation end; end; end; + else + ; end; end; in_low_x, @@ -2578,6 +2589,10 @@ implementation begin result:=cordconstnode.create(0,u8inttype,false); end; + errordef: + ; + else + internalerror(2019050512); end; end; in_exp_real : @@ -2742,6 +2757,8 @@ implementation result:=cordconstnode.create(PopCnt(tordconstnode(left).value),resultdef,false); end; end; + else + ; end; end; end; @@ -2914,6 +2931,8 @@ implementation in_lo_qword, in_hi_qword : resultdef:=u32inttype; + else + ; end; end; @@ -3735,6 +3754,8 @@ implementation shiftconst := 16; in_hi_word: shiftconst := 8; + else + ; end; if shiftconst <> 0 then result := ctypeconvnode.create_internal(cshlshrnode.create(shrn,left, diff --git a/compiler/nmat.pas b/compiler/nmat.pas index f0a91d0f8f..b7b027ad42 100644 --- a/compiler/nmat.pas +++ b/compiler/nmat.pas @@ -124,6 +124,8 @@ implementation result := cordconstnode.create(0,left.resultdef,true); divn: result := left.getcopy; + else + internalerror(2019050518); end; exit; end; @@ -173,6 +175,8 @@ implementation result:=create_simplified_ord_const(lv mod rv,resultdef,forinline); divn: result:=create_simplified_ord_const(lv div rv,resultdef,forinline); + else + internalerror(2019050519); end; end; end; @@ -728,6 +732,8 @@ implementation result:=create_simplified_ord_const(lvalue shr rvalue,resultdef,forinline); shln: result:=create_simplified_ord_const(lvalue shl rvalue,resultdef,forinline); + else + internalerror(2019050517); end; end else if rvalue=0 then diff --git a/compiler/nmem.pas b/compiler/nmem.pas index 5d6523d271..ec36ceead6 100644 --- a/compiler/nmem.pas +++ b/compiler/nmem.pas @@ -1128,8 +1128,6 @@ implementation elementdef:=cansichartype; elementptrdef:=charpointertype; end; - else - internalerror(2013112902); end; if right.nodetype=rangen then begin diff --git a/compiler/nopt.pas b/compiler/nopt.pas index 658b4a9544..70feb3bd2f 100644 --- a/compiler/nopt.pas +++ b/compiler/nopt.pas @@ -184,10 +184,9 @@ begin addsstringcsstringoptn: curmaxlen := min(taddsstringoptnode(left).curmaxlen + tstringconstnode(right).len,255) - else - internalerror(291220001); end - else curmaxlen := 255; + else + curmaxlen := 255; end else if (left.nodetype = stringconstn) then curmaxlen := min(tstringconstnode(left).len,255) diff --git a/compiler/nset.pas b/compiler/nset.pas index 684eafd79a..c1089cf030 100644 --- a/compiler/nset.pas +++ b/compiler/nset.pas @@ -96,9 +96,22 @@ interface trangenodeclass = class of trangenode; tcasenode = class(tunarynode) - labels : pcaselabel; + strict private + { Number of labels } + flabelcnt: cardinal; + { Number of individual values checked, counting each value in a range + individually (e.g. 0..2 counts as 3). } + flabelcoverage: qword; + fcountsuptodate: boolean; + + function getlabelcnt: cardinal; + function getlabelcoverage: qword; + procedure updatecoverage; + procedure checkordinalcoverage; + public blocks : TFPList; elseblock : tnode; + constructor create(l:tnode);virtual; destructor destroy;override; constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override; @@ -116,6 +129,13 @@ interface procedure addlabel(blockid:longint;l,h : tstringconstnode); overload; procedure addblock(blockid:longint;instr:tnode); procedure addelseblock(instr:tnode); + + property labelcnt: cardinal read getlabelcnt; + property labelcoverage: qword read getlabelcoverage; + protected + flabels : pcaselabel; + public + property labels: pcaselabel read flabels; end; tcasenodeclass = class of tcasenode; @@ -125,11 +145,6 @@ interface crangenode : trangenodeclass = trangenode; ccasenode : tcasenodeclass = tcasenode; - { counts the labels } - function case_count_labels(root : pcaselabel) : longint; - { Returns the true count in a case block, which includes each individual - value in a range (e.g. "0..2" counts as 3) } - function case_true_count(root : pcaselabel) : longint; { searches the highest label } function case_get_max(root : pcaselabel) : tconstexprint; { searches the lowest label } @@ -139,10 +154,11 @@ interface implementation uses - verbose, + verbose,cutils, symconst,symdef,symsym,symtable,defutil,defcmp, htypechk,pass_1, - nadd,nbas,ncnv,nld,cgbase; + nadd,nbas,ncal,ncnv,nld,nutils, + cgbase; {***************************************************************************** @@ -218,6 +234,8 @@ implementation for i:=int64(torddef(psd.elementdef).low) to int64(torddef(psd.elementdef).high) do include(pcs^,i); end; + else + internalerror(2019050516); end; createsetconst:=pcs; end; @@ -428,35 +446,14 @@ implementation Case Helpers *****************************************************************************} - function case_count_labels(root : pcaselabel) : longint; - var - _l : longint; - - procedure count(p : pcaselabel); - begin - inc(_l); - if assigned(p^.less) then - count(p^.less); - if assigned(p^.greater) then - count(p^.greater); - end; - - begin - _l:=0; - count(root); - case_count_labels:=_l; - end; - - - { Returns the true count in a case block, which includes each individual + { labels is the number of case-labels, while cases includes each individual value in a range (e.g. "0..2" counts as 3) } - function case_true_count(root : pcaselabel) : longint; - var - _l : longint; + procedure case_count_labels(root : pcaselabel; out labels, cases: longint); procedure count(p : pcaselabel); begin - inc(_l, (p^._high.svalue - p^._low.svalue) + 1); + inc(labels); + inc(cases, (p^._high.svalue - p^._low.svalue) + 1); if assigned(p^.less) then count(p^.less); if assigned(p^.greater) then @@ -464,13 +461,12 @@ implementation end; begin - _l:=0; + labels:=0; + cases:=0; count(root); - case_true_count:=_l; end; - function case_get_max(root : pcaselabel) : tconstexprint; var hp : pcaselabel; @@ -595,7 +591,7 @@ implementation constructor tcasenode.create(l:tnode); begin inherited create(casen,l); - labels:=nil; + flabels:=nil; blocks:=TFPList.create; elseblock:=nil; end; @@ -607,7 +603,7 @@ implementation hp : pcaseblock; begin elseblock.free; - deletecaselabels(labels); + deletecaselabels(flabels); for i:=0 to blocks.count-1 do begin pcaseblock(blocks[i])^.statement.free; @@ -629,7 +625,9 @@ implementation blocks:=TFPList.create; for i:=0 to cnt-1 do addblock(i,ppuloadnode(ppufile)); - labels:=ppuloadcaselabel(ppufile); + flabels:=ppuloadcaselabel(ppufile); + { we don't save/restore the label counts, but recalculate them if needed } + fcountsuptodate:=false; end; @@ -642,7 +640,8 @@ implementation ppufile.putlongint(blocks.count); for i:=0 to blocks.count-1 do ppuwritenode(ppufile,pcaseblock(blocks[i])^.statement); - ppuwritecaselabel(ppufile,labels); + ppuwritecaselabel(ppufile,flabels); + { we don't save/restore the label counts, but recalculate them if needed } end; @@ -684,6 +683,10 @@ implementation if assigned(elseblock) then typecheckpass(elseblock); + if not codegenerror and + is_ordinal(left.resultdef) then + checkordinalcoverage; + resultdef:=voidtype; end; @@ -724,7 +727,7 @@ implementation begin result:=tfpobjectlist.create(true); result.count:=blocks.count; - add_label_to_blockid_list(result,labels); + add_label_to_blockid_list(result,flabels); end; function makeifblock(elseblock : tnode): tnode; @@ -787,7 +790,7 @@ implementation { Load caseexpr into temp var if complex. } { No need to do this for ordinal, because } { in that case caseexpr is generated once } - if (labels^.label_type = ltConstString) and (not valid_for_addr(left, false)) and + if (flabels^.label_type = ltConstString) and (not valid_for_addr(left, false)) and (blocks.count > 0) then begin init_block := internalstatements(stmt); @@ -830,7 +833,7 @@ implementation exit; end; - if (labels^.label_type = ltConstString) then + if (flabels^.label_type = ltConstString) then begin if_node:=makeifblock(elseblock); @@ -854,41 +857,41 @@ implementation case blocks.count of 2: begin - if boolean(qword(labels^._low))=false then + if boolean(qword(flabels^._low))=false then begin - node_thenblock:=pcaseblock(blocks[labels^.greater^.blockid])^.statement; - node_elseblock:=pcaseblock(blocks[labels^.blockid])^.statement; - pcaseblock(blocks[labels^.greater^.blockid])^.statement:=nil; + node_thenblock:=pcaseblock(blocks[flabels^.greater^.blockid])^.statement; + node_elseblock:=pcaseblock(blocks[flabels^.blockid])^.statement; + pcaseblock(blocks[flabels^.greater^.blockid])^.statement:=nil; end else begin - node_thenblock:=pcaseblock(blocks[labels^.blockid])^.statement; - node_elseblock:=pcaseblock(blocks[labels^.less^.blockid])^.statement; - pcaseblock(blocks[labels^.less^.blockid])^.statement:=nil; + node_thenblock:=pcaseblock(blocks[flabels^.blockid])^.statement; + node_elseblock:=pcaseblock(blocks[flabels^.less^.blockid])^.statement; + pcaseblock(blocks[flabels^.less^.blockid])^.statement:=nil; end; - pcaseblock(blocks[labels^.blockid])^.statement:=nil; + pcaseblock(blocks[flabels^.blockid])^.statement:=nil; end; 1: begin - if labels^._low=labels^._high then + if flabels^._low=flabels^._high then begin - if boolean(qword(labels^._low))=false then + if boolean(qword(flabels^._low))=false then begin node_thenblock:=elseblock; - node_elseblock:=pcaseblock(blocks[labels^.blockid])^.statement; + node_elseblock:=pcaseblock(blocks[flabels^.blockid])^.statement; end else begin - node_thenblock:=pcaseblock(blocks[labels^.blockid])^.statement; + node_thenblock:=pcaseblock(blocks[flabels^.blockid])^.statement; node_elseblock:=elseblock; end; - pcaseblock(blocks[labels^.blockid])^.statement:=nil; + pcaseblock(blocks[flabels^.blockid])^.statement:=nil; elseblock:=nil; end else begin - result:=pcaseblock(blocks[labels^.blockid])^.statement; - pcaseblock(blocks[labels^.blockid])^.statement:=nil; + result:=pcaseblock(blocks[flabels^.blockid])^.statement; + pcaseblock(blocks[flabels^.blockid])^.statement:=nil; elseblock:=nil; exit; end; @@ -909,7 +912,7 @@ implementation result:=nil; if left.nodetype=ordconstn then begin - tmp:=labels; + tmp:=flabels; { check all case labels until we find one that fits } while assigned(tmp) do begin @@ -937,6 +940,12 @@ implementation { no else block, so there is no code to execute at all } result:=cnothingnode.create; end; + if assigned(elseblock) and + has_no_code(elseblock) then + begin + elseblock.free; + elseblock:=nil; + end; end; @@ -950,10 +959,10 @@ implementation n.elseblock:=elseblock.dogetcopy else n.elseblock:=nil; - if assigned(labels) then - n.labels:=copycaselabel(labels) + if assigned(flabels) then + n.flabels:=copycaselabel(flabels) else - n.labels:=nil; + n.flabels:=nil; if assigned(blocks) then begin n.blocks:=TFPList.create; @@ -966,6 +975,9 @@ implementation end else n.blocks:=nil; + n.fcountsuptodate:=fcountsuptodate; + n.flabelcnt:=flabelcnt; + n.flabelcoverage:=flabelcoverage; dogetcopy:=n; end; @@ -1039,7 +1051,7 @@ implementation begin result := inherited docompare(p) and - caselabelsequal(labels,tcasenode(p).labels) and + caselabelsequal(flabels,tcasenode(p).flabels) and caseblocksequal(blocks,tcasenode(p).blocks) and elseblock.isequal(tcasenode(p).elseblock); end; @@ -1064,6 +1076,117 @@ implementation end; + function tcasenode.getlabelcnt: cardinal; + begin + if not fcountsuptodate then + updatecoverage; + result:=flabelcnt; + end; + + + function tcasenode.getlabelcoverage: qword; + begin + if not fcountsuptodate then + updatecoverage; + result:=flabelcoverage; + end; + + + procedure tcasenode.updatecoverage; + + var + isord: boolean; + + procedure count(p : pcaselabel); + begin + inc(flabelcnt); + if isord then + inc(flabelcoverage, (p^._high.svalue - p^._low.svalue) + 1); + if assigned(p^.less) then + count(p^.less); + if assigned(p^.greater) then + count(p^.greater); + end; + + begin + isord:=is_ordinal(left.resultdef); + flabelcnt:=0; + flabelcoverage:=0; + count(flabels); + fcountsuptodate:=true; + end; + + + procedure tcasenode.checkordinalcoverage; + + function orddefspansfullrange(def: torddef): boolean; + var + packedbitsize: cardinal; + dummy: longint; + val: qword; + begin + result:=false; + packedbitsize:=def.packedbitsize; + if ((packedbitsize mod 8) <> 0) or + not ispowerof2(packedbitsize div 8,dummy) then + exit; + dec(packedbitsize); + if is_signed(def) then + begin + if def.low<>(-(int64(1) shl packedbitsize)) then + exit; + if def.high<>((int64(1) shl packedbitsize)-1) then + exit; + end + else + begin + if def.low<>0 then + exit; + val:=qword(1) shl packedbitsize; + val:=(val-1)+val; + if def.high<>val then + exit; + end; + result:=true; + end; + + var + lv, hv, typcount: tconstexprint; + begin + { Check label type coverage for enumerations and small types } + getrange(left.resultdef,lv,hv); + typcount:=hv.svalue-lv.svalue+1; + if not assigned(elseblock) then + begin + { unless cs_check_all_case_coverage is set, only check for enums, booleans and + subrange types different from the default ones } + if (cs_check_all_case_coverage in current_settings.localswitches) or + (is_enum(left.resultdef) or + is_boolean(left.resultdef) or + not orddefspansfullrange(torddef(left.resultdef))) and + (labelcoverage<typcount) then + begin + { labels for some values of the operand are missing, and no else block is present } + if not(m_iso in current_settings.modeswitches) then + begin + cgmessage(cg_w_case_incomplete); + { in Extended Pascal, this is a dynamic violation error if it actually happens } + if (m_extpas in current_settings.modeswitches) then + elseblock:=ccallnode.createintern('fpc_rangeerror',nil); + end + else + { this is an error in ISO Pascal } + message(cg_e_case_incomplete); + end + end + else if labelcoverage=typcount then + begin + { labels for all values of the operand are present, but an extra else block is present } + MessagePos(elseblock.fileinfo, cg_w_unreachable_code); + end; + end; + + procedure tcasenode.addlabel(blockid:longint;const l,h : TConstExprInt); var hcaselabel : pcaselabel; @@ -1118,7 +1241,8 @@ implementation hcaselabel^.label_type:=ltOrdinal; hcaselabel^._low:=l; hcaselabel^._high:=h; - insertlabel(labels); + insertlabel(flabels); + fcountsuptodate:=false; end; procedure tcasenode.addlabel(blockid: longint; l, h: tstringconstnode); @@ -1158,7 +1282,7 @@ implementation hcaselabel^._low_str := tstringconstnode(l.getcopy); hcaselabel^._high_str := tstringconstnode(h.getcopy); - insertlabel(labels); + insertlabel(flabels); end; end. diff --git a/compiler/nutils.pas b/compiler/nutils.pas index 9600ea5a36..8db1ebda54 100644 --- a/compiler/nutils.pas +++ b/compiler/nutils.pas @@ -219,6 +219,8 @@ implementation result := foreachnode(procmethod,pcaseblock(tcasenode(n).blocks[i])^.statement,f,arg) or result; result := foreachnode(procmethod,tcasenode(n).elseblock,f,arg) or result; end; + else + ; end; if n.inheritsfrom(tbinarynode) then begin @@ -249,6 +251,8 @@ implementation { result is already false fen_false: result := false; } + else + ; end; if (procmethod=pm_postprocess) or (procmethod=pm_postandagain) then result:=process_children(result); @@ -264,6 +268,8 @@ implementation end; fen_true: result := true; + else + ; end; end; end; @@ -316,6 +322,8 @@ implementation result := foreachnodestatic(procmethod,pcaseblock(tcasenode(n).blocks[i])^.statement,f,arg) or result; result := foreachnodestatic(procmethod,tcasenode(n).elseblock,f,arg) or result; end; + else + ; end; if n.inheritsfrom(tbinarynode) then begin @@ -346,6 +354,8 @@ implementation { result is already false fen_false: result := false; } + else + ; end; if (procmethod=pm_postprocess) or (procmethod=pm_postandagain) then result:=process_children(result); @@ -361,6 +371,8 @@ implementation end; fen_true: result := true; + else + ; end; end; end; @@ -1039,6 +1051,8 @@ implementation if(p.expectloc in [LOC_CFPUREGISTER,LOC_FPUREGISTER]) then inc(result); end; + else + ; end; end; @@ -1141,6 +1155,8 @@ implementation p1:=tnode(twithsymtable(st).withrefnode).getcopy; ObjectSymtable : p1:=load_self_node; + else + ; end; end end @@ -1330,7 +1346,6 @@ implementation result:=true; exit; end; - result:=false; case n.nodetype of nothingn: begin @@ -1350,6 +1365,8 @@ implementation until not(result) or not assigned(n); exit; end; + else + result:=false; end; end; @@ -1447,6 +1464,8 @@ implementation typeconvn: if ttypeconvnode(n^).retains_value_location then result:=actualtargetnode(@ttypeconvnode(n^).left); + else + ; end; end; diff --git a/compiler/ogbase.pas b/compiler/ogbase.pas index 4490cff452..f244d4786a 100644 --- a/compiler/ogbase.pas +++ b/compiler/ogbase.pas @@ -2631,6 +2631,8 @@ implementation end; end; end; + else + internalerror(2019050510); end; end; end; diff --git a/compiler/ogcoff.pas b/compiler/ogcoff.pas index cbc7c59ffe..6b72b6f28a 100644 --- a/compiler/ogcoff.pas +++ b/compiler/ogcoff.pas @@ -933,6 +933,8 @@ const pemagic : array[0..3] of byte = ( RELOC_ABSOLUTE: address_size:=8; {$endif cpu64bitaddr} + else + ; end; address:=0; diff --git a/compiler/ogelf.pas b/compiler/ogelf.pas index 7fb907c146..8f136d324a 100644 --- a/compiler/ogelf.pas +++ b/compiler/ogelf.pas @@ -777,7 +777,9 @@ implementation elfsym.st_info:=elfsym.st_info or STT_TLS; AT_GNU_IFUNC: elfsym.st_info:=elfsym.st_info or STT_GNU_IFUNC; - { other types are implicitly mapped to STT_NOTYPE } + { other types are implicitly mapped to STT_NOTYPE } + else + ; end; end; if objsym.bind<>AB_COMMON then diff --git a/compiler/ogmacho.pas b/compiler/ogmacho.pas index 7aa14b3ab2..94f80c7d13 100644 --- a/compiler/ogmacho.pas +++ b/compiler/ogmacho.pas @@ -828,6 +828,8 @@ uses symList.Insert(iUndef, s); inc(iUndef); end; + loc_Notused: + ; end; inc(symStrLen, length(s.Name)+1 ); end; diff --git a/compiler/ogomf.pas b/compiler/ogomf.pas index a1af3b6a46..7e34aaf46d 100644 --- a/compiler/ogomf.pas +++ b/compiler/ogomf.pas @@ -1733,11 +1733,15 @@ implementation exit; end; ftmExternalIndexNoDisp: - if (Fixup.TargetDatum<1) or (Fixup.TargetDatum>ExtDefs.Count) then - begin - InputError('External symbol name index in EI(<symbol name>) fixup target is out of range'); - exit; - end; + begin + if (Fixup.TargetDatum<1) or (Fixup.TargetDatum>ExtDefs.Count) then + begin + InputError('External symbol name index in EI(<symbol name>) fixup target is out of range'); + exit; + end; + end; + else + ; end; { range check frame datum } @@ -1760,6 +1764,8 @@ implementation InputError('External symbol name index in EI(<symbol name>) fixup frame is out of range'); exit; end; + else + ; end; if Fixup.TargetMethod in [ftmExternalIndex,ftmExternalIndexNoDisp] then @@ -1802,6 +1808,8 @@ implementation fmSelfRelative: RelocType:=RELOC_FARPTR48_RELATIVEOFFSET; end; + else + ; end; if RelocType=RELOC_NONE then begin @@ -1867,6 +1875,8 @@ implementation fmSelfRelative: RelocType:=RELOC_FARPTR48_RELATIVEOFFSET; end; + else + ; end; if RelocType=RELOC_NONE then begin @@ -1932,6 +1942,8 @@ implementation fmSelfRelative: RelocType:=RELOC_FARPTR48_RELATIVEOFFSET; end; + else + ; end; if RelocType=RELOC_NONE then begin diff --git a/compiler/omfbase.pas b/compiler/omfbase.pas index 9c182cd663..a41766b9c4 100644 --- a/compiler/omfbase.pas +++ b/compiler/omfbase.pas @@ -2433,8 +2433,6 @@ implementation AThreads.TargetThread[ThreadNumber].TargetMethod:=TargetMethod; AThreads.TargetThread[ThreadNumber].Initialized:=True; end; - else - internalerror(2018053001); end; end; diff --git a/compiler/optdfa.pas b/compiler/optdfa.pas index 1d450413a0..737fa6ab18 100644 --- a/compiler/optdfa.pas +++ b/compiler/optdfa.pas @@ -136,6 +136,8 @@ unit optdfa; else DFASetInclude(pdfainfo(arg)^.use^,n.optinfo^.index); end; + else + ; end; result:=fen_false; end; @@ -815,6 +817,8 @@ unit optdfa; {$endif dummy} end; end; + else + ; end; end; diff --git a/compiler/options.pas b/compiler/options.pas index 69ef513984..fa78e6fcef 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -2105,6 +2105,11 @@ begin exclude(init_settings.moduleswitches,cs_support_c_operators) else include(init_settings.moduleswitches,cs_support_c_operators); + 'C': + If UnsetBool(More, j, opt, false) then + exclude(init_settings.localswitches,cs_check_all_case_coverage) + else + include(init_settings.localswitches,cs_check_all_case_coverage); 'd' : //an alternative to -Mdelphi SetCompileMode('DELPHI',true); 'e' : @@ -4178,6 +4183,8 @@ begin if not option.FPUSetExplicitly then init_settings.fputype:=fpu_ssse3; end; + else + ; end; {$endif i386} @@ -4203,6 +4210,8 @@ begin if not option.OptCPUSetExplicitly then init_settings.optimizecputype:=cpu_armv5t; end; + else + ; end; { ARMHF defaults } @@ -4329,6 +4338,8 @@ begin if not option.FPUSetExplicitly then init_settings.fputype:=fpu_soft; end; + else + ; end; {$endif mipsel} {$ifdef m68k} @@ -4486,6 +4497,8 @@ begin set_system_compvar('_CALL_ELF','1'); abi_powerpc_elfv2: set_system_compvar('_CALL_ELF','2'); + else + ; end; {$endif} diff --git a/compiler/optloop.pas b/compiler/optloop.pas index f33c0e40cd..1da515b247 100644 --- a/compiler/optloop.pas +++ b/compiler/optloop.pas @@ -275,6 +275,8 @@ unit optloop; end; typeconvn: result:=is_loop_invariant(loop,ttypeconvnode(expr).left); + else + ; end; end; @@ -454,6 +456,8 @@ unit optloop; result:=fen_norecurse_false; end; end; + else + ; end; end; diff --git a/compiler/opttail.pas b/compiler/opttail.pas index fc3600ad4a..4149f6aebf 100644 --- a/compiler/opttail.pas +++ b/compiler/opttail.pas @@ -176,6 +176,8 @@ unit opttail; end; blockn: result:=find_and_replace_tailcalls(tblocknode(n).left); + else + ; end; end; diff --git a/compiler/optutils.pas b/compiler/optutils.pas index 6fefc1004d..889643cfe6 100644 --- a/compiler/optutils.pas +++ b/compiler/optutils.pas @@ -322,6 +322,8 @@ unit optutils; tryfinallyn, onn: internalerror(2007050501); + else + ; end; end; @@ -358,7 +360,7 @@ unit optutils; function SetExecutionWeight(var n: tnode; arg: pointer): foreachnoderesult; var - Weight : longint; + Weight, CaseWeight : longint; i : Integer; begin Result:=fen_false; @@ -368,10 +370,11 @@ unit optutils; casen: begin CalcExecutionWeights(tcasenode(n).left,Weight); + CaseWeight:=max(Weight div tcasenode(n).labelcnt,1); for i:=0 to tcasenode(n).blocks.count-1 do - CalcExecutionWeights(pcaseblock(tcasenode(n).blocks[i])^.statement,Weight div case_count_labels(tcasenode(n).labels)); + CalcExecutionWeights(pcaseblock(tcasenode(n).blocks[i])^.statement,CaseWeight); - CalcExecutionWeights(tcasenode(n).elseblock,Weight div case_count_labels(tcasenode(n).labels)); + CalcExecutionWeights(tcasenode(n).elseblock,CaseWeight); Result:=fen_norecurse_false; end; whilerepeatn: @@ -387,6 +390,8 @@ unit optutils; CalcExecutionWeights(tifnode(n).t1,Weight div 2); Result:=fen_norecurse_false; end; + else + ; end; n.optinfo^.executionweight:=Weight; end; diff --git a/compiler/optvirt.pas b/compiler/optvirt.pas index ec73cf0413..728525698f 100644 --- a/compiler/optvirt.pas +++ b/compiler/optvirt.pas @@ -721,6 +721,8 @@ unit optvirt; { static reference to FPC_ABSTRACTERROR } classdevirtinfo.addstaticmethod(i,'FPC_ABSTRACTERROR'); end; + else + ; end; end; diff --git a/compiler/parabase.pas b/compiler/parabase.pas index f18ea06bfd..4fd2db4fd4 100644 --- a/compiler/parabase.pas +++ b/compiler/parabase.pas @@ -300,6 +300,10 @@ implementation newloc.reference.offset:=location^.reference.offset; newloc.reference.alignment:=alignment; end; + LOC_VOID: + ; + else + internalerror(2019050705); end; end; diff --git a/compiler/paramgr.pas b/compiler/paramgr.pas index 739f22cc3d..7f228fa5f0 100644 --- a/compiler/paramgr.pas +++ b/compiler/paramgr.pas @@ -271,6 +271,8 @@ implementation push_size:=def.size; end; end; + else + ; end; end; @@ -370,6 +372,8 @@ implementation if getsupreg(paraloc^.register)<first_mm_imreg then cg.getcpuregister(list,paraloc^.register); end; + else + ; end; end; @@ -524,6 +528,8 @@ implementation newparaloc^.reference.offset:=href.offset; end; end; + else + ; end; paraloc:=paraloc^.next; end; diff --git a/compiler/parser.pas b/compiler/parser.pas index b1c4b0ab8b..a1f22dac71 100644 --- a/compiler/parser.pas +++ b/compiler/parser.pas @@ -161,6 +161,8 @@ implementation end; end; {$endif i8086} + else + ; end; end; diff --git a/compiler/pbase.pas b/compiler/pbase.pas index 65d6848dbf..9ab37e790a 100644 --- a/compiler/pbase.pas +++ b/compiler/pbase.pas @@ -391,6 +391,8 @@ implementation tokentoconsume:=_STRING; end; end + else + ; end; end else diff --git a/compiler/pdecl.pas b/compiler/pdecl.pas index fcb19c2c3d..6b764acf62 100644 --- a/compiler/pdecl.pas +++ b/compiler/pdecl.pas @@ -580,8 +580,6 @@ implementation objecttype:=odt_interfacecorba; it_interfacejava: objecttype:=odt_interfacejava; - else - internalerror(2010122611); end; _DISPINTERFACE : objecttype:=odt_dispinterface; diff --git a/compiler/pdecobj.pas b/compiler/pdecobj.pas index 5d906b84fe..64e948a106 100644 --- a/compiler/pdecobj.pas +++ b/compiler/pdecobj.pas @@ -522,6 +522,8 @@ implementation odt_objcclass,odt_objcprotocol,odt_objccategory: get_objc_class_or_protocol_external_status(current_objectdef); odt_helper: ; // nothing + else + ; end; end; @@ -640,6 +642,8 @@ implementation Message(type_e_helper_type_expected); childof:=nil; end; + else + ; end; end; hasparentdefined:=true; @@ -663,6 +667,8 @@ implementation { inherit from TObject by default for compatibility } if current_objectdef<>java_jlobject then childof:=class_tobject; + else + ; end; end; @@ -746,8 +752,6 @@ implementation begin if not is_objectpascal_helper(current_structdef) then Internalerror(2011021103); - if helpertype=ht_none then - Internalerror(2011021001); consume(_FOR); single_type(hdef,[stoParseClassParent]); @@ -760,6 +764,8 @@ implementation Message(type_e_record_type_expected); ht_type: Message1(type_e_type_id_expected,hdef.typename); + else + internalerror(2019050532); end; end else @@ -805,6 +811,8 @@ implementation parent helper } check_inheritance_record_type_helper(hdef); end; + else + internalerror(2019050531); end; end; @@ -1448,6 +1456,8 @@ implementation else if (current_objectdef.objname^='FPCBASEPROCVARTYPE') then java_procvarbase:=current_objectdef; end; + else + ; end; end; if (current_module.modulename^='OBJCBASE') then @@ -1456,6 +1466,8 @@ implementation odt_objcclass: if (current_objectdef.objname^='Protocol') then objc_protocoltype:=current_objectdef; + else + ; end; end; end; diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index fe0906a156..d600583fef 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -439,6 +439,8 @@ implementation if is_open_string(hdef) then hdef:=cshortstringtype; end; + else + ; end; end; if (target_info.system in [system_powerpc_morphos,system_m68k_amiga]) then @@ -2118,6 +2120,8 @@ procedure pd_syscall(pd:tabstractprocdef); else include(pd.procoptions,get_default_syscall); end; + else + internalerror(2019050526); end; end; @@ -2926,6 +2930,8 @@ const end else exit; + else + ; end; end; @@ -3206,6 +3212,8 @@ const begin pd.aliasnames.insert(target_info.Cprefix+pd.cplusplusmangledname); end; + else + ; end; { prevent adding the alias a second time } include(pd.procoptions,po_has_public_name); diff --git a/compiler/pdecvar.pas b/compiler/pdecvar.pas index 9d04eac1d4..597249fd71 100644 --- a/compiler/pdecvar.pas +++ b/compiler/pdecvar.pas @@ -726,6 +726,8 @@ implementation p.default:=0; realconstn: p.default:=longint(single(trealconstnode(pt).value_real)); + else if not codegenerror then + internalerror(2019050525); end; pt.free; end; diff --git a/compiler/pexports.pas b/compiler/pexports.pas index d789977fdd..85892db621 100644 --- a/compiler/pexports.pas +++ b/compiler/pexports.pas @@ -238,6 +238,8 @@ implementation internalerror(2009092602); end; end; + else + internalerror(2019050532); end end else diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index bf6516750a..979e8af74b 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -968,6 +968,8 @@ implementation { We are calling a member } maybe_load_methodpointer:=true; end; + else + ; end; end; end; @@ -2012,6 +2014,7 @@ implementation { shouldn't be used that often, so the extra overhead is ok to save stack space } dispatchstring : ansistring; + autoderef, erroroutp1, allowspecialize, isspecialize, @@ -2076,6 +2079,8 @@ implementation cpointerdef.getreusable(tfiledef(p1.resultdef).typedfiledef))); typecheckpass(p1); end; + else + internalerror(2019050530); end; end else if not(p1.resultdef.typ in [pointerdef,undefineddef]) then @@ -2238,6 +2243,7 @@ implementation end else isspecialize:=false; + autoderef:=false; if (p1.resultdef.typ=pointerdef) and (m_autoderef in current_settings.modeswitches) and { don't auto-deref objc.id, because then the code @@ -2246,6 +2252,7 @@ implementation begin p1:=cderefnode.create(p1); do_typecheckpass(p1); + autoderef:=true; end; { procvar.<something> can never mean anything so always try to call it in case it returns a record/object/... } @@ -2362,8 +2369,6 @@ implementation cst_longstring: { let's see when someone stumbles upon this...} internalerror(201301111); - else - internalerror(2013112903); end; if try_type_helper(p1,strdef) then goto skippointdefcheck; @@ -2669,7 +2674,20 @@ implementation end; else begin - found:=try_type_helper(p1,nil); + if autoderef then + begin + { always try with the not dereferenced node } + p2:=tderefnode(p1).left; + found:=try_type_helper(p2,nil); + if found then + begin + tderefnode(p1).left:=nil; + p1.destroy; + p1:=p2; + end; + end + else + found:=try_type_helper(p1,nil); if not found then begin if p1.resultdef.typ<>undefineddef then @@ -4129,6 +4147,8 @@ implementation specializen: srsym:=tspecializenode(n).sym; { TODO : handle const nodes } + else + ; end; result:=assigned(srsym); end; @@ -4455,6 +4475,8 @@ implementation p1:=casnode.create(p1,p2); _OP_IS: p1:=cisnode.create(p1,p2); + else + internalerror(2019050528); end; end; _OP_IN : @@ -4493,6 +4515,8 @@ implementation p1:=cassignmentnode.create(p1,p2); _NE : p1:=caddnode.create(unequaln,p1,p2); + else + internalerror(2019050529); end; p1.fileinfo:=filepos; end diff --git a/compiler/pgenutil.pas b/compiler/pgenutil.pas index 4e52761d73..e303c565fd 100644 --- a/compiler/pgenutil.pas +++ b/compiler/pgenutil.pas @@ -688,6 +688,8 @@ uses for i:=0 to st.deflist.count-1 do unset_forwarddef(tdef(st.deflist[i])); end; + else + ; end; end; @@ -1303,6 +1305,8 @@ uses odt_interfacejava, odt_dispinterface: constraintdata.interfaces.add(def); + else + ; end; end; end; @@ -1780,6 +1784,8 @@ uses specialization_done(state); end; + else + ; end; end; diff --git a/compiler/pkgutil.pas b/compiler/pkgutil.pas index 1c62bc8924..f1e3dc066b 100644 --- a/compiler/pkgutil.pas +++ b/compiler/pkgutil.pas @@ -109,6 +109,8 @@ implementation objectdef, recorddef: exportabstractrecorddef(tabstractrecorddef(ttypesym(sym).typedef),tsymtable(arg)); + else + ; end; end; procsym: @@ -122,6 +124,8 @@ implementation begin varexport(tsym(sym).mangledname); end; + else + ; end; end; @@ -176,6 +180,8 @@ implementation recorddef, objectdef: exportabstractrecorddef(tabstractrecorddef(def),symtable); + else + ; end; end; diff --git a/compiler/powerpc/agppcmpw.pas b/compiler/powerpc/agppcmpw.pas index 183c27ee1c..17bec4693b 100644 --- a/compiler/powerpc/agppcmpw.pas +++ b/compiler/powerpc/agppcmpw.pas @@ -305,12 +305,18 @@ interface case o of A_BCCTR,A_BCCTRL: tempstr := 'ctr'; A_BCLR,A_BCLRL: tempstr := 'lr'; + else + ; end; case o of A_BL,A_BLA,A_BCL,A_BCLA,A_BCCTRL,A_BCLRL: tempstr := tempstr+'l'; + else + ; end; case o of A_BA,A_BLA,A_BCA,A_BCLA: tempstr:=tempstr+'a'; + else + ; end; branchmode := tempstr; end; @@ -914,6 +920,8 @@ interface until false; writer.AsmLn; end; + else + internalerror(2019050950); end; end; diff --git a/compiler/powerpc/aoptcpu.pas b/compiler/powerpc/aoptcpu.pas index 1bb5b44238..55ae8b671d 100644 --- a/compiler/powerpc/aoptcpu.pas +++ b/compiler/powerpc/aoptcpu.pas @@ -218,6 +218,8 @@ Implementation if taicpu(next1).oper[l1]^.ref^.index = taicpu(p).oper[0]^.reg then taicpu(next1).oper[l1]^.ref^.index := taicpu(p).oper[1]^.reg; end; + else + ; end; asml.remove(p); p.free; @@ -286,6 +288,8 @@ Implementation taicpu(p).loadconst(2,(32-taicpu(p).oper[2]^.val) and 31); result := true; end; + else + internalerror(2019050941); end; end; A_RLWINM: @@ -361,8 +365,12 @@ Implementation end; end; end; + else + ; end; end; + else + ; end; end; @@ -464,6 +472,8 @@ Implementation taicpu(p).opercnt := 3; end; end; + else + ; end; // change "integer operation with destination reg" followed by a @@ -492,6 +502,8 @@ Implementation result := true; end; end; + else + ; end; end; diff --git a/compiler/powerpc/cgcpu.pas b/compiler/powerpc/cgcpu.pas index 1c984bebc3..3f11216a78 100644 --- a/compiler/powerpc/cgcpu.pas +++ b/compiler/powerpc/cgcpu.pas @@ -407,6 +407,8 @@ const list.concat(taicpu.op_reg_reg(A_NOT,dst,src)); OP_AND: a_load_reg_reg(list,size,size,src,dst); + else + ; end; exit; end @@ -472,6 +474,8 @@ const list.concat(taicpu.op_reg_reg_const(A_SRAWI,dst,src,l1)); list.concat(taicpu.op_reg_reg(A_ADDZE,dst,dst)); end; + else + ; end; exit; end @@ -807,6 +811,8 @@ const reference_reset_base(href,NR_STACK_POINTER_REG,LA_LR_AIX,ctempposinvalid,4,[]); abi_powerpc_sysv: reference_reset_base(href,NR_STACK_POINTER_REG,LA_LR_SYSV,ctempposinvalid,4,[]); + else + internalerror(2019050940); end; list.concat(taicpu.op_reg_ref(A_STW,NR_R0,href)); if not(cs_profile in current_settings.moduleswitches) then @@ -1020,6 +1026,8 @@ const reference_reset_base(href,NR_STACK_POINTER_REG,LA_LR_AIX,ctempposinvalid,4,[]); abi_powerpc_sysv: reference_reset_base(href,NR_STACK_POINTER_REG,LA_LR_SYSV,ctempposinvalid,4,[]); + else + internalerror(2019050939); end; a_reg_alloc(list,NR_R0); list.concat(taicpu.op_reg_ref(A_LWZ,NR_R0,href)); diff --git a/compiler/powerpc/cpubase.pas b/compiler/powerpc/cpubase.pas index 43687af816..a10bcdda6b 100644 --- a/compiler/powerpc/cpubase.pas +++ b/compiler/powerpc/cpubase.pas @@ -429,6 +429,8 @@ implementation case o of A_B,A_BA,A_BL,A_BLA,A_BC,A_BCA,A_BCL,A_BCLA,A_BCCTR,A_BCCTRL,A_BCLR, A_BCLRL,A_TW,A_TWI: is_calljmp:=true; + else + ; end; end; diff --git a/compiler/powerpc/cpupara.pas b/compiler/powerpc/cpupara.pas index 28ec1ab1be..f37cc1db42 100644 --- a/compiler/powerpc/cpupara.pas +++ b/compiler/powerpc/cpupara.pas @@ -249,6 +249,8 @@ unit cpupara; result:=not is_smallset(def); stringdef : result:=tstringdef(def).stringtype in [st_shortstring,st_longstring]; + else + ; end; end; diff --git a/compiler/powerpc/nppcadd.pas b/compiler/powerpc/nppcadd.pas index 70f21845fe..4905816734 100644 --- a/compiler/powerpc/nppcadd.pas +++ b/compiler/powerpc/nppcadd.pas @@ -226,6 +226,8 @@ interface begin cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags,truelabel); end; + else + internalerror(2019050947); end; end; @@ -254,6 +256,8 @@ interface cg.a_jmp_flags(current_asmdata.CurrAsmList,getresflags,truelabel); cg.a_jmp_always(current_asmdata.CurrAsmList,falselabel); end; + else + internalerror(2019050946); end; end; @@ -627,6 +631,8 @@ interface second_addfloat; exit; end; + else + ; end; { defaults } @@ -727,6 +733,8 @@ interface begin emit_compare(unsigned); end; + else + internalerror(2019050945); end; end else @@ -787,6 +795,8 @@ interface cg.a_call_name(current_asmdata.CurrAsmList,'FPC_OVERFLOW',false); cg.a_label(current_asmdata.CurrAsmList,hl); end; + else + internalerror(2019050944); end; end; end; diff --git a/compiler/powerpc/nppcmat.pas b/compiler/powerpc/nppcmat.pas index 0202eccae6..d61e395cb2 100644 --- a/compiler/powerpc/nppcmat.pas +++ b/compiler/powerpc/nppcmat.pas @@ -478,6 +478,8 @@ implementation left.location.reference,src1); end; end; + else + internalerror(2019050947); end; { choose appropriate operand } if left.resultdef.typ <> floatdef then diff --git a/compiler/powerpc/rappcgas.pas b/compiler/powerpc/rappcgas.pas index e8667355a5..83f5b61c08 100644 --- a/compiler/powerpc/rappcgas.pas +++ b/compiler/powerpc/rappcgas.pas @@ -254,6 +254,8 @@ Unit rappcgas; end; end; end; + else + ; end; Consume(AS_RPAREN); if actasmtoken=AS_AT then diff --git a/compiler/powerpc64/cgcpu.pas b/compiler/powerpc64/cgcpu.pas index 9b0450614a..816c8f4a0c 100644 --- a/compiler/powerpc64/cgcpu.pas +++ b/compiler/powerpc64/cgcpu.pas @@ -1047,6 +1047,8 @@ begin LOC_MMREGISTER, LOC_CMMREGISTER: { not supported } internalerror(2006041801); + else + ; end; end; @@ -1063,6 +1065,8 @@ begin LOC_MMREGISTER, LOC_CMMREGISTER: { not supported } internalerror(2006041802); + else + ; end; end; @@ -1708,6 +1712,8 @@ procedure tcgppc.a_load_store(list: TAsmList; op: tasmop; reg: tregister; end; ref.offset := (ref.offset div 4) * 4; end; + else + ; end; end; diff --git a/compiler/powerpc64/cpubase.pas b/compiler/powerpc64/cpubase.pas index 732c608306..16745cdedf 100644 --- a/compiler/powerpc64/cpubase.pas +++ b/compiler/powerpc64/cpubase.pas @@ -429,6 +429,8 @@ begin A_B, A_BA, A_BL, A_BLA, A_BC, A_BCA, A_BCL, A_BCLA, A_BCCTR, A_BCCTRL, A_BCLR, A_BF, A_BT, A_BCLRL, A_TW, A_TWI: is_calljmp := true; + else + ; end; end; diff --git a/compiler/powerpc64/cpupara.pas b/compiler/powerpc64/cpupara.pas index e545eb791b..b59ecd07bf 100644 --- a/compiler/powerpc64/cpupara.pas +++ b/compiler/powerpc64/cpupara.pas @@ -214,6 +214,8 @@ begin result := not is_smallset(def); stringdef: result := tstringdef(def).stringtype in [st_shortstring, st_longstring]; + else + ; end; end; @@ -266,6 +268,8 @@ function tcpuparamanager.ret_in_param(def: tdef; pd: tabstractprocdef): boolean; result:=def.size>8; recorddef: result:=true; + else + ; end; end; { Darwin: if completely passed in registers -> returned by registers; @@ -275,13 +279,19 @@ function tcpuparamanager.ret_in_param(def: tdef; pd: tabstractprocdef): boolean; begin case def.typ of recorddef: - { todo: fix once the Darwin/ppc64 abi is fully implemented, as it - requires individual fields to be passed in individual registers, - so a record with 9 bytes may need to be passed via memory } - if def.size>8*sizeof(aint) then - result:=true; + begin + { todo: fix once the Darwin/ppc64 abi is fully implemented, as it + requires individual fields to be passed in individual registers, + so a record with 9 bytes may need to be passed via memory } + if def.size>8*sizeof(aint) then + result:=true; + end; + else + ; end; end; + else + internalerror(2019051030); end; end; diff --git a/compiler/powerpc64/nppcadd.pas b/compiler/powerpc64/nppcadd.pas index 6d093e9307..c665ad791b 100644 --- a/compiler/powerpc64/nppcadd.pas +++ b/compiler/powerpc64/nppcadd.pas @@ -195,6 +195,8 @@ begin second_addfloat; exit; end; + else + ;; end; { defaults } @@ -291,6 +293,8 @@ begin emit_compare(unsigned); end; + else + internalerror(2019051032); end; end else @@ -353,6 +357,8 @@ begin cg.a_call_name(current_asmdata.CurrAsmList, 'FPC_OVERFLOW',false); cg.a_label(current_asmdata.CurrAsmList, hl); end; + else + internalerror(2019051031); end; end; end; diff --git a/compiler/powerpc64/rappcgas.pas b/compiler/powerpc64/rappcgas.pas index 5ca16a7952..6312e6ae8c 100644 --- a/compiler/powerpc64/rappcgas.pas +++ b/compiler/powerpc64/rappcgas.pas @@ -266,6 +266,8 @@ begin end; end; end; + else + ; end; Consume(AS_RPAREN); if actasmtoken = AS_AT then diff --git a/compiler/pparautl.pas b/compiler/pparautl.pas index ededc2545b..5b26349995 100644 --- a/compiler/pparautl.pas +++ b/compiler/pparautl.pas @@ -525,6 +525,8 @@ implementation { Temporary stub, must be rewritten to support OS/2 far16 } Message1(parser_w_proc_directive_ignored,'FAR16'); end; + else + ; end; { Inlining is enabled and supported? } diff --git a/compiler/ppcgen/aasmcpu.pas b/compiler/ppcgen/aasmcpu.pas index 8921b6bdbb..d94b5d3b34 100644 --- a/compiler/ppcgen/aasmcpu.pas +++ b/compiler/ppcgen/aasmcpu.pas @@ -442,6 +442,8 @@ uses cutils, cclasses; A_STFSU, A_STFSUX, A_STFDU, A_STFDUX: if (oper[opnr]^.ref^.base = reg) then result := operand_readwrite; + else + ; end; end; @@ -524,6 +526,8 @@ uses cutils, cclasses; internalerror(2008052101); inc(instrpos); end; + else + ; end; p := tai(p.next); end; @@ -583,10 +587,14 @@ uses cutils, cclasses; // we inserted an instruction, so will have to check everything again inserted_something := true; end; + else + ; end; end; ait_const: inc(instrpos); + else + ; end; p := tai(p.next); end; diff --git a/compiler/ppcgen/agppcgas.pas b/compiler/ppcgen/agppcgas.pas index ce53c537f9..0f859d65ce 100644 --- a/compiler/ppcgen/agppcgas.pas +++ b/compiler/ppcgen/agppcgas.pas @@ -259,12 +259,18 @@ unit agppcgas; case o of A_BCCTR,A_BCCTRL: tempstr := 'ctr'; A_BCLR,A_BCLRL: tempstr := 'lr'; + else + ; end; case o of A_BL,A_BLA,A_BCL,A_BCLA,A_BCCTRL,A_BCLRL: tempstr := tempstr+'l'; + else + ; end; case o of A_BA,A_BLA,A_BCA,A_BCLA: tempstr:=tempstr+'a'; + else + ; end; branchmode := tempstr; end; @@ -287,8 +293,6 @@ unit agppcgas; cond2str:=cond2str+'-'; DH_Plus: cond2str:=cond2str+'+'; - else - internalerror(2003112901); end; cond2str:=cond2str+#9+tostr(c.bo)+','+tostr(c.bi); end; @@ -310,8 +314,6 @@ unit agppcgas; tempstr:=tempstr+('-'+#9); DH_Plus: tempstr:=tempstr+('+'+#9); - else - internalerror(2003112901); end; case c.cond of C_LT..C_NU: @@ -528,7 +530,9 @@ unit agppcgas; +sectionname(tai_section(hp).sectype,'',secorder_default)+' alignment put to '+tostr(tai_section(hp).secalign))),hp); end; end; - end; + else + ; + end; hp:=tai(hp.next); end; end; diff --git a/compiler/ppcgen/cgppc.pas b/compiler/ppcgen/cgppc.pas index 09997682f3..6a40c46fc9 100644 --- a/compiler/ppcgen/cgppc.pas +++ b/compiler/ppcgen/cgppc.pas @@ -316,6 +316,8 @@ unit cgppc; not(pi_do_call in current_procinfo.flags) then list.concat(taicpu.op_reg_reg(A_MTSPR,NR_LR,NR_R0)); end; + else + ; end; end; end; @@ -745,6 +747,8 @@ unit cgppc; list.concat(taicpu.op_const_const_const(A_CROR,testbit,testbit,testbit+2)); f2.flag:=F_LT; end; + else + ; end; c := flags_to_cond(f2); a_jmp(list,A_BC,c.cond,c.cr-RS_CR0,l); diff --git a/compiler/ppcgen/ngppcadd.pas b/compiler/ppcgen/ngppcadd.pas index c83b51cffe..513e1c8f1c 100644 --- a/compiler/ppcgen/ngppcadd.pas +++ b/compiler/ppcgen/ngppcadd.pas @@ -146,6 +146,11 @@ implementation lten : result.flag:=F_GE; gtn : result.flag:=F_LT; gten : result.flag:=F_LE; + equaln, + unequaln: + ; + else + internalerror(2019050942); end else case nodetype of @@ -153,6 +158,11 @@ implementation lten : result.flag:=F_LE; gtn : result.flag:=F_GT; gten : result.flag:=F_GE; + equaln, + unequaln: + ; + else + internalerror(2019050943); end; end end diff --git a/compiler/pstatmnt.pas b/compiler/pstatmnt.pas index 84d47b8ca1..fc7f6a33fc 100644 --- a/compiler/pstatmnt.pas +++ b/compiler/pstatmnt.pas @@ -109,6 +109,8 @@ implementation end; consume(_END); statements_til_end:=cblocknode.create(first); + if assigned(first) then + statements_til_end.fileinfo:=first.fileinfo; end; diff --git a/compiler/psub.pas b/compiler/psub.pas index f2fc891ca9..625451407e 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -229,6 +229,8 @@ implementation exit; end; end; + else + ; end; end; result:=true; @@ -1272,6 +1274,8 @@ implementation pd.localst.SymList.ForEachCall(@searchthreadvar,arg); end; end; + else + ; end; end; diff --git a/compiler/ptype.pas b/compiler/ptype.pas index cd2c2752ce..4f9ae870ff 100644 --- a/compiler/ptype.pas +++ b/compiler/ptype.pas @@ -1135,6 +1135,8 @@ implementation else def:=corddef.create(range_to_basetype(lv,hv),lv,hv,true); end; + else + internalerror(2019050527); end; end; end @@ -1882,8 +1884,6 @@ implementation def:=object_dec(odt_interfacecorba,name,newsym,genericdef,genericlist,nil,ht_none); it_interfacejava: def:=object_dec(odt_interfacejava,name,newsym,genericdef,genericlist,nil,ht_none); - else - internalerror(2010122612); end; end; _OBJCPROTOCOL : diff --git a/compiler/rautils.pas b/compiler/rautils.pas index 75231a88c9..3ddf98ee3e 100644 --- a/compiler/rautils.pas +++ b/compiler/rautils.pas @@ -797,6 +797,8 @@ Function TOperand.SetupVar(const s:string;GetOffset : boolean): Boolean; case opr.typ of OPR_REFERENCE: opr.varsize := l; OPR_LOCAL: opr.localvarsize := l; + else + ; end; @@ -813,7 +815,11 @@ Function TOperand.SetupVar(const s:string;GetOffset : boolean): Boolean; case opr.typ of OPR_REFERENCE: opr.varsize := sym.getsize; OPR_LOCAL: opr.localvarsize := sym.getsize; + else + ; end; + else + ; end; end; @@ -997,6 +1003,8 @@ Begin if paramanager.push_addr_param(tabstractvarsym(sym).varspez,tabstractvarsym(sym).vardef,current_procinfo.procdef.proccalloption) then SetSize(sizeof(pint),false); end; + else + ; end; if not size_set_from_absolute then setvarsize(tabstractvarsym(sym)); @@ -1449,6 +1457,8 @@ Begin exit; end; end; + else + ; end; end; end; @@ -1501,6 +1511,8 @@ Begin SearchIConstant:=TRUE; exit; end; + else + ; end; end; end; @@ -1564,6 +1576,8 @@ Begin st:=Tabstractvarsym(sym).vardef.GetSymtable(gs_record); typesym : st:=Ttypesym(sym).typedef.GetSymtable(gs_record); + else + ; end else s:=''; @@ -1617,6 +1631,8 @@ Begin st:=trecorddef(vardef).symtable; objectdef : st:=tobjectdef(vardef).symtable; + else + ; end; end; procsym: @@ -1646,6 +1662,8 @@ Begin GetRecordOffsetSize:=(s=''); exit; end; + else + ; end; end; { Support Field.Type as typecasting } @@ -1701,6 +1719,8 @@ Begin tlabelsym(sym).used:=true; SearchLabel:=true; end; + else + ; end; end; diff --git a/compiler/rgobj.pas b/compiler/rgobj.pas index 93f4bfbdee..028a9aff48 100644 --- a/compiler/rgobj.pas +++ b/compiler/rgobj.pas @@ -1928,6 +1928,8 @@ unit rgobj; end; end; {$endif arm} + else + ; end; end; ait_regalloc: @@ -1965,11 +1967,15 @@ unit rgobj; include(used_in_proc,supreg); has_usedmarks:=true; end; + else + ; end; { constraints needs always to be updated } add_constraints(reg); end; end; + else + ; end; add_cpu_interferences(p); p:=Tai(p.next); @@ -2166,6 +2172,8 @@ unit rgobj; end; end; {$endif arm} + else + ; end; { Maybe the operation can be removed when @@ -2179,6 +2187,8 @@ unit rgobj; continue; end; end; + else + ; end; p:=Tai(p.next); end; @@ -2322,6 +2332,8 @@ unit rgobj; live_registers.add(supreg); ra_dealloc : live_registers.delete(supreg); + else + ; end; end; end; @@ -2337,6 +2349,8 @@ unit rgobj; if instr_spill_register(list,tai_cpu_abstract_sym(p),regs_to_spill_set,spill_temps^) then spill_registers:=true; end; + else + ; end; p:=Tai(p.next); end; @@ -2464,6 +2478,8 @@ unit rgobj; result:=addreginfo(regs,r,shifterop^.rs,operand_read); end; {$endif ARM} + else + ; end; end; end; @@ -2525,6 +2541,8 @@ unit rgobj; try_replace_reg(regs, shifterop^.rs, true { always read-only }); end; {$endif ARM} + else + ; end; end; diff --git a/compiler/riscv/aasmcpu.pas b/compiler/riscv/aasmcpu.pas index 8f9dbbf651..01eb202ce7 100644 --- a/compiler/riscv/aasmcpu.pas +++ b/compiler/riscv/aasmcpu.pas @@ -565,6 +565,8 @@ uses cutils, cclasses; A_SD: result:=operand_read; {$endif RISCV64} + else + ; end; end; diff --git a/compiler/riscv/agrvgas.pas b/compiler/riscv/agrvgas.pas index a047c7c6a6..b686704861 100644 --- a/compiler/riscv/agrvgas.pas +++ b/compiler/riscv/agrvgas.pas @@ -137,6 +137,8 @@ unit agrvgas; addr_hi20: s:='%hi'+s; addr_pcrel_lo12: s:='%pcrel_lo'+s; addr_pcrel_hi20: s:='%pcrel_hi'+s; + else + ; end; end; getreferencestring:=s; diff --git a/compiler/riscv32/aoptcpu.pas b/compiler/riscv32/aoptcpu.pas index eb45ee1b9d..bc1f4be37a 100644 --- a/compiler/riscv32/aoptcpu.pas +++ b/compiler/riscv32/aoptcpu.pas @@ -56,6 +56,8 @@ Implementation {case taicpu(p).opcode of end;} end; + else + ; end; end; @@ -69,6 +71,8 @@ Implementation ait_instruction: begin end; + else + ; end; end; diff --git a/compiler/riscv32/cpubase.pas b/compiler/riscv32/cpubase.pas index 257580bc80..aaa26c5fe7 100644 --- a/compiler/riscv32/cpubase.pas +++ b/compiler/riscv32/cpubase.pas @@ -375,6 +375,8 @@ implementation case o of A_JAL,A_JALR,A_Bxx: is_calljmp:=true; + else + ; end; end; diff --git a/compiler/riscv32/cpupara.pas b/compiler/riscv32/cpupara.pas index 9a6e5dbe8b..f290ddb016 100644 --- a/compiler/riscv32/cpupara.pas +++ b/compiler/riscv32/cpupara.pas @@ -214,6 +214,8 @@ unit cpupara; result:=not is_smallset(def); stringdef : result:=tstringdef(def).stringtype in [st_shortstring,st_longstring]; + else + ; end; end; diff --git a/compiler/riscv32/cpupi.pas b/compiler/riscv32/cpupi.pas index 138d9ab915..f2b6401e29 100644 --- a/compiler/riscv32/cpupi.pas +++ b/compiler/riscv32/cpupi.pas @@ -106,6 +106,8 @@ unit cpupi; if r in regs then inc(floatsavesize,8); end; + else + ; end; floatsavesize:=align(floatsavesize,max(current_settings.alignment.localalignmin,4)); result:=Align(tg.direction*tg.lasttemp,max(current_settings.alignment.localalignmin,4))+maxpushedparasize+aint(floatsavesize); diff --git a/compiler/riscv32/nrv32cnv.pas b/compiler/riscv32/nrv32cnv.pas index dd56a22d49..eabaa87584 100644 --- a/compiler/riscv32/nrv32cnv.pas +++ b/compiler/riscv32/nrv32cnv.pas @@ -141,6 +141,8 @@ implementation case restype of s64real: cg.a_loadfpu_reg_reg(current_asmdata.CurrAsmList, OS_F32, OS_F64, location.register, location.Register); + else + ; end; end; end; diff --git a/compiler/riscv32/rarv32gas.pas b/compiler/riscv32/rarv32gas.pas index c93feb374b..7802e21b38 100644 --- a/compiler/riscv32/rarv32gas.pas +++ b/compiler/riscv32/rarv32gas.pas @@ -222,6 +222,8 @@ Unit rarv32gas; end; end; end; + else + ; end; Consume(AS_RPAREN); if actasmtoken=AS_AT then diff --git a/compiler/riscv64/aoptcpu.pas b/compiler/riscv64/aoptcpu.pas index 7e2ed6cf1a..ad16b2c377 100644 --- a/compiler/riscv64/aoptcpu.pas +++ b/compiler/riscv64/aoptcpu.pas @@ -125,6 +125,8 @@ implementation top_ref: result:= (p.oper[I]^.ref^.base=reg); + else + ; end; if result then exit; {Bailout if we found something} Inc(I); @@ -377,8 +379,12 @@ implementation result:=true; end; end; + else + ; end; end; + else + ; end; end; diff --git a/compiler/riscv64/cgcpu.pas b/compiler/riscv64/cgcpu.pas index 4b889b3c4d..d953575800 100644 --- a/compiler/riscv64/cgcpu.pas +++ b/compiler/riscv64/cgcpu.pas @@ -341,6 +341,8 @@ implementation a_call_name(list,'FPC_OVERFLOW',false); a_label(list,l); end; + else + internalerror(2019051032); end else a_op_reg_reg_reg(list,op,size,src1,src2,dst); diff --git a/compiler/riscv64/cpubase.pas b/compiler/riscv64/cpubase.pas index 5ee8b1dc5b..a93b3a2d1f 100644 --- a/compiler/riscv64/cpubase.pas +++ b/compiler/riscv64/cpubase.pas @@ -390,6 +390,8 @@ implementation case o of A_JAL,A_JALR,A_Bxx: is_calljmp:=true; + else + ; end; end; diff --git a/compiler/riscv64/cpupara.pas b/compiler/riscv64/cpupara.pas index e214c666b4..0e820259b7 100644 --- a/compiler/riscv64/cpupara.pas +++ b/compiler/riscv64/cpupara.pas @@ -184,6 +184,8 @@ implementation result := not is_smallset(def); stringdef: result := tstringdef(def).stringtype in [st_shortstring, st_longstring]; + else + ; end; end; diff --git a/compiler/riscv64/cpupi.pas b/compiler/riscv64/cpupi.pas index a0b3c129fb..ee87050bf7 100644 --- a/compiler/riscv64/cpupi.pas +++ b/compiler/riscv64/cpupi.pas @@ -99,6 +99,8 @@ implementation if r in regs then inc(floatsavesize,8); end; + else + ; end; floatsavesize:=system.align(floatsavesize,max(current_settings.alignment.localalignmin,8)); result:=Align(tg.direction*tg.lasttemp,max(current_settings.alignment.localalignmin,8))+maxpushedparasize+aint(floatsavesize); diff --git a/compiler/riscv64/rarv64gas.pas b/compiler/riscv64/rarv64gas.pas index bf92dffc1e..efdd1ef671 100644 --- a/compiler/riscv64/rarv64gas.pas +++ b/compiler/riscv64/rarv64gas.pas @@ -223,6 +223,8 @@ unit rarv64gas; end; end; end; + else + ; end; Consume(AS_RPAREN); if actasmtoken=AS_AT then diff --git a/compiler/scandir.pas b/compiler/scandir.pas index 3b9b479fc3..9dd457be20 100644 --- a/compiler/scandir.pas +++ b/compiler/scandir.pas @@ -436,6 +436,12 @@ unit scandir; end; + procedure dir_checkcasecoverage; + begin + do_localswitch(cs_check_all_case_coverage); + end; + + procedure dir_checkfpuexceptions; begin do_localswitch(cs_check_fpu_exceptions); @@ -1908,6 +1914,7 @@ unit scandir; AddDirective('BOOLEVAL',directive_all, @dir_booleval); AddDirective('BITPACKING',directive_all, @dir_bitpacking); AddDirective('CALLING',directive_all, @dir_calling); + AddDirective('CHECKCASECOVERAGE',directive_all, @dir_checkcasecoverage); AddDirective('CHECKFPUEXCEPTIONS',directive_all, @dir_checkfpuexceptions); AddDirective('CHECKLOWADDRLOADS',directive_all, @dir_checklowaddrloads); AddDirective('CHECKPOINTER',directive_all, @dir_checkpointer); diff --git a/compiler/scanner.pas b/compiler/scanner.pas index 2054d0befc..ee2c7b2ddb 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -521,12 +521,17 @@ implementation HandleModeSwitches(m_none,changeinit); - { turn on bitpacking for mode macpas and iso pascal as well as extended pascal } + { turn on bitpacking and case checking for mode macpas and iso pascal, + as well as extended pascal } if ([m_mac,m_iso,m_extpas] * current_settings.modeswitches <> []) then begin include(current_settings.localswitches,cs_bitpacking); + include(current_settings.localswitches,cs_check_all_case_coverage); if changeinit then - include(init_settings.localswitches,cs_bitpacking); + begin + include(init_settings.localswitches,cs_bitpacking); + include(init_settings.localswitches,cs_check_all_case_coverage); + end; end; { support goto/label by default in delphi/tp7/mac/iso/extpas modes } @@ -1483,7 +1488,9 @@ type tokentoconsume:=_STRING; end; end - end; + else + ; + end; end else begin @@ -1996,6 +2003,8 @@ type result.free; result:=texprvalue.create_int(tenumsym(srsym).value); end; + else + ; end; end end @@ -3317,6 +3326,8 @@ type recordtokenbuf.write(orgpattern[0],1); recordtokenbuf.write(orgpattern[1],length(orgpattern)); end; + else + ; end; end; @@ -3484,11 +3495,11 @@ type current_tokenpos.fileindex:=tokenreadword; current_filepos:=current_tokenpos; end; - else - internalerror(2006103010); end; continue; end; + else + ; end; break; until false; diff --git a/compiler/sparc/cgcpu.pas b/compiler/sparc/cgcpu.pas index 95b0833f7b..860490713f 100644 --- a/compiler/sparc/cgcpu.pas +++ b/compiler/sparc/cgcpu.pas @@ -284,6 +284,8 @@ interface OP_NEG, OP_NOT : internalerror(200306017); + else + ; end; get_64bit_ops(op,op1,op2,setflags); list.concat(taicpu.op_reg_reg_reg(op1,regsrc2.reglo,regsrc1.reglo,regdst.reglo)); diff --git a/compiler/sparc/cpupara.pas b/compiler/sparc/cpupara.pas index 9d4ff82339..2a3fe61de4 100644 --- a/compiler/sparc/cpupara.pas +++ b/compiler/sparc/cpupara.pas @@ -74,6 +74,8 @@ implementation result:=not tprocvardef(def).is_addressonly; setdef : result:=not is_smallset(def); + else + ; end; end; diff --git a/compiler/sparc64/cpugas.pas b/compiler/sparc64/cpugas.pas index 5ff4286367..9ea138b793 100644 --- a/compiler/sparc64/cpugas.pas +++ b/compiler/sparc64/cpugas.pas @@ -115,6 +115,8 @@ implementation result:='%gdop_hix2('+result+')'; addr_gdop_lox22: result:='%gdop_lox2('+result+')'; + else + ; end; if assigned(ref.symbol) or (ref.offset<>0) then diff --git a/compiler/sparc64/cpupara.pas b/compiler/sparc64/cpupara.pas index 453e88e438..fb70444727 100644 --- a/compiler/sparc64/cpupara.pas +++ b/compiler/sparc64/cpupara.pas @@ -81,6 +81,8 @@ implementation result:=false; setdef : result:=not is_smallset(def); + else + ; end; end; @@ -122,6 +124,8 @@ implementation result:=def.size>32; exit; end; + else + ; end; result:=inherited ret_in_param(def,pd); end; diff --git a/compiler/sparcgen/aoptcpu.pas b/compiler/sparcgen/aoptcpu.pas index 1dfea13180..3d4b14d4d7 100644 --- a/compiler/sparcgen/aoptcpu.pas +++ b/compiler/sparcgen/aoptcpu.pas @@ -94,6 +94,8 @@ unit aoptcpu; result:= (p.oper[I]^.ref^.base=reg) or (p.oper[I]^.ref^.index=reg); + else + ; end; if result then exit; {Bailout if we found something} Inc(I); @@ -118,6 +120,8 @@ unit aoptcpu; A_STB,A_STH,A_ST,A_STF,A_STDF, A_STX: exit; + else + ; end; result:=(p.ops>0) and (p.oper[p.ops-1]^.typ=top_reg) and @@ -414,8 +418,12 @@ unit aoptcpu; A_FABSd, A_FNEGd, A_FSQRTd, A_FSTOd, A_FITOd, A_FQTOd: TryRemoveMov(p,A_FMOVd); + else + ; end; end; + else + ; end; end; diff --git a/compiler/sparcgen/cgsparc.pas b/compiler/sparcgen/cgsparc.pas index 3487ead03f..eaef6ccc84 100644 --- a/compiler/sparcgen/cgsparc.pas +++ b/compiler/sparcgen/cgsparc.pas @@ -742,6 +742,8 @@ implementation {$endif SPARC64} ; end; + else + ; end; if setflags then begin @@ -765,6 +767,8 @@ implementation ovloc.loc:=LOC_FLAGS; ovloc.resflags.Init(NR_ICC,F_NE); end; + else + ; end; end else @@ -800,6 +804,8 @@ implementation ovloc.loc:=LOC_FLAGS; ovloc.resflags.Init(NR_ICC,F_NE); end; + else + ; end; end else diff --git a/compiler/sparcgen/cpugas.pas b/compiler/sparcgen/cpugas.pas index bf954d036f..ca41275117 100644 --- a/compiler/sparcgen/cpugas.pas +++ b/compiler/sparcgen/cpugas.pas @@ -111,6 +111,8 @@ implementation result:='%hi('+result+')'; addr_low: result:='%lo('+result+')'; + else + ; end; if assigned(ref.symbol) or (ref.offset<>0) then diff --git a/compiler/sparcgen/itcpugas.pas b/compiler/sparcgen/itcpugas.pas index 24b47c4d06..92128b254a 100644 --- a/compiler/sparcgen/itcpugas.pas +++ b/compiler/sparcgen/itcpugas.pas @@ -96,6 +96,8 @@ implementation setsubreg(hr,R_SUBFS); R_SUBL,R_SUBW,R_SUBD,R_SUBQ: setsubreg(hr,R_SUBWHOLE); + else + ; end; p:=findreg_by_number(hr); if p<>0 then diff --git a/compiler/sparcgen/rgcpu.pas b/compiler/sparcgen/rgcpu.pas index ccb9cbe454..467d2080fd 100644 --- a/compiler/sparcgen/rgcpu.pas +++ b/compiler/sparcgen/rgcpu.pas @@ -75,6 +75,8 @@ implementation inc(i,2); end; end; + else + ; end; end; diff --git a/compiler/symcreat.pas b/compiler/symcreat.pas index 615d00142f..6c57f84d18 100644 --- a/compiler/symcreat.pas +++ b/compiler/symcreat.pas @@ -1090,6 +1090,20 @@ implementation implement_jvm_procvar_intconstr(pd); tsk_jvm_virtual_clmethod: implement_jvm_virtual_clmethod(pd); +{$else} + tsk_jvm_enum_values, + tsk_jvm_enum_valueof, + tsk_jvm_enum_classconstr, + tsk_jvm_enum_jumps_constr, + tsk_jvm_enum_fpcordinal, + tsk_jvm_enum_fpcvalueof, + tsk_jvm_enum_long2set, + tsk_jvm_enum_bitset2set, + tsk_jvm_enum_set2set, + tsk_jvm_procvar_invoke, + tsk_jvm_procvar_intconstr, + tsk_jvm_virtual_clmethod: + internalerror(2011032801); {$endif jvm} tsk_field_getter: implement_field_getter(pd); @@ -1101,8 +1115,6 @@ implementation implement_interface_wrapper(pd); tsk_call_no_parameters: implement_call_no_parameters(pd); - else - internalerror(2011032801); end; end; end; diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 69e33001a7..cb46531ff5 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -26,7 +26,7 @@ interface uses { common } - cclasses, + cclasses,widestr, { global } globtype,globals,tokens,constexp, { symtable } @@ -2219,7 +2219,6 @@ implementation var recsize,temp: longint; begin - is_intregable:=false; case typ of orddef, pointerdef, @@ -2250,6 +2249,8 @@ implementation not needs_inittable; {$endif llvm} end; + else + is_intregable:=false; end; end; @@ -2580,8 +2581,6 @@ implementation alignment:=size_2_align(2) else alignment:=size_2_align(1); - else - internalerror(200412301); end; end; @@ -2608,8 +2607,6 @@ implementation st_widestring, st_unicodestring: Result:=voidpointertype.size; - else - internalerror(2014032301); end; end; @@ -3179,8 +3176,6 @@ implementation result:=cfiledef.createuntyped; ft_text: result:=cfiledef.createtext; - else - internalerror(2004121201); end; end; @@ -3223,8 +3218,6 @@ implementation end; ft_untyped: savesize:=search_system_type('FILEREC').typedef.size; - else - internalerror(2013113001); end; end; @@ -3237,8 +3230,6 @@ implementation ft_typed, ft_untyped: result:=search_system_type('FILEREC').typedef.alignment; - else - internalerror(2018120101); end; end; @@ -3262,8 +3253,6 @@ implementation GetTypeName:='File Of '+typedfiledef.typename; ft_text: GetTypeName:='Text' - else - internalerror(2013113002); end; end; @@ -3277,8 +3266,6 @@ implementation getmangledparaname:='FILE$OF$'+typedfiledef.mangledparaname; ft_text: getmangledparaname:='TEXT' - else - internalerror(2013113003); end; end; @@ -3341,8 +3328,6 @@ implementation GetTypeName:='Variant'; vt_olevariant: GetTypeName:='OleVariant'; - else - internalerror(2013113004); end; end; @@ -5054,7 +5039,7 @@ implementation hp : TParavarsym; hpc : tconstsym; first : boolean; - i : integer; + i,j : integer; begin s:=''; first:=true; @@ -5082,6 +5067,8 @@ implementation s:=s+'out '; vs_constref : s:=s+'constref '; + else + ; end; if (pno_paranames in pno) then s:=s+hp.realname+':'; @@ -5103,23 +5090,38 @@ implementation hpc:=tconstsym(hp.defaultconstsym); hs:=''; case hpc.consttyp of + constwstring: + begin + if pcompilerwidestring(hpc.value.valueptr)^.len>0 then + begin + setlength(hs,pcompilerwidestring(hpc.value.valueptr)^.len); + for j:=0 to pcompilerwidestring(hpc.value.valueptr)^.len-1 do + begin + if (ord(pcompilerwidestring(hpc.value.valueptr)^.data[j])<127) and + not(byte(pcompilerwidestring(hpc.value.valueptr)^.data[j]) in [0,10,13]) then + hs[j+1]:=char(pcompilerwidestring(hpc.value.valueptr)^.data[j]) + else + hs[j+1]:='.'; + end; + end; + end; conststring, constresourcestring : begin - If hpc.value.len>0 then - begin - setLength(hs,hpc.value.len); - { don't write past the end of hs if the constant - is > 255 chars } - move(hpc.value.valueptr^,hs[1],length(hs)); - { make sure that constant strings with newline chars - don't create a linebreak in the assembler code, - since comments are line-based. Also remove nulls - because the comments are written as a pchar. } - ReplaceCase(hs,#0,'.'); - ReplaceCase(hs,#10,'.'); - ReplaceCase(hs,#13,'.'); - end; + if hpc.value.len>0 then + begin + setLength(hs,hpc.value.len); + { don't write past the end of hs if the constant + is > 255 chars } + move(hpc.value.valueptr^,hs[1],length(hs)); + { make sure that constant strings with newline chars + don't create a linebreak in the assembler code, + since comments are line-based. Also remove nulls + because the comments are written as a pchar. } + ReplaceCase(hs,#0,'.'); + ReplaceCase(hs,#10,'.'); + ReplaceCase(hs,#13,'.'); + end; end; constreal : str(pbestreal(hpc.value.valueptr)^,hs); @@ -5141,6 +5143,10 @@ implementation hs:='nil'; constset : hs:='<set>'; + constguid: + hs:=guid2string(pguid(hpc.value.valueptr)^); + constnone: + internalerror(2019050704); end; if hs<>'' then s:=s+'=`'+hs+'`'; @@ -7508,6 +7514,8 @@ implementation end; odt_objcprotocol: result:=result+'_OBJC_PROTOCOL_'; + else + ; end; end else diff --git a/compiler/symsym.pas b/compiler/symsym.pas index 2384509f47..b3eb66f0f3 100644 --- a/compiler/symsym.pas +++ b/compiler/symsym.pas @@ -2440,6 +2440,12 @@ implementation destructor tconstsym.destroy; begin case consttyp of + constnone: + internalerror(2019050703); + constord, + constpointer, + constnil: + ; conststring, constresourcestring : freemem(pchar(value.valueptr),value.len+1); diff --git a/compiler/symtable.pas b/compiler/symtable.pas index c7abd7da58..305d39904a 100644 --- a/compiler/symtable.pas +++ b/compiler/symtable.pas @@ -383,6 +383,8 @@ interface { actually defined (could be disable using "undef") } function defined_macro(const s : string):boolean; { Look for a system procedure (no overloads supported) } + { returns a list of helpers in the current module for the def } + function get_objectpascal_helpers(pd : tdef):TFPObjectList; {*** Object Helpers ***} function search_default_property(pd : tabstractrecorddef) : tpropertysym; @@ -1112,6 +1114,8 @@ implementation (mop_initialize in trecordsymtable(trecorddef(tabstractvarsym(sym).vardef).symtable).managementoperators) then include(tableoptions,sto_has_non_trivial_init); end; + else + ; end; end; @@ -3274,6 +3278,8 @@ implementation vis_public, vis_published : result:=true; + else + internalerror(2019050702); end; end; @@ -3829,6 +3835,8 @@ implementation srsymtable:=nil; end; + function search_best_objectpascal_helper(const name: string;pd : tdef;contextclassh : tabstractrecorddef;out srsym: tsym;out srsymtable: tsymtable):boolean;forward; + function searchsym_in_helper(classh,contextclassh:tobjectdef;const s: TIDString;out srsym:tsym;out srsymtable:TSymtable;flags:tsymbol_search_flags):boolean; var hashedid : THashedIDString; @@ -3890,10 +3898,17 @@ implementation end; parentclassh:=parentclassh.childof; end; + { now search in the parents of the extended class (with helpers!) } if is_class(classh.extendeddef) then - { now search in the parents of the extended class (with helpers!) } - result:=searchsym_in_class(tobjectdef(classh.extendeddef).childof,contextclassh,s,srsym,srsymtable,flags+[ssf_search_helper]); - { addsymref is already called by searchsym_in_class } + begin + result:=searchsym_in_class(tobjectdef(classh.extendeddef).childof,contextclassh,s,srsym,srsymtable,flags+[ssf_search_helper]); + { addsymref is already called by searchsym_in_class } + if result then + exit; + end; + { now search all helpers using the extendeddef as the starting point } + if m_multi_helpers in current_settings.modeswitches then + result:=search_best_objectpascal_helper(s,classh.extendeddef,contextclassh,srsym,srsymtable); end; function search_specific_assignment_operator(assignment_type:ttoken;from_def,to_def:Tdef):Tprocdef; @@ -4106,15 +4121,59 @@ implementation end; end; - function search_last_objectpascal_helper(pd : tdef;contextclassh : tabstractrecorddef;out odef : tobjectdef):boolean; + function search_sym_in_helperdef(const s: string;classh : tobjectdef;contextclassh : tabstractrecorddef;out srsym: tsym;out srsymtable: tsymtable): boolean; var - s: string; - list: TFPObjectList; - i: integer; - st: tsymtable; + hashedid : THashedIDString; + pdef : tprocdef; + i : integer; begin + hashedid.id:=s; result:=false; - odef:=nil; + repeat + srsymtable:=classh.symtable; + srsym:=tsym(srsymtable.FindWithHash(hashedid)); + if srsym<>nil then + begin + case srsym.typ of + procsym: + begin + for i:=0 to tprocsym(srsym).procdeflist.count-1 do + begin + pdef:=tprocdef(tprocsym(srsym).procdeflist[i]); + if not is_visible_for_object(pdef.owner,pdef.visibility,contextclassh) then + continue; + srsym:=tprocdef(tprocsym(srsym).procdeflist[i]).procsym; + srsymtable:=srsym.owner; + result:=true; + exit; + end; + end; + typesym, + fieldvarsym, + constsym, + enumsym, + undefinedsym, + propertysym: + begin + result:=true; + exit; + end; + else + internalerror(2014041101); + end; + end; + + { try the helper parent if available } + classh:=classh.childof; + until classh=nil; + end; + + function get_objectpascal_helpers(pd : tdef):TFPObjectList; + var + s : string; + st : tsymtable; + begin + result:=nil; { when there are no helpers active currently then we don't need to do anything } if current_module.extendeddefs.count=0 then @@ -4137,7 +4196,42 @@ implementation exit; { the mangled name is used as the key for tmodule.extendeddefs } s:=generate_objectpascal_helper_key(pd); - list:=TFPObjectList(current_module.extendeddefs.Find(s)); + result:=TFPObjectList(current_module.extendeddefs.Find(s)); + end; + + function search_best_objectpascal_helper(const name: string;pd : tdef;contextclassh : tabstractrecorddef;out srsym: tsym;out srsymtable: tsymtable):boolean; + var + s : string; + list : TFPObjectList; + i : integer; + st : tsymtable; + odef : tobjectdef; + begin + result:=false; + list:=get_objectpascal_helpers(pd); + if assigned(list) and (list.count>0) then + begin + i:=list.count-1; + repeat + odef:=tobjectdef(list[i]); + result:=(odef.owner.symtabletype in [staticsymtable,globalsymtable]) or + is_visible_for_object(tobjectdef(list[i]).typesym,contextclassh); + if result then + result:=search_sym_in_helperdef(name,odef,contextclassh,srsym,srsymtable); + dec(i); + until result or (i<0); + end; + end; + + function search_last_objectpascal_helper(pd : tdef;contextclassh : tabstractrecorddef;out odef : tobjectdef):boolean; + var + s : string; + list : TFPObjectList; + i : integer; + begin + result:=false; + odef:=nil; + list:=get_objectpascal_helpers(pd); if assigned(list) and (list.count>0) then begin i:=list.count-1; @@ -4154,72 +4248,38 @@ implementation end; function search_objectpascal_helper(pd : tdef;contextclassh : tabstractrecorddef;const s: string; out srsym: tsym; out srsymtable: tsymtable):boolean; - var - hashedid : THashedIDString; classh : tobjectdef; - i : integer; - pdef : tprocdef; begin result:=false; { if there is no class helper for the class then there is no need to search further } - if not search_last_objectpascal_helper(pd,contextclassh,classh) then - exit; - - hashedid.id:=s; - - repeat - srsymtable:=classh.symtable; - srsym:=tsym(srsymtable.FindWithHash(hashedid)); - - if srsym<>nil then - begin - case srsym.typ of - procsym: - begin - for i:=0 to tprocsym(srsym).procdeflist.count-1 do - begin - pdef:=tprocdef(tprocsym(srsym).procdeflist[i]); - if not is_visible_for_object(pdef.owner,pdef.visibility,contextclassh) then - continue; - { we need to know if a procedure references symbols - in the static symtable, because then it can't be - inlined from outside this unit } - if assigned(current_procinfo) and - (srsym.owner.symtabletype=staticsymtable) then - include(current_procinfo.flags,pi_uses_static_symtable); - { the first found method wins } - srsym:=tprocdef(tprocsym(srsym).procdeflist[i]).procsym; - srsymtable:=srsym.owner; - addsymref(srsym); - result:=true; - exit; - end; - end; - typesym, - fieldvarsym, - constsym, - enumsym, - undefinedsym, - propertysym: - begin - addsymref(srsym); - result:=true; - exit; - end; - else - internalerror(2014041101); - end; - end; - - { try the helper parent if available } - classh:=classh.childof; - until classh=nil; + if m_multi_helpers in current_settings.modeswitches then + result:=search_best_objectpascal_helper(s,pd,contextclassh,srsym,srsymtable) + else + begin + if search_last_objectpascal_helper(pd,contextclassh,classh) and + search_sym_in_helperdef(s,classh,contextclassh,srsym,srsymtable) then + result:=true; + end; - srsym:=nil; - srsymtable:=nil; + if result then + begin + { we need to know if a procedure references symbols + in the static symtable, because then it can't be + inlined from outside this unit } + if (srsym.typ=procsym) and + assigned(current_procinfo) and + (srsym.owner.symtabletype=staticsymtable) then + include(current_procinfo.flags,pi_uses_static_symtable); + addsymref(srsym); + end + else + begin + srsym:=nil; + srsymtable:=nil; + end; end; function search_objc_helper(pd : tobjectdef;const s : string; out srsym: tsym; out srsymtable: tsymtable):boolean; diff --git a/compiler/symtype.pas b/compiler/symtype.pas index 78f7486e8b..a2fd73cb7c 100644 --- a/compiler/symtype.pas +++ b/compiler/symtype.pas @@ -872,8 +872,6 @@ implementation if len<>1 then internalerror(200306232); end; - else - internalerror(200212277); end; end; end; @@ -984,8 +982,6 @@ implementation getderef(hderef); p.addconstderef(slt,idx,hderef); end; - else - internalerror(200110204); end; until false; getpropaccesslist:=tpropaccesslist(p); diff --git a/compiler/symutil.pas b/compiler/symutil.pas index 0f66cf427d..5d955ee9b2 100644 --- a/compiler/symutil.pas +++ b/compiler/symutil.pas @@ -98,6 +98,8 @@ implementation equal_constsym:=(pnormalset(sym1.value.valueptr)^=pnormalset(sym2.value.valueptr)^); constnil : equal_constsym:=true; + else + ; end; end; diff --git a/compiler/systems/t_amiga.pas b/compiler/systems/t_amiga.pas index 5977ecd344..4b2bd594ef 100644 --- a/compiler/systems/t_amiga.pas +++ b/compiler/systems/t_amiga.pas @@ -107,6 +107,8 @@ begin case (target_info.system) of system_m68k_amiga: SetAmiga68kInfo; system_powerpc_amiga: SetAmigaPPCInfo; + else + internalerror(2019050949); end; end; @@ -426,6 +428,8 @@ begin case (target_info.system) of system_m68k_amiga: success:=MakeAmiga68kExe; system_powerpc_amiga: success:=MakeAmigaPPCExe; + else + internalerror(2019050948); end; { Remove ReponseFile } diff --git a/compiler/systems/t_bsd.pas b/compiler/systems/t_bsd.pas index 71d8e3aa50..ec4ff9e7bd 100644 --- a/compiler/systems/t_bsd.pas +++ b/compiler/systems/t_bsd.pas @@ -367,6 +367,8 @@ begin system_aarch64_darwin: { never anything } exit(''); + else + Internalerror(2019050709); end; { nothing special -> default } result:='crt1.o'; @@ -410,6 +412,8 @@ begin if (CompareVersionStrings(iPhoneOSVersionMin,'8.1')>0) then exit(''); end; + else + Internalerror(2019050710); end; result:='bundle1.o'; end @@ -445,6 +449,8 @@ begin if (CompareVersionStrings(iPhoneOSVersionMin,'8.1')>0) then exit(''); end; + else + Internalerror(2019050711); end; result:='dylib1.o'; end; diff --git a/compiler/systems/t_embed.pas b/compiler/systems/t_embed.pas index 89ca2f9bee..13434ba04e 100644 --- a/compiler/systems/t_embed.pas +++ b/compiler/systems/t_embed.pas @@ -1122,9 +1122,6 @@ begin Add('_stack_top = 0x' + IntToHex(sramsize+srambase,8) + ';'); end; end - else - if not (cs_link_nolink in current_settings.globalswitches) then - internalerror(200902011); end; with linkres do diff --git a/compiler/systems/t_linux.pas b/compiler/systems/t_linux.pas index decd3c0ff8..4b4557f962 100644 --- a/compiler/systems/t_linux.pas +++ b/compiler/systems/t_linux.pas @@ -389,7 +389,7 @@ begin DllCmd[1]:=DllCmd[1]+' $RES'; DllCmd[2]:='strip --strip-unneeded $EXE'; ExtDbgCmd[1]:='objcopy --only-keep-debug $EXE $DBG'; - ExtDbgCmd[2]:='objcopy --add-gnu-debuglink=$DBG $EXE'; + ExtDbgCmd[2]:='objcopy "--add-gnu-debuglink=$DBGX" $EXE'; ExtDbgCmd[3]:='strip --strip-unneeded $EXE'; SetupDynlinker(DynamicLinker,libctype); @@ -1464,6 +1464,7 @@ begin SplitBinCmd(Info.ExtDbgCmd[i],binstr,cmdstr); Replace(cmdstr,'$EXE',maybequoted(current_module.exefilename)); Replace(cmdstr,'$DBGFN',maybequoted(extractfilename(current_module.dbgfilename))); + Replace(cmdstr,'$DBGX',current_module.dbgfilename); Replace(cmdstr,'$DBG',maybequoted(current_module.dbgfilename)); success:=DoExec(FindUtil(utilsprefix+BinStr),CmdStr,true,false); if not success then diff --git a/compiler/systems/t_macos.pas b/compiler/systems/t_macos.pas index a195bb2930..21b9d03b13 100644 --- a/compiler/systems/t_macos.pas +++ b/compiler/systems/t_macos.pas @@ -277,6 +277,8 @@ procedure TLinkerMacOS.SetDefaultInfo; begin case (target_info.system) of system_m68k_macos: SetMacOS68kInfo; + else + ; end; end; diff --git a/compiler/systems/t_nds.pas b/compiler/systems/t_nds.pas index 173b6c124e..b936e6e777 100644 --- a/compiler/systems/t_nds.pas +++ b/compiler/systems/t_nds.pas @@ -101,6 +101,8 @@ begin prtobj:='prt07'; cprtobj:='cprt07'; end; + else + internalerror(2019050935); end; if (linklibc or linklibgcc) then @@ -709,6 +711,8 @@ begin case apptype of app_arm9: preName:='.nef'; app_arm7: preName:='.nlf'; + else + internalerror(2019050934); end; if (cs_link_strip in current_settings.globalswitches) and diff --git a/compiler/systems/t_win.pas b/compiler/systems/t_win.pas index 96d7338e2e..b9373d2ff9 100644 --- a/compiler/systems/t_win.pas +++ b/compiler/systems/t_win.pas @@ -1644,6 +1644,8 @@ implementation cmdstr:='--subsystem gui'; app_cui : cmdstr:='--subsystem console'; + else + ; end; if dllversion<>'' then cmdstr:=cmdstr+' --version '+dllversion; @@ -1697,6 +1699,8 @@ implementation peoptheader.Subsystem:=2; app_cui : peoptheader.Subsystem:=3; + else + ; end; if dllversion<>'' then begin diff --git a/compiler/x86/aasmcpu.pas b/compiler/x86/aasmcpu.pas index 7399522f6b..60c6c31f5b 100644 --- a/compiler/x86/aasmcpu.pas +++ b/compiler/x86/aasmcpu.pas @@ -1414,6 +1414,8 @@ implementation csiMem16: ot := ot and (not(OT_SIZE_MASK)) or OT_IMMEDIATE or OT_BITS16; csiMem32: ot := ot and (not(OT_SIZE_MASK)) or OT_IMMEDIATE or OT_BITS32; csiMem64: ot := ot and (not(OT_SIZE_MASK)) or OT_IMMEDIATE or OT_BITS64; + else + ; end; end else @@ -1604,6 +1606,8 @@ implementation case insot and (OT_XMMRM or OT_YMMRM or OT_REG_EXTRA_MASK) of OT_XMMRM: insot := insot or OT_BITS128; OT_YMMRM: insot := insot or OT_BITS256; + else + ; end; end; end; @@ -2020,6 +2024,8 @@ implementation R_MMREGISTER: if getsupreg(r)>=RS_XMM8 then result:=result or $47; + else + ; end; end; diff --git a/compiler/x86/agx86att.pas b/compiler/x86/agx86att.pas index 3d5bd5a788..1612387592 100644 --- a/compiler/x86/agx86att.pas +++ b/compiler/x86/agx86att.pas @@ -191,6 +191,8 @@ interface addr_tlsgd: owner.writer.AsmWrite('@tlsgd'); {$endif x86_64} + else + ; end; if offset<0 then diff --git a/compiler/x86/agx86int.pas b/compiler/x86/agx86int.pas index 4878e51ff1..d85fa48945 100644 --- a/compiler/x86/agx86int.pas +++ b/compiler/x86/agx86int.pas @@ -405,6 +405,8 @@ implementation writer.AsmWrite('dword ptr '); {$endif x86_64} + else + ; end; end; WriteReference(o.ref^); @@ -901,6 +903,8 @@ implementation writer.AsmWrite(#9#9'retn'); A_RETFD: writer.AsmWrite(#9#9'retf'); + else + internalerror(2019050907); end end {$endif I386} diff --git a/compiler/x86/aoptx86.pas b/compiler/x86/aoptx86.pas index 81b7348828..6a04e87300 100644 --- a/compiler/x86/aoptx86.pas +++ b/compiler/x86/aoptx86.pas @@ -267,6 +267,8 @@ unit aoptx86; exit; ait_label: exit; + else + ; end; InstrReadsFlags := false; end; @@ -994,6 +996,8 @@ unit aoptx86; isFoldableArithOp := (taicpu(hp1).oper[0]^.typ = top_reg) and (taicpu(hp1).oper[0]^.reg = reg); + else + ; end; end; @@ -1035,6 +1039,8 @@ unit aoptx86; if current_procinfo.procdef.returndef.size = 8 then DoRemoveLastDeallocForFuncRes(RS_EDX); end; + else + ; end; end; @@ -1265,7 +1271,9 @@ unit aoptx86; Result:=true; exit; end; - end; + else + ; + end; end else if (taicpu(p).oper[1]^.typ = top_reg) and (taicpu(hp1).oper[1]^.typ = top_reg) and (taicpu(p).oper[0]^.typ <> top_const) and { MOVZX only supports registers and memory, not immediates (use MOV for that!) } @@ -1448,6 +1456,8 @@ unit aoptx86; Result:=true; Exit; end; + else + ; end; end else @@ -2200,22 +2210,26 @@ unit aoptx86; hp1.free; end; A_ADD: - if MatchOpType(taicpu(hp1),top_const,top_reg) and - MatchOperand(taicpu(hp1).oper[1]^,taicpu(p).oper[1]^) then - begin - taicpu(p).loadConst(0,taicpu(p).oper[0]^.val-taicpu(hp1).oper[0]^.val); - asml.remove(hp1); - hp1.free; - if (taicpu(p).oper[0]^.val = 0) then - begin - hp1 := tai(p.next); - asml.remove(p); - p.free; - if not GetLastInstruction(hp1, p) then - p := hp1; - DoSubAddOpt := True; - end - end; + begin + if MatchOpType(taicpu(hp1),top_const,top_reg) and + MatchOperand(taicpu(hp1).oper[1]^,taicpu(p).oper[1]^) then + begin + taicpu(p).loadConst(0,taicpu(p).oper[0]^.val-taicpu(hp1).oper[0]^.val); + asml.remove(hp1); + hp1.free; + if (taicpu(p).oper[0]^.val = 0) then + begin + hp1 := tai(p.next); + asml.remove(p); + p.free; + if not GetLastInstruction(hp1, p) then + p := hp1; + DoSubAddOpt := True; + end + end; + end; + else + ; end; end; @@ -2313,6 +2327,8 @@ unit aoptx86; inc(TmpRef.offset, longint(taicpu(hp1).oper[0]^.val)); A_SUB: dec(TmpRef.offset, longint(taicpu(hp1).oper[0]^.val)); + else + internalerror(2019050536); end; asml.remove(hp1); hp1.free; @@ -2333,6 +2349,8 @@ unit aoptx86; inc(TmpRef.offset); A_DEC: dec(TmpRef.offset); + else + internalerror(2019050535); end; asml.remove(hp1); hp1.free; @@ -2538,6 +2556,8 @@ unit aoptx86; A_FSUBRP: taicpu(hp1).opcode := A_FSUB; A_FDIVP: taicpu(hp1).opcode := A_FDIVR; A_FDIVRP: taicpu(hp1).opcode := A_FDIV; + else + internalerror(2019050534); end; taicpu(hp1).oper[0]^.reg := taicpu(p).oper[0]^.reg; taicpu(hp1).oper[1]^.reg := NR_ST; @@ -2547,6 +2567,8 @@ unit aoptx86; Result:=true; exit; end; + else + ; end; end else @@ -2603,10 +2625,14 @@ unit aoptx86; A_FSUBRP: taicpu(p).opcode := A_FSUB; A_FDIVP: taicpu(p).opcode := A_FDIVR; A_FDIVRP: taicpu(p).opcode := A_FDIV; + else + internalerror(2019050533); end; asml.remove(hp2); hp2.free; end + else + ; end end end; @@ -3380,7 +3406,9 @@ unit aoptx86; hp1.Free; end; {$endif x86_64} - end; + else + ; + end; end; { changes some movzx constructs to faster synonims (all examples are given with eax/ax, but are also valid for other registers)} @@ -3475,8 +3503,10 @@ unit aoptx86; end; end; {$endif i8086} - end - else if (taicpu(p).oper[0]^.typ = top_ref) then + else + ; + end + else if (taicpu(p).oper[0]^.typ = top_ref) then begin if GetNextInstruction(p, hp1) and (tai(hp1).typ = ait_instruction) and @@ -3758,18 +3788,20 @@ unit aoptx86; { Code size reduction by J. Gareth "Kit" Moreton } { change 64-bit register to 32-bit register to reduce code size (upper 32 bits will be set to zero) } case taicpu(p).opsize of - S_Q: - begin - RegName := debug_regname(taicpu(p).oper[1]^.reg); { 64-bit register name } - Value := debug_tostr(taicpu(p).oper[0]^.val); + S_Q: + begin + RegName := debug_regname(taicpu(p).oper[1]^.reg); { 64-bit register name } + Value := debug_tostr(taicpu(p).oper[0]^.val); - { The actual optimization } - setsubreg(taicpu(p).oper[1]^.reg, R_SUBD); - taicpu(p).changeopsize(S_L); + { The actual optimization } + setsubreg(taicpu(p).oper[1]^.reg, R_SUBD); + taicpu(p).changeopsize(S_L); - DebugMsg(SPeepholeOptimization + 'movq $' + Value + ',' + RegName + ' -> movl $' + Value + ',' + debug_regname(taicpu(p).oper[1]^.reg) + ' (immediate can be represented with just 32 bits)', p); - Result := True; - end; + DebugMsg(SPeepholeOptimization + 'movq $' + Value + ',' + RegName + ' -> movl $' + Value + ',' + debug_regname(taicpu(p).oper[1]^.reg) + ' (immediate can be represented with just 32 bits)', p); + Result := True; + end; + else + ; end; end; end; @@ -3853,19 +3885,23 @@ unit aoptx86; { and in case of carry for A(E)/B(E)/C/NC } (taicpu(hp2).condition in [C_Z,C_NZ,C_E,C_NE]) then begin - case taicpu(hp1).opcode Of + case taicpu(hp1).opcode of A_DEC, A_INC: { replace inc/dec with add/sub 1, because inc/dec doesn't set the carry flag } begin case taicpu(hp1).opcode Of A_DEC: taicpu(hp1).opcode := A_SUB; A_INC: taicpu(hp1).opcode := A_ADD; + else + ; end; taicpu(hp1).loadoper(1,taicpu(hp1).oper[0]^); taicpu(hp1).loadConst(0,1); taicpu(hp1).ops:=2; - end - end; + end; + else + ; + end; hp1 := tai(p.next); asml.remove(p); p.free; @@ -3983,21 +4019,25 @@ unit aoptx86; InternalError(2018011500); case taicpu(p).opsize of - S_Q: - if (getsupreg(taicpu(p).oper[0]^.reg) in [RS_RAX, RS_RCX, RS_RDX, RS_RBX, RS_RSI, RS_RDI, RS_RBP, RS_RSP]) then + S_Q: begin - RegName := debug_regname(taicpu(p).oper[0]^.reg); { 64-bit register name } - PreMessage := 'xorq ' + RegName + ',' + RegName + ' -> xorl '; + if (getsupreg(taicpu(p).oper[0]^.reg) in [RS_RAX, RS_RCX, RS_RDX, RS_RBX, RS_RSI, RS_RDI, RS_RBP, RS_RSP]) then + begin + RegName := debug_regname(taicpu(p).oper[0]^.reg); { 64-bit register name } + PreMessage := 'xorq ' + RegName + ',' + RegName + ' -> xorl '; - { The actual optimization } - setsubreg(taicpu(p).oper[0]^.reg, R_SUBD); - setsubreg(taicpu(p).oper[1]^.reg, R_SUBD); - taicpu(p).changeopsize(S_L); + { The actual optimization } + setsubreg(taicpu(p).oper[0]^.reg, R_SUBD); + setsubreg(taicpu(p).oper[1]^.reg, R_SUBD); + taicpu(p).changeopsize(S_L); - RegName := debug_regname(taicpu(p).oper[0]^.reg); { 32-bit register name } + RegName := debug_regname(taicpu(p).oper[0]^.reg); { 32-bit register name } - DebugMsg(SPeepholeOptimization + PreMessage + RegName + ',' + RegName + ' (removes REX prefix)', p); + DebugMsg(SPeepholeOptimization + PreMessage + RegName + ',' + RegName + ' (removes REX prefix)', p); + end; end; + else + ; end; end; {$endif} diff --git a/compiler/x86/cgx86.pas b/compiler/x86/cgx86.pas index 7c608838bf..8f2fba5f0c 100644 --- a/compiler/x86/cgx86.pas +++ b/compiler/x86/cgx86.pas @@ -1329,6 +1329,8 @@ unit cgx86; tosize:=OS_F32; OS_64: tosize:=OS_F64; + else + ; end; if reg<>NR_ST then a_loadfpu_reg_reg(list,fromsize,tosize,reg,NR_ST); @@ -1360,6 +1362,8 @@ unit cgx86; tosize:=OS_F32; OS_64: tosize:=OS_F64; + else + ; end; if (fromsize in [low(convertopsse)..high(convertopsse)]) and (tosize in [low(convertopsse)..high(convertopsse)]) then @@ -1499,6 +1503,8 @@ unit cgx86; A_MOVSD, A_MOVQ: add_move_instruction(instr); + else + ; end; end else @@ -2065,6 +2071,8 @@ unit cgx86; a_load_const_reg(list,size,a,dst); exit; end; + else + ; end; if (op in [OP_MUL,OP_IMUL]) and (size in [OS_32,OS_S32,OS_64,OS_S64]) and not(cs_check_overflow in current_settings.localswitches) and @@ -2700,6 +2708,8 @@ unit cgx86; list.concat(ai); f2:=FPUFlags2Flags[f]; end; + else + ; end; ai := Taicpu.op_sym(A_Jcc,S_NO,l); ai.SetCondition(flags_to_cond(f2)); @@ -2737,6 +2747,8 @@ unit cgx86; end; F_FA,F_FAE: { These do not need PF check } f2:=FPUFlags2Flags[f]; + else + ; end; hreg:=makeregsize(list,reg,OS_8); ai:=Taicpu.op_reg(A_SETcc,S_B,hreg); @@ -2764,6 +2776,8 @@ unit cgx86; end; F_FA,F_FAE: f2:=FPUFlags2Flags[f]; + else + ; end; tmpref:=ref; make_simple_ref(list,tmpref); @@ -3266,6 +3280,8 @@ unit cgx86; begin a_call_name(list,'__mcount',false); end; + else + internalerror(2019050701); end; end; diff --git a/compiler/x86/cpubase.pas b/compiler/x86/cpubase.pas index 1444a3133d..6b379f40ec 100644 --- a/compiler/x86/cpubase.pas +++ b/compiler/x86/cpubase.pas @@ -514,6 +514,8 @@ implementation NR_CS,NR_DS,NR_ES, NR_SS,NR_FS,NR_GS : reg2opsize:=S_W; + else + ; end; end; else @@ -575,11 +577,12 @@ implementation function is_segment_reg(r:tregister):boolean; begin - result:=false; case r of NR_CS,NR_DS,NR_ES, NR_SS,NR_FS,NR_GS : result:=true; + else + result:=false; end; end; @@ -694,8 +697,6 @@ implementation mm_compact,mm_large,mm_huge: { all segment registers are different in these models } exit(false); - else - internalerror(2013062302); end; {$elseif defined(i386) or defined(x86_64)} { DS=SS=ES } diff --git a/compiler/x86/nx86add.pas b/compiler/x86/nx86add.pas index 52562c6e67..7950b33c9a 100644 --- a/compiler/x86/nx86add.pas +++ b/compiler/x86/nx86add.pas @@ -676,6 +676,8 @@ unit nx86add; op:=A_PADDSW; mmxu16bit: op:=A_PADDUSW; + else + ; end; end else @@ -687,6 +689,8 @@ unit nx86add; op:=A_PADDW; mmxs32bit,mmxu32bit: op:=A_PADDD; + else + ; end; end; end; @@ -697,6 +701,8 @@ unit nx86add; op:=A_PMULLW; mmxfixed16: op:=A_PMULHW; + else + ; end; end; subn : @@ -712,6 +718,8 @@ unit nx86add; op:=A_PSUBSB; mmxu16bit: op:=A_PSUBUSW; + else + ; end; end else @@ -723,6 +731,8 @@ unit nx86add; op:=A_PSUBW; mmxs32bit,mmxu32bit: op:=A_PSUBD; + else + ; end; end; end; diff --git a/compiler/x86/nx86cnv.pas b/compiler/x86/nx86cnv.pas index ff3399a477..82a2a87511 100644 --- a/compiler/x86/nx86cnv.pas +++ b/compiler/x86/nx86cnv.pas @@ -318,6 +318,8 @@ implementation current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg_reg(op,opsize,left.location.register,location.register,location.register)) else current_asmdata.CurrAsmList.concat(taicpu.op_reg_reg(op,opsize,left.location.register,location.register)); + else + internalerror(2019050708); end; end else diff --git a/compiler/x86/nx86ld.pas b/compiler/x86/nx86ld.pas index 0ef54b86a5..a2c1ae9838 100644 --- a/compiler/x86/nx86ld.pas +++ b/compiler/x86/nx86ld.pas @@ -120,6 +120,8 @@ implementation Internalerror(2018110401); end; end; + else + ; end; {$endif i386} {$ifdef x86_64} @@ -159,6 +161,8 @@ implementation Internalerror(2019012002); end; end; + else + ; end; {$endif x86_64} end; diff --git a/compiler/x86/nx86mat.pas b/compiler/x86/nx86mat.pas index 65ba589aea..0c956d738b 100644 --- a/compiler/x86/nx86mat.pas +++ b/compiler/x86/nx86mat.pas @@ -140,6 +140,8 @@ interface op:=A_PSUBSW; mmxu16bit: op:=A_PSUBUSW; + else + ; end else case mmx_type(resultdef) of @@ -149,6 +151,8 @@ interface op:=A_PSUBW; mmxs32bit,mmxu32bit: op:=A_PSUBD; + else + ; end; if op = A_NONE then internalerror(201408202); @@ -365,6 +369,8 @@ interface location.register:=tcgx86(cg).getmmxregister(current_asmdata.CurrAsmList); emit_ref_reg(A_MOVQ,S_NO,left.location.reference,location.register); end; + else + internalerror(2019050906); end; { load mask } hreg:=tcgx86(cg).getmmxregister(current_asmdata.CurrAsmList); diff --git a/compiler/x86/nx86mem.pas b/compiler/x86/nx86mem.pas index 8ff44fa302..c24fed0173 100644 --- a/compiler/x86/nx86mem.pas +++ b/compiler/x86/nx86mem.pas @@ -69,8 +69,6 @@ implementation x86pt_far: internalerror(2013050401); x86pt_huge: internalerror(2013050402); {$endif i8086} - else - internalerror(2013050403); end; end; diff --git a/compiler/x86/nx86set.pas b/compiler/x86/nx86set.pas index 4de3a5ecda..001ba0fc40 100644 --- a/compiler/x86/nx86set.pas +++ b/compiler/x86/nx86set.pas @@ -129,7 +129,7 @@ implementation { Limit size of jump tables for small enumerations so they have to be at least two-thirds full before being considered for the "almost exhaustive" treatment } - ExhaustiveLimit := min(ExhaustiveLimitBase, TrueCount shl 1) + ExhaustiveLimit := min(ExhaustiveLimitBase, labelcoverage shl 1) else ExhaustiveLimit := ExhaustiveLimitBase; diff --git a/compiler/x86/rax86.pas b/compiler/x86/rax86.pas index b40ac83f95..0bba0909ea 100644 --- a/compiler/x86/rax86.pas +++ b/compiler/x86/rax86.pas @@ -214,6 +214,8 @@ begin case size of OS_32 : opsize:=S_FS; OS_64 : opsize:=S_FL; + else + ; end; end else if gas_needsuffix[opcode]=attsufFPUint then @@ -222,6 +224,8 @@ begin OS_16 : opsize:=S_IS; OS_32 : opsize:=S_IL; OS_64 : opsize:=S_IQ; + else + ; end; end else if gas_needsuffix[opcode]=AttSufMM then @@ -231,6 +235,8 @@ begin case size of OS_32 : size := OS_M32; OS_64 : size := OS_M64; + else + ; end; end; end @@ -367,6 +373,8 @@ begin case operands[i].opr.Typ of OPR_LOCAL: ExistsLocalSymSize := tx86operand(operands[i]).opr.localsym.getsize > 0; OPR_REFERENCE: ExistsLocalSymSize := true; + else + ; end; end; @@ -399,12 +407,79 @@ begin memrefsize := -1; case MemRefInfo(opcode).MemRefSize of - msiMem8: memrefsize := 8; - msiMem16: memrefsize := 16; - msiMem32: memrefsize := 32; - msiMem64: memrefsize := 64; + msiMultiple8, + msiMem8: memrefsize := 8; + msiMultiple16, + msiMem16: memrefsize := 16; + msiXMem32, + msiYMem32, + msiMultiple32, + msiMem32: memrefsize := 32; + msiXMem64, + msiYMem64, + msiMultiple64, + msiMem64: memrefsize := 64; + msiMultiple128, msiMem128: memrefsize := 128; + msiMultiple256, msiMem256: memrefsize := 256; + msiMemRegx16y32: + begin + for j := 1 to ops do + begin + if operands[j].Opr.Typ = OPR_REGISTER then + begin + case getsubreg(operands[j].opr.reg) of + R_SUBMMX: memrefsize := 16; + R_SUBMMY: memrefsize := 32; + else Message(asmr_e_unable_to_determine_reference_size); + end; + end; + end; + end; + + msiMemRegx32y64: + begin + for j := 1 to ops do + begin + if operands[j].Opr.Typ = OPR_REGISTER then + begin + case getsubreg(operands[j].opr.reg) of + R_SUBMMX: memrefsize := 32; + R_SUBMMY: memrefsize := 64; + else Message(asmr_e_unable_to_determine_reference_size); + end; + end; + end; + end; + msiMemRegx64y128: + begin + for j := 1 to ops do + begin + if operands[j].Opr.Typ = OPR_REGISTER then + begin + case getsubreg(operands[j].opr.reg) of + R_SUBMMX: memrefsize := 64; + R_SUBMMY: memrefsize := 128; + else Message(asmr_e_unable_to_determine_reference_size); + end; + end; + end; + end; + msiMemRegx64y256: + begin + for j := 1 to ops do + begin + if operands[j].Opr.Typ = OPR_REGISTER then + begin + case getsubreg(operands[j].opr.reg) of + R_SUBMMX: memrefsize := 64; + R_SUBMMY: memrefsize := 256; + else Message(asmr_e_unable_to_determine_reference_size); + end; + end; + end; + end; msiMemRegSize : for j := 1 to ops do begin @@ -426,6 +501,13 @@ begin end; end; end; + msiNoSize, + msiUnkown, + msiUnsupported, + msiVMemMultiple, + msiVMemRegSize, + msiMultiple: + ; end; if memrefsize > -1 then @@ -444,6 +526,8 @@ begin memopsize := sizeof(pint) * 8 else memopsize := operands[i].opr.varsize * 8; + else + ; end; if memopsize = 0 then memopsize := topsize2memsize[tx86operand(operands[i]).opsize]; @@ -458,6 +542,8 @@ begin memoffset := operands[i].opr.localconstoffset; OPR_REFERENCE: memoffset := operands[i].opr.constoffset; + else + ; end; if memoffset < 0 then @@ -529,6 +615,8 @@ begin Message2(asmr_w_check_mem_operand_automap_multiple_size, std_op2str[opcode], '"16 bit memory operand"'); end; + msiXMem32, + msiYMem32, msiMem32: begin tx86operand(operands[i]).opsize := S_L; @@ -541,6 +629,8 @@ begin Message2(asmr_w_check_mem_operand_automap_multiple_size, std_op2str[opcode], '"32 bit memory operand"'); end; + msiXMem64, + msiYMem64, msiMem64: begin tx86operand(operands[i]).opsize := S_Q; @@ -687,7 +777,12 @@ begin end; end; msiNoSize: ; // all memory-sizes are ok + msiUnkown, + msiUnsupported, + msiVMemMultiple, + msiVMemRegSize, msiMultiple: Message(asmr_e_unable_to_determine_reference_size); // TODO individual message + end; OPR_CONSTANT: case MemRefInfo(opcode).ConstSize of @@ -703,7 +798,21 @@ begin tx86operand(operands[i]).opsize := S_L; tx86operand(operands[i]).size := OS_32; end; +{$ifdef x86_64} + csiMem64: begin + tx86operand(operands[i]).opsize := S_Q; + tx86operand(operands[i]).size := OS_64; + end; +{$else} + csiMem64: begin + internalerror(2019050910); + end; +{$endif} + csiUnkown, csiMultiple, csiNoSize: + ; end; + else + ; end; end; end; @@ -798,6 +907,8 @@ begin tx86operand(operands[i]).opsize:=S_W; {$endif} end; + else + ; end; end; end; @@ -847,6 +958,8 @@ begin S_Q : opsize:=S_WQ; {$endif} + else + ; end; S_B : begin @@ -859,8 +972,12 @@ begin S_Q : opsize:=S_BQ; {$endif} + else + ; end; end; + else + ; end; end; A_MOVSS, @@ -931,6 +1048,16 @@ begin sizeerr:=(tx86operand(operands[1]).opsize<>S_B) or (tx86operand(operands[2]).opsize<>S_L); S_WL : sizeerr:=(tx86operand(operands[1]).opsize<>S_W) or (tx86operand(operands[2]).opsize<>S_L); +{$ifdef x86_64} + S_BQ: + sizeerr:=(tx86operand(operands[1]).opsize<>S_B) or (tx86operand(operands[2]).opsize<>S_Q); + S_WQ: + sizeerr:=(tx86operand(operands[1]).opsize<>S_W) or (tx86operand(operands[2]).opsize<>S_Q); + S_LQ: + sizeerr:=(tx86operand(operands[1]).opsize<>S_L) or (tx86operand(operands[2]).opsize<>S_Q); +{$endif} + else + ; end; end; end @@ -1292,11 +1419,15 @@ begin asize := OT_BITS128; OS_M256,OS_MS256: asize := OT_BITS256; + else + ; end; if asize<>0 then ai.oper[i-1]^.ot:=(ai.oper[i-1]^.ot and not OT_SIZE_MASK) or asize; end; end; + else + ; end; { Condition ? } diff --git a/compiler/x86/rax86att.pas b/compiler/x86/rax86att.pas index e3e9e9a3b3..1014dda649 100644 --- a/compiler/x86/rax86att.pas +++ b/compiler/x86/rax86att.pas @@ -117,6 +117,8 @@ Implementation opcode:=A_MOV; {$endif x86_64} end; + else + ; end; end; @@ -393,6 +395,8 @@ Implementation else dec(oper.opr.ref.offset,l); end; + else + ; end; end; @@ -447,6 +451,8 @@ Implementation case oper.opr.typ of OPR_REFERENCE: oper.opr.varsize := tsize; OPR_LOCAL: oper.opr.localvarsize := tsize; + else + ; end; end; @@ -559,6 +565,8 @@ Implementation case oper.opr.typ of OPR_REFERENCE: oper.opr.varsize := k; OPR_LOCAL: oper.opr.localvarsize := k; + else + ; end; end; MaybeGetPICModifier(oper); diff --git a/compiler/x86/rax86int.pas b/compiler/x86/rax86int.pas index 0a61c69d47..7ebe177b11 100644 --- a/compiler/x86/rax86int.pas +++ b/compiler/x86/rax86int.pas @@ -1087,6 +1087,8 @@ Unit Rax86int; Consume(AS_RBRACKET); expr:=expr+']'; end; + else + ; end; Case actasmtoken of AS_LPAREN: @@ -1562,6 +1564,8 @@ Unit Rax86int; else Inc(oper.opr.ref.offset,l); end; + else + internalerror(2019050715); end; end else @@ -1646,6 +1650,8 @@ Unit Rax86int; inc(oper.opr.localsymofs,l); OPR_REFERENCE : inc(oper.opr.ref.offset,l); + else + internalerror(2019050716); end; if hastypecast then oper.hastype:=true; @@ -1745,6 +1751,8 @@ Unit Rax86int; else Message(asmr_e_invalid_reference_syntax); end; + else + internalerror(2019050719); end; end; else @@ -1759,6 +1767,8 @@ Unit Rax86int; oper.opr.ref.scalefactor:=l; OPR_LOCAL : oper.opr.localscale:=l; + else + internalerror(2019050717); end; if l>9 then Message(asmr_e_wrong_scale_factor); @@ -1829,6 +1839,8 @@ Unit Rax86int; {$endif x86_64} end; end; + else + internalerror(2019050718); end; GotPlus:=false; GotStar:=false; @@ -1910,6 +1922,8 @@ Unit Rax86int; else Inc(oper.opr.localsymofs,l); end; + else + internalerror(2019050714); end; GotPlus:=(prevasmtoken=AS_PLUS) or (prevasmtoken=AS_MINUS); @@ -2303,6 +2317,8 @@ Unit Rax86int; if oper.opr.typ=OPR_SYMBOL then oper.initref; end; + else + ; end; end else diff --git a/compiler/x86/rgx86.pas b/compiler/x86/rgx86.pas index b6350bcbda..131804b82f 100644 --- a/compiler/x86/rgx86.pas +++ b/compiler/x86/rgx86.pas @@ -274,6 +274,8 @@ implementation A_UNPCKLPD, A_UNPCKLPS : replaceoper:=-1; + else + ; end; end; 1 : @@ -406,6 +408,8 @@ implementation opcode:=A_VMOVSS; A_VMOVAPD: opcode:=A_VMOVSD; + else + ; end; end; result:=true; diff --git a/compiler/x86/symx86.pas b/compiler/x86/symx86.pas index 99b10fb4a6..4b58c21b5b 100644 --- a/compiler/x86/symx86.pas +++ b/compiler/x86/symx86.pas @@ -180,8 +180,6 @@ implementation result:=result+';far'; x86pt_huge: result:=result+';huge'; - else - internalerror(2013050301); end; end; end; diff --git a/compiler/x86_64/aoptcpu.pas b/compiler/x86_64/aoptcpu.pas index b82e16cb33..dbe6bf2081 100644 --- a/compiler/x86_64/aoptcpu.pas +++ b/compiler/x86_64/aoptcpu.pas @@ -55,8 +55,12 @@ uses result:=PrePeepholeOptIMUL(p); A_SAR,A_SHR: result:=PrePeepholeOptSxx(p); + else + ; end; end; + else + ; end; end; @@ -67,64 +71,69 @@ uses case p.typ of ait_instruction: begin - case taicpu(p).opcode of - A_AND: - Result:=OptPass1AND(p); - A_MOV: - Result:=OptPass1MOV(p); - A_MOVSX, - A_MOVZX: - Result:=OptPass1Movx(p); - A_VMOVAPS, - A_VMOVAPD, - A_VMOVUPS, - A_VMOVUPD: - result:=OptPass1VMOVAP(p); - A_MOVAPD, - A_MOVAPS, - A_MOVUPD, - A_MOVUPS: - result:=OptPass1MOVAP(p); - A_VDIVSD, - A_VDIVSS, - A_VSUBSD, - A_VSUBSS, - A_VMULSD, - A_VMULSS, - A_VADDSD, - A_VADDSS, - A_VANDPD, - A_VANDPS, - A_VORPD, - A_VORPS, - A_VXORPD, - A_VXORPS: - result:=OptPass1VOP(p); - A_MULSD, - A_MULSS, - A_ADDSD, - A_ADDSS: - result:=OptPass1OP(p); - A_VMOVSD, - A_VMOVSS, - A_MOVSD, - A_MOVSS: - result:=OptPass1MOVXX(p); - A_LEA: - result:=OptPass1LEA(p); - A_SUB: - result:=OptPass1Sub(p); - A_SHL,A_SAL: - result:=OptPass1SHLSAL(p); - A_SETcc: - result:=OptPass1SETcc(p); - A_FSTP,A_FISTP: - result:=OptPass1FSTP(p); - A_FLD: - result:=OptPass1FLD(p); + case taicpu(p).opcode of + A_AND: + Result:=OptPass1AND(p); + A_MOV: + Result:=OptPass1MOV(p); + A_MOVSX, + A_MOVZX: + Result:=OptPass1Movx(p); + A_VMOVAPS, + A_VMOVAPD, + A_VMOVUPS, + A_VMOVUPD: + result:=OptPass1VMOVAP(p); + A_MOVAPD, + A_MOVAPS, + A_MOVUPD, + A_MOVUPS: + result:=OptPass1MOVAP(p); + A_VDIVSD, + A_VDIVSS, + A_VSUBSD, + A_VSUBSS, + A_VMULSD, + A_VMULSS, + A_VADDSD, + A_VADDSS, + A_VANDPD, + A_VANDPS, + A_VORPD, + A_VORPS, + A_VXORPD, + A_VXORPS: + result:=OptPass1VOP(p); + A_MULSD, + A_MULSS, + A_ADDSD, + A_ADDSS: + result:=OptPass1OP(p); + A_VMOVSD, + A_VMOVSS, + A_MOVSD, + A_MOVSS: + result:=OptPass1MOVXX(p); + A_LEA: + result:=OptPass1LEA(p); + A_SUB: + result:=OptPass1Sub(p); + A_SHL,A_SAL: + result:=OptPass1SHLSAL(p); + A_SETcc: + result:=OptPass1SETcc(p); + A_FSTP,A_FISTP: + result:=OptPass1FSTP(p); + A_FLD: + result:=OptPass1FLD(p); + else + ; + end; end; - end; + else + ; end; + end; @@ -143,8 +152,12 @@ uses Result:=OptPass2Jmp(p); A_Jcc: Result:=OptPass2Jcc(p); + else + ; end; end; + else + ; end; end; @@ -171,8 +184,12 @@ uses Result:=PostPeepholeOptCall(p); A_LEA: Result:=PostPeepholeOptLea(p); + else + ; end; end; + else + ; end; end; diff --git a/compiler/x86_64/cpuelf.pas b/compiler/x86_64/cpuelf.pas index 4c03da566e..7dacd47534 100644 --- a/compiler/x86_64/cpuelf.pas +++ b/compiler/x86_64/cpuelf.pas @@ -400,6 +400,8 @@ implementation data.Write(zero,4); continue; end; + else + ; end; if (objreloc.flags and rf_raw)=0 then diff --git a/compiler/x86_64/cpupara.pas b/compiler/x86_64/cpupara.pas index a2182201e0..8c02292bdc 100644 --- a/compiler/x86_64/cpupara.pas +++ b/compiler/x86_64/cpupara.pas @@ -544,6 +544,8 @@ unit cpupara; classes[0].typ:=X86_64_SSE_CLASS; classes[0].def:=carraydef.getreusable_no_free(s32floattype,2); end; + else + ; end; { 2) the second part is 32 bit, but the total size is > 12 bytes } if (def.size>12) then @@ -558,6 +560,8 @@ unit cpupara; classes[1].typ:=X86_64_SSE_CLASS; classes[1].def:=carraydef.getreusable_no_free(s32floattype,2); end; + else + ; end; {$endif not llvm} result:=words; @@ -962,8 +966,6 @@ unit cpupara; classes[1].def:=carraydef.getreusable_no_free(s32floattype,2); result:=2; end; - else - internalerror(2010060301); end; end; recorddef: @@ -1338,6 +1340,8 @@ unit cpupara; numclasses:=classify_argument(calloption,def,nil,vs_value,def.size,classes,0,False); result:=numclasses=0; end; + else + ; end; end; @@ -1721,6 +1725,8 @@ unit cpupara; X86_64_SSESF_CLASS, X86_64_SSEDF_CLASS: inc(needmmloc); + else + ; end; { the "-1" is because we can also use the current register } if (use_ms_abi and diff --git a/compiler/x86_64/nx64flw.pas b/compiler/x86_64/nx64flw.pas index 0445409d77..62268c5802 100644 --- a/compiler/x86_64/nx64flw.pas +++ b/compiler/x86_64/nx64flw.pas @@ -137,6 +137,8 @@ function reset_regvars(var n: tnode; arg: pointer): foreachnoderesult; make_not_regable(n,[]); calln: include(tprocinfo(arg).flags,pi_do_call); + else + ; end; result:=fen_true; end; @@ -146,6 +148,8 @@ function copy_parasize(var n: tnode; arg: pointer): foreachnoderesult; case n.nodetype of calln: tcgprocinfo(arg).allocate_push_parasize(tcallnode(n).pushed_parasize); + else + ; end; result:=fen_true; end; diff --git a/compiler/x86_64/nx64set.pas b/compiler/x86_64/nx64set.pas index 9f3d47255e..65f469d806 100644 --- a/compiler/x86_64/nx64set.pas +++ b/compiler/x86_64/nx64set.pas @@ -128,7 +128,7 @@ implementation { Limit size of jump tables for small enumerations so they have to be at least two-thirds full before being considered for the "almost exhaustive" treatment } - ExhaustiveLimit := min(ExhaustiveLimitBase, TrueCount shl 1) + ExhaustiveLimit := min(ExhaustiveLimitBase, labelcoverage shl 1) else ExhaustiveLimit := ExhaustiveLimitBase; diff --git a/compiler/x86_64/win64unw.pas b/compiler/x86_64/win64unw.pas index e164362f58..d040b4935b 100644 --- a/compiler/x86_64/win64unw.pas +++ b/compiler/x86_64/win64unw.pas @@ -394,6 +394,9 @@ begin ash_savexmm: current_unw.save_xmm(objdata,data.reg,data.offset); ash_pushframe: {TBD}; + ash_pushnv, + ash_savenv: + internalerror(2019050712); end; end; diff --git a/packages/fcl-db/src/sqldb/oracle/oracleconnection.pp b/packages/fcl-db/src/sqldb/oracle/oracleconnection.pp index cb29f44ae6..b3e60e7e67 100644 --- a/packages/fcl-db/src/sqldb/oracle/oracleconnection.pp +++ b/packages/fcl-db/src/sqldb/oracle/oracleconnection.pp @@ -1,7 +1,7 @@ unit oracleconnection; { - Copyright (c) 2006-2014 by Joost van der Sluis, FPC contributors + Copyright (c) 2006-2019 by Joost van der Sluis, FPC contributors Oracle RDBMS connector using the OCI protocol @@ -358,6 +358,7 @@ begin case DataType of ftInteger : AsInteger := PInteger(ParamBuffers[i].buffer)^; + ftLargeint : AsLargeInt := PInt64(ParamBuffers[i].buffer)^; ftFloat : AsFloat := PDouble(ParamBuffers[i].buffer)^; ftString : begin SetLength(s,ParamBuffers[i].Len); diff --git a/packages/fcl-web/src/base/fphttpclient.pp b/packages/fcl-web/src/base/fphttpclient.pp index e1982e209a..b7d9ddbfe8 100644 --- a/packages/fcl-web/src/base/fphttpclient.pp +++ b/packages/fcl-web/src/base/fphttpclient.pp @@ -1480,7 +1480,8 @@ begin 301, 302, 303, - 307,808 : Result:=True; + 307, + 308 : Result:=True; else Result:=False; end; diff --git a/packages/fcl-web/src/restbridge/sqldbrestbridge.pp b/packages/fcl-web/src/restbridge/sqldbrestbridge.pp index fafa026e99..6dc839c2f1 100644 --- a/packages/fcl-web/src/restbridge/sqldbrestbridge.pp +++ b/packages/fcl-web/src/restbridge/sqldbrestbridge.pp @@ -19,7 +19,7 @@ unit sqldbrestbridge; interface uses - Classes, SysUtils, DB, SqlTypes, SQLDB, httpdefs, httproute, fpjson, sqldbrestschema, sqldbrestio, sqldbrestdata, sqldbrestauth; + Classes, SysUtils, DB, SQLDB, httpdefs, httproute, fpjson, sqldbrestschema, sqldbrestio, sqldbrestdata, sqldbrestauth; Type TRestDispatcherOption = (rdoConnectionInURL, // Route includes connection :Connection/:Resource[/:ID] @@ -358,7 +358,7 @@ Type Property CORSAllowedOrigins: String Read FCORSAllowedOrigins Write FCORSAllowedOrigins; // Access-Control-Max-Age header value. Set to zero not to send the header Property CORSMaxAge : Integer Read FCORSMaxAge Write FCORSMaxAge; - // Access-Control-Allow-Credentials header value. Set to zero not to send the header + // Access-Control-Allow-Credentials header value. Set to false not to send the header Property CORSAllowCredentials : Boolean Read FCORSAllowCredentials Write FCORSAllowCredentials; // UserIDs of the user(s) that are allowed to see and modify the connection resource. Property AdminUserIDs : TStrings Read FAdminUserIDs Write SetAdminUserIDS; @@ -2312,6 +2312,7 @@ begin DatabaseName:=C.DatabaseName; ConnectionType:=C.ConnectionType; Port:=C.Port; + Name:=C.Name; SchemaName:=C.SchemaName; Params.Assign(C.Params); end diff --git a/packages/fcl-web/src/restbridge/sqldbrestini.pp b/packages/fcl-web/src/restbridge/sqldbrestini.pp index d6640cad06..5363336669 100644 --- a/packages/fcl-web/src/restbridge/sqldbrestini.pp +++ b/packages/fcl-web/src/restbridge/sqldbrestini.pp @@ -36,10 +36,10 @@ Type Public Procedure LoadFromIni(Const aIni: TCustomIniFile; aOptions : TConnectionIniOptions = []); overload; Procedure LoadFromIni(Const aIni: TCustomIniFile; ASection : String; aOptions : TConnectionIniOptions); overload; - Procedure LoadFromFile(Const aFileName : String; aOptions : TConnectionIniOptions = []); overload; - Procedure LoadFromFile(Const aFileName : String; Const ASection : String; aOptions : TConnectionIniOptions); overload; - Procedure SaveToFile(Const aFileName : String; aOptions : TConnectionIniOptions = []);overload; - Procedure SaveToFile(Const aFileName : String; Const ASection : String; aOptions : TConnectionIniOptions = []);overload; + Procedure LoadFromIniFile(Const aFileName : String; aOptions : TConnectionIniOptions = []); overload; + Procedure LoadFromIniFile(Const aFileName : String; Const ASection : String; aOptions : TConnectionIniOptions); overload; + Procedure SaveToIniFile(Const aFileName : String; aOptions : TConnectionIniOptions = []);overload; + Procedure SaveToIniFile(Const aFileName : String; Const ASection : String; aOptions : TConnectionIniOptions = []);overload; Procedure SaveToIni(Const aIni: TCustomIniFile; aOptions : TConnectionIniOptions = []); overload; Procedure SaveToIni(Const aIni: TCustomIniFile; ASection : String; aOptions : TConnectionIniOptions); overload; end; @@ -578,14 +578,14 @@ begin LoadFromIni(aIni,DefaultConnectionSection,aOptions); end; -procedure TSQLDBRestConnectionHelper.LoadFromFile(const aFileName: String; aOptions: TConnectionIniOptions); +procedure TSQLDBRestConnectionHelper.LoadFromIniFile(const aFileName: String; aOptions: TConnectionIniOptions); begin - Loadfromfile(aFileName,DefaultConnectionSection,aOptions); + LoadfromInifile(aFileName,DefaultConnectionSection,aOptions); end; -procedure TSQLDBRestConnectionHelper.LoadFromFile(const aFileName: String; const ASection: String; aOptions: TConnectionIniOptions); +procedure TSQLDBRestConnectionHelper.LoadFromIniFile(const aFileName: String; const ASection: String; aOptions: TConnectionIniOptions); Var Ini : TCustomIniFile; @@ -599,12 +599,12 @@ begin end; end; -procedure TSQLDBRestConnectionHelper.SaveToFile(const aFileName: String; aOptions: TConnectionIniOptions); +procedure TSQLDBRestConnectionHelper.SaveToIniFile(const aFileName: String; aOptions: TConnectionIniOptions); begin - SaveToFile(aFileName,DefaultConnectionSection,aOptions); + SaveToIniFile(aFileName,DefaultConnectionSection,aOptions); end; -procedure TSQLDBRestConnectionHelper.SaveToFile(const aFileName: String; const ASection: String; aOptions: TConnectionIniOptions); +procedure TSQLDBRestConnectionHelper.SaveToIniFile(const aFileName: String; const ASection: String; aOptions: TConnectionIniOptions); Var Ini : TCustomIniFile; diff --git a/packages/fcl-web/src/restbridge/sqldbrestschema.pp b/packages/fcl-web/src/restbridge/sqldbrestschema.pp index 6b5b42d58a..d30c1e0dc7 100644 --- a/packages/fcl-web/src/restbridge/sqldbrestschema.pp +++ b/packages/fcl-web/src/restbridge/sqldbrestschema.pp @@ -49,6 +49,7 @@ Const JSONSchemaRoot = 'schema'; JSONResourcesRoot = 'resources'; JSONConnectionsRoot = 'connections'; + JSONConnectionName = 'connectionName'; Type @@ -200,6 +201,7 @@ Type function GetFieldList(aListKind: TFieldListKind; ASep : String = ''): UTF8String; function GetFieldArray(aListKind: TFieldListKind): TSQLDBRestFieldArray; Function GetResolvedSQl(aKind : TSQLKind; Const AWhere : UTF8String; Const aOrderBy : UTF8String = ''; aLimit : UTF8String = '') : UTF8String; + Function ProcessSQl(aSQL : String; Const AWhere : UTF8String; Const aOrderBy : UTF8String = ''; aLimit : UTF8String = '') : UTF8String; Procedure PopulateFieldsFromFieldDefs(Defs : TFieldDefs; aIndexFields : TStringArray; aProcessIdentifier : TProcessIdentifier; aMinFieldOpts : TRestFieldOptions); Property SQL [aKind : TSQLKind] : TStrings Read GetSQLTyped; Property BusinessProcessor : TSQLDBRestCustomBusinessProcessor Read FBusinessProcessor; @@ -254,7 +256,6 @@ Type procedure SetResources(AValue: TSQLDBRestResourceList); Protected function CreateResourceList: TSQLDBRestResourceList; virtual; - function GetPrimaryIndexFields(Q: TSQLQuery): TStringArray; virtual; function ProcessIdentifier(const S: UTF8String): UTF8String; virtual; Function AttachProcessor(aProcessor : TSQLDBRestCustomBusinessProcessor) : Boolean; Virtual; Function DetachProcessor(aProcessor : TSQLDBRestCustomBusinessProcessor) : Boolean; Virtual; @@ -271,6 +272,7 @@ Type Procedure LoadFromFile(Const aFileName : UTF8String); Procedure LoadFromStream(Const aStream : TStream); Procedure FromJSON(aData: TJSONData;const aPropName: UTF8String=''); + Class function GetPrimaryIndexFields(Q: TSQLQuery): TStringArray; virtual; procedure PopulateResourceFields(aConn: TSQLConnection; aRes: TSQLDBRestResource; aMinFieldOpts : TRestFieldOptions = []); virtual; procedure PopulateResources(aConn: TSQLConnection; aTables: array of string; aMinFieldOpts: TRestFieldOptions= []); Procedure PopulateResources(aConn : TSQLConnection; aTables : TStrings = Nil; aMinFieldOpts : TRestFieldOptions = []); @@ -521,7 +523,7 @@ end; function TSQLDBRestSchema.AsJSON(const aPropName: UTF8String): TJSONData; begin - Result:=TJSONObject.Create([JSONResourcesRoot,Resources.AsJSON(),'connectionName',ConnectionName]); + Result:=TJSONObject.Create([JSONResourcesRoot,Resources.AsJSON(),JSONConnectionName,ConnectionName]); if (aPropName<>'') then Result:=TJSONObject.Create([aPropName,Result]); end; @@ -559,8 +561,10 @@ Var begin J:=aData as TJSONObject; + if (aPropName<>'') then + J:=J.Objects[aPropName]; Resources.FromJSON(J,JSONResourcesRoot); - ConnectionName:=J.Get(aPropName,''); + ConnectionName:=J.Get(JSONConnectionName,''); AttachAllProcessors; end; @@ -623,7 +627,7 @@ begin end; -function TSQLDBRestSchema.GetPrimaryIndexFields(Q: TSQLQuery): TStringArray; +class function TSQLDBRestSchema.GetPrimaryIndexFields(Q: TSQLQuery): TStringArray; Var C,I : Integer; @@ -1159,13 +1163,21 @@ function TSQLDBRestResource.GetResolvedSQl(aKind: TSQLKind; const AWhere: UTF8String; const aOrderBy: UTF8String; aLimit: UTF8String ): UTF8String; -Var - S : UTF8String; - begin Result:=SQL[aKind].Text; if (Result='') then Result:=GenerateDefaultSQL(aKind); + Result:=ProcessSQL(Result,aWhere,aOrderBy,aLimit); +end; + +function TSQLDBRestResource.ProcessSQl(aSQL: String; const AWhere: UTF8String; + const aOrderBy: UTF8String; aLimit: UTF8String): UTF8String; + +Var + S : UTF8String; + +begin + Result:=aSQL; if (aWhere<>'') then S:='WHERE '+aWhere else @@ -1240,6 +1252,7 @@ begin Exclude(O,foFilter); end; F:=Fields.AddField(FN,RFT,O); + F.NativeFieldType:=FD.DataType; if F.FieldType=rftString then F.MaxLen:=FD.Size; F.PublicName:=PN; diff --git a/packages/rtl-objpas/src/i386/invoke.inc b/packages/rtl-objpas/src/i386/invoke.inc index 73d0a27fcd..d80d2fa3eb 100644 --- a/packages/rtl-objpas/src/i386/invoke.inc +++ b/packages/rtl-objpas/src/i386/invoke.inc @@ -123,12 +123,6 @@ resourcestring procedure SystemInvokeRegister(aCodeAddress: CodePointer; const aArgs: TFunctionCallParameterArray; aCallConv: TCallConv; aResultType: PTypeInfo; aResultValue: Pointer; aFlags: TFunctionCallFlags); -type - PBoolean16 = ^Boolean16; - PBoolean32 = ^Boolean32; - PBoolean64 = ^Boolean64; - PByteBool = ^ByteBool; - PQWordBool = ^QWordBool; var regstack: array of PtrUInt; stackargs: array of SizeInt; @@ -426,7 +420,7 @@ begin ftCurr: PCurrency(aResultValue)^ := floatres / 10000; ftComp: - PComp(aResultValue)^ := floatres; + PComp(aResultValue)^ := Comp(floatres); end; end else if aResultType^.Kind in [tkQWord, tkInt64] then PQWord(aResultValue)^ := regstack[0] or (QWord(regstack[1]) shl 32) diff --git a/packages/rtl-objpas/src/inc/dateutil.inc b/packages/rtl-objpas/src/inc/dateutil.inc index 361f1bc43c..7e60aedaec 100644 --- a/packages/rtl-objpas/src/inc/dateutil.inc +++ b/packages/rtl-objpas/src/inc/dateutil.inc @@ -448,7 +448,7 @@ function TryISOStrToTime(const aString: string; Out outTime: TDateTime): Boolean // Combination of previous function TryISOStrToDateTime(const aString: string; out outDateTime: TDateTime): Boolean; // Z +hh:nn -hh:nn -Function TryISOTZStrToTZOffset(TZ : String; Out TZOffset : Integer) : boolean; +Function TryISOTZStrToTZOffset(const TZ : String; Out TZOffset : Integer) : boolean; // ISO 8601 Date/Time formatting @@ -2857,7 +2857,7 @@ begin outDateTime := 0; end; -Function TryISOTZStrToTZOffset(TZ : String; Out TZOffset : Integer) : boolean; +Function TryISOTZStrToTZOffset(const TZ : String; Out TZOffset : Integer) : boolean; Var H,M : LongInt; @@ -2871,7 +2871,16 @@ begin Result:=TZ[1] in ['+','-']; if Not Result then Exit; - Result:=TryStrToInt(Copy(TZ,2,2),H) and TryStrToInt(Copy(TZ,5,2),M); + case Length(TZ) of + 3: begin + Result:=TryStrToInt(Copy(TZ,2,2),H); + M := 0; + end; + 5: Result:=TryStrToInt(Copy(TZ,2,2),H) and TryStrToInt(Copy(TZ,4,2),M); + 6: Result:=TryStrToInt(Copy(TZ,2,2),H) and TryStrToInt(Copy(TZ,5,2),M); + else + Result := False; + end; if not Result then exit; TZOffset:=H*60+M; @@ -2904,6 +2913,16 @@ begin TZ:='Z'; S:=Copy(S,1,L-1); end + else If (L>2) and (S[L-2] in ['+','-']) then + begin + TZ:=Copy(S,L-2,3); + S:=Copy(S,1,L-3); + end + else If (L>4) and (S[L-4] in ['+','-']) then + begin + TZ:=Copy(S,L-4,5); + S:=Copy(S,1,L-5); + end else If (L>5) and (S[L-5] in ['+','-']) then begin TZ:=Copy(S,L-5,6); diff --git a/packages/rtl-objpas/src/inc/rtti.pp b/packages/rtl-objpas/src/inc/rtti.pp index 892660ec53..41ce307337 100644 --- a/packages/rtl-objpas/src/inc/rtti.pp +++ b/packages/rtl-objpas/src/inc/rtti.pp @@ -539,7 +539,7 @@ resourcestring SErrInvokeNotImplemented = 'Invoke functionality is not implemented'; SErrInvokeResultTypeNoValue = 'Function has a result type, but no result pointer provided'; SErrInvokeFailed = 'Invoke call failed'; - SErrCallbackNotImplented = 'Callback functionality is not implemented'; + SErrCallbackNotImplemented = 'Callback functionality is not implemented'; SErrCallConvNotSupported = 'Calling convention not supported: %s'; SErrTypeKindNotSupported = 'Type kind is not supported: %s'; SErrCallbackHandlerNil = 'Callback handler is Nil'; @@ -758,13 +758,13 @@ end; function NoCreateCallbackProc(aFunc: TFunctionCallProc; aCallConv: TCallConv; aArgs: array of TFunctionCallParameterInfo; aResultType: PTypeInfo; aFlags: TFunctionCallFlags; aContext: Pointer): TFunctionCallCallback; begin Result := Nil; - raise ENotImplemented.Create(SErrCallbackNotImplented); + raise ENotImplemented.Create(SErrCallbackNotImplemented); end; function NoCreateCallbackMethod(aFunc: TFunctionCallMethod; aCallConv: TCallConv; aArgs: array of TFunctionCallParameterInfo; aResultType: PTypeInfo; aFlags: TFunctionCallFlags; aContext: Pointer): TFunctionCallCallback; begin Result := Nil; - raise ENotImplemented.Create(SErrCallbackNotImplented); + raise ENotImplemented.Create(SErrCallbackNotImplemented); end; const @@ -2074,7 +2074,7 @@ end; function CreateCallbackProc(aHandler: TFunctionCallProc; aCallConv: TCallConv; aArgs: array of TFunctionCallParameterInfo; aResultType: PTypeInfo; aFlags: TFunctionCallFlags; aContext: Pointer): TFunctionCallCallback; begin if not Assigned(FuncCallMgr[aCallConv].CreateCallbackProc) then - raise ENotImplemented.Create(SErrCallbackNotImplented); + raise ENotImplemented.Create(SErrCallbackNotImplemented); if not Assigned(aHandler) then raise EArgumentNilException.Create(SErrCallbackHandlerNil); @@ -2085,7 +2085,7 @@ end; function CreateCallbackMethod(aHandler: TFunctionCallMethod; aCallConv: TCallConv; aArgs: array of TFunctionCallParameterInfo; aResultType: PTypeInfo; aFlags: TFunctionCallFlags; aContext: Pointer): TFunctionCallCallback; begin if not Assigned(FuncCallMgr[aCallConv].CreateCallbackMethod) then - raise ENotImplemented.Create(SErrCallbackNotImplented); + raise ENotImplemented.Create(SErrCallbackNotImplemented); if not Assigned(aHandler) then raise EArgumentNilException.Create(SErrCallbackHandlerNil); diff --git a/packages/rtl-objpas/src/x86_64/invoke.inc b/packages/rtl-objpas/src/x86_64/invoke.inc index 204fa007f5..9d121ea277 100644 --- a/packages/rtl-objpas/src/x86_64/invoke.inc +++ b/packages/rtl-objpas/src/x86_64/invoke.inc @@ -125,12 +125,6 @@ end; procedure SystemInvoke(aCodeAddress: CodePointer; const aArgs: TFunctionCallParameterArray; aCallConv: TCallConv; aResultType: PTypeInfo; aResultValue: Pointer; aFlags: TFunctionCallFlags); -type - PBoolean16 = ^Boolean16; - PBoolean32 = ^Boolean32; - PBoolean64 = ^Boolean64; - PByteBool = ^ByteBool; - PQWordBool = ^QWordBool; var stackarea: array of PtrUInt; stackptr: Pointer; @@ -518,12 +512,6 @@ begin end; procedure TSystemFunctionCallback.CreateArgInfos; -type - PBoolean16 = ^Boolean16; - PBoolean32 = ^Boolean32; - PBoolean64 = ^Boolean64; - PByteBool = ^ByteBool; - PQWordBool = ^QWordBool; var i, argidx, ofs: LongInt; td: PTypeData; diff --git a/rtl/beos/termiosproc.inc b/rtl/beos/termiosproc.inc index a51e295772..3df62de1b8 100644 --- a/rtl/beos/termiosproc.inc +++ b/rtl/beos/termiosproc.inc @@ -26,7 +26,7 @@ end; Function TCSetAttr(fd:cint;OptAct:cint;const tios:TermIOS):cint; var - nr:cint; + nr:TIOCtlRequest; begin case OptAct of TCSANOW : nr:=TIOCSETA; diff --git a/rtl/darwin/aarch64/sighnd.inc b/rtl/darwin/aarch64/sighnd.inc index e9a7d420f9..abd446d52b 100644 --- a/rtl/darwin/aarch64/sighnd.inc +++ b/rtl/darwin/aarch64/sighnd.inc @@ -23,8 +23,8 @@ begin SIGFPE : begin Case Info^.si_code Of - FPE_FLTDIV, - FPE_INTDIV : Res:=200; { floating point divide by zero } + FPE_FLTDIV : Res:=200; { floating point divide by zero } + FPE_INTDIV : Res:=208; { integer divide by zero } FPE_FLTOVF : Res:=205; { floating point overflow } FPE_FLTUND : Res:=206; { floating point underflow } FPE_FLTRES, { floating point inexact result } diff --git a/rtl/darwin/arm/sighnd.inc b/rtl/darwin/arm/sighnd.inc index 0a30e8ee79..a735c2aed1 100644 --- a/rtl/darwin/arm/sighnd.inc +++ b/rtl/darwin/arm/sighnd.inc @@ -24,8 +24,8 @@ begin SIGFPE : begin Case Info^.si_code Of - FPE_FLTDIV, - FPE_INTDIV : Res:=200; { floating point divide by zero } + FPE_FLTDIV : Res:=208; { floating point divide by zero } + FPE_INTDIV : Res:=200; { integer point divide by zero } FPE_FLTOVF : Res:=205; { floating point overflow } FPE_FLTUND : Res:=206; { floating point underflow } FPE_FLTRES, { floating point inexact result } diff --git a/rtl/darwin/ppcgen/ppchnd.inc b/rtl/darwin/ppcgen/ppchnd.inc index 7718ae84a5..21459f11e3 100644 --- a/rtl/darwin/ppcgen/ppchnd.inc +++ b/rtl/darwin/ppcgen/ppchnd.inc @@ -24,8 +24,8 @@ begin SIGFPE : begin Case Info^.si_code Of - FPE_FLTDIV, - FPE_INTDIV : Res:=200; { floating point divide by zero } + FPE_FLTDIV : Res:=208; { floating point divide by zero } + FPE_INTDIV : Res:=200; { integer divide by zero } FPE_FLTOVF : Res:=205; { floating point overflow } FPE_FLTUND : Res:=206; { floating point underflow } FPE_FLTRES, { floating point inexact result } diff --git a/rtl/darwin/termiosproc.inc b/rtl/darwin/termiosproc.inc index 6da3055811..9e1a645c11 100644 --- a/rtl/darwin/termiosproc.inc +++ b/rtl/darwin/termiosproc.inc @@ -25,7 +25,7 @@ end; Function TCSetAttr(fd:cint;OptAct:cint;const tios:TermIOS):cint; var - nr:culong; + nr:TIOCtlRequest; begin case OptAct of TCSANOW : nr:=TIOCSETA; diff --git a/rtl/darwin/x86/x86hnd.inc b/rtl/darwin/x86/x86hnd.inc index a32040dc16..b3f94a50ad 100644 --- a/rtl/darwin/x86/x86hnd.inc +++ b/rtl/darwin/x86/x86hnd.inc @@ -25,13 +25,13 @@ begin SIGFPE : begin Case Info^.si_code Of - FPE_INTDIV, { integer divide by zero -NOTIMP on Mac OS X 10.4.7 } - FPE_FLTDIV : Res:=200; { floating point divide by zero } + FPE_INTDIV : Res:=200; { integer divide by zero -NOTIMP on Mac OS X 10.4.7 } + FPE_FLTDIV : Res:=208; { floating point divide by zero } FPE_FLTOVF : Res:=205; { floating point overflow } FPE_FLTUND : Res:=206; { floating point underflow } FPE_FLTRES, { floating point inexact result } FPE_FLTINV : Res:=207; { invalid floating point operation } - Else + else begin { Assume that if an integer divide was executed, the } { error was a divide-by-zero (FPE_INTDIV is not } diff --git a/rtl/haiku/termiosproc.inc b/rtl/haiku/termiosproc.inc index a51e295772..41c28f539e 100644 --- a/rtl/haiku/termiosproc.inc +++ b/rtl/haiku/termiosproc.inc @@ -26,7 +26,7 @@ end; Function TCSetAttr(fd:cint;OptAct:cint;const tios:TermIOS):cint; var - nr:cint; + nr: TIOCtlRequest; begin case OptAct of TCSANOW : nr:=TIOCSETA; diff --git a/rtl/inc/systemh.inc b/rtl/inc/systemh.inc index 460b355493..27888c48a4 100644 --- a/rtl/inc/systemh.inc +++ b/rtl/inc/systemh.inc @@ -597,8 +597,18 @@ Type PPCodePointer = ^PCodePointer; PBoolean = ^Boolean; + +{$IFNDEF VER3_0} + PBoolean8 = ^Boolean8; +{$ENDIF VER3_0} + PBoolean16 = ^Boolean16; + PBoolean32 = ^Boolean32; + PBoolean64 = ^Boolean64; + + PByteBool = ^ByteBool; PWordBool = ^WordBool; PLongBool = ^LongBool; + PQWordBool = ^QWordBool; PNativeInt = ^NativeInt; PNativeUInt = ^NativeUint; diff --git a/rtl/linux/sparcgen/sysnr.inc b/rtl/linux/sparcgen/sysnr.inc index 0363d70b57..8fb10826c2 100644 --- a/rtl/linux/sparcgen/sysnr.inc +++ b/rtl/linux/sparcgen/sysnr.inc @@ -20,6 +20,7 @@ } Const + syscall_nr_restart_syscall = 0 ; // Linux Specific syscall_nr_exit = 1 ; // Common syscall_nr_fork = 2 ; // Common syscall_nr_read = 3 ; // Common @@ -44,17 +45,21 @@ Const syscall_nr_capset = 22 ; // Linux Specific syscall_nr_setuid = 23 ; // Implemented via setreuid in SunOS syscall_nr_getuid = 24 ; // Common -// syscall_nr_time alias = 25 ENOSYS under SunOS + syscall_nr_vmsplice = 25 ; // ENOSYS under SunOS syscall_nr_ptrace = 26 ; // Common syscall_nr_alarm = 27 ; // Implemented via setitimer in SunOS syscall_nr_sigaltstack = 28 ; // Common syscall_nr_pause = 29 ; // Is sigblock(0)->sigpause() in SunOS syscall_nr_utime = 30 ; // Implemented via utimes() under SunOS +{$ifndef CPUSPARC64} syscall_nr_lchown32 = 31 ; // Linux sparc32 specific syscall_nr_fchown32 = 32 ; // Linux sparc32 specific +{$endif ndef CPUSPARC64} syscall_nr_access = 33 ; // Common syscall_nr_nice = 34 ; // Implemented via get/setpriority() in SunOS +{$ifndef CPUSPARC64} syscall_nr_chown32 = 35 ; // Linux sparc32 specific +{$endif ndef CPUSPARC64} syscall_nr_sync = 36 ; // Common syscall_nr_kill = 37 ; // Common syscall_nr_stat = 38 ; // Common @@ -63,7 +68,9 @@ Const syscall_nr_dup = 41 ; // Common syscall_nr_pipe = 42 ; // Common syscall_nr_times = 43 ; // Implemented via getrusage() in SunOS +{$ifndef CPUSPARC64} syscall_nr_getuid32 = 44 ; // Linux sparc32 specific +{$endif ndef CPUSPARC64} syscall_nr_umount2 = 45 ; // Linux Specific syscall_nr_setgid = 46 ; // Implemented via setregid() in SunOS syscall_nr_getgid = 47 ; // Common @@ -72,10 +79,14 @@ Const syscall_nr_getegid = 50 ; // SunOS calls getgid() syscall_nr_acct = 51 ; // Common // syscall_nr_memory_ordering= 52 Linux sparc64 specific +{$ifndef CPUSPARC64} syscall_nr_getgid32 = 53 ; // Linux sparc32 specific +{$endif ndef CPUSPARC64} syscall_nr_ioctl = 54 ; // Common syscall_nr_reboot = 55 ; // Common +{$ifndef CPUSPARC64} syscall_nr_mmap2 = 56 ; // Linux sparc32 Specific +{$endif ndef CPUSPARC64} syscall_nr_symlink = 57 ; // Common syscall_nr_readlink = 58 ; // Common syscall_nr_execve = 59 ; // Common @@ -88,32 +99,50 @@ Const syscall_nr_vfork = 66 ; // Common syscall_nr_pread64 = 67 ; // Linux Specific syscall_nr_pwrite64 = 68 ; // Linux Specific +{$ifndef CPUSPARC64} syscall_nr_geteuid32 = 69 ; // Linux sparc32, sbrk under SunOS syscall_nr_getegid32 = 70 ; // Linux sparc32, sstk under SunOS +{$endif ndef CPUSPARC64} syscall_nr_mmap = 71 ; // Common +{$ifndef CPUSPARC64} syscall_nr_setreuid32 = 72 ; // Linux sparc32, vadvise under SunOS +{$endif ndef CPUSPARC64} syscall_nr_munmap = 73 ; // Common syscall_nr_mprotect = 74 ; // Common syscall_nr_madvise = 75 ; // Common syscall_nr_vhangup = 76 ; // Common +{$ifndef CPUSPARC64} syscall_nr_truncate64 = 77 ; // Linux sparc32 Specific +{$endif ndef CPUSPARC64} syscall_nr_mincore = 78 ; // Common syscall_nr_getgroups = 79 ; // Common syscall_nr_setgroups = 80 ; // Common syscall_nr_getpgrp = 81 ; // Common +{$ifndef CPUSPARC64} syscall_nr_setgroups32 = 82 ; // Linux sparc32, setpgrp under SunOS +{$endif ndef CPUSPARC64} syscall_nr_setitimer = 83 ; // Common +{$ifndef CPUSPARC64} syscall_nr_ftruncate64 = 84 ; // Linux sparc32 Specific +{$endif ndef CPUSPARC64} syscall_nr_swapon = 85 ; // Common syscall_nr_getitimer = 86 ; // Common +{$ifndef CPUSPARC64} syscall_nr_setuid32 = 87 ; // Linux sparc32, gethostname under SunOS +{$endif ndef CPUSPARC64} syscall_nr_sethostname = 88 ; // Common +{$ifndef CPUSPARC64} syscall_nr_setgid32 = 89 ; // Linux sparc32, getdtablesize under SunOS +{$endif ndef CPUSPARC64} syscall_nr_dup2 = 90 ; // Common +{$ifndef CPUSPARC64} syscall_nr_setfsuid32 = 91 ; // Linux sparc32, getdopt under SunOS +{$endif ndef CPUSPARC64} syscall_nr_fcntl = 92 ; // Common syscall_nr_select = 93 ; // Common +{$ifndef CPUSPARC64} syscall_nr_setfsgid32 = 94 ; // Linux sparc32, setdopt under SunOS +{$endif ndef CPUSPARC64} syscall_nr_fsync = 95 ; // Common syscall_nr_setpriority = 96 ; // Common syscall_nr_socket = 97 ; // Common @@ -127,14 +156,23 @@ Const syscall_nr_rt_sigtimedwait = 105 ; // Linux Specific syscall_nr_rt_sigqueueinfo = 106 ; // Linux Specific syscall_nr_rt_sigsuspend = 107 ; // Linux Specific +{$ifndef CPUSPARC64} syscall_nr_setresuid32 = 108 ; // Linux Specific, sigvec under SunOS syscall_nr_getresuid32 = 109 ; // Linux Specific, sigblock under SunOS syscall_nr_setresgid32 = 110 ; // Linux Specific, sigsetmask under SunOS syscall_nr_getresgid32 = 111 ; // Linux Specific, sigpause under SunOS syscall_nr_setregid32 = 112 ; // Linux sparc32, sigstack under SunOS +{$else} + syscall_nr_setresuid = 108 ; // Linux Specific, sigvec under SunOS + syscall_nr_getresuid = 109 ; // Linux Specific, sigblock under SunOS + syscall_nr_setresgid = 110 ; // Linux Specific, sigsetmask under SunOS + syscall_nr_getresgid = 111 ; // Linux Specific, sigpause under SunOS +{$endif} syscall_nr_recvmsg = 113 ; // Common syscall_nr_sendmsg = 114 ; // Common +{$ifndef CPUSPARC64} syscall_nr_getgroups32 = 115 ; // Linux sparc32, vtrace under SunOS +{$endif ndef CPUSPARC64} syscall_nr_gettimeofday = 116 ; // Common syscall_nr_getrusage = 117 ; // Common syscall_nr_getsockopt = 118 ; // Common @@ -159,9 +197,8 @@ Const syscall_nr_rmdir = 137 ; // Common syscall_nr_utimes = 138 ; // SunOS Specific syscall_nr_stat64 = 139 ; // Linux sparc32 Specific -// syscall_nr_adjtime = 140 SunOS Specific + syscall_nr_sendfile64 = 140 ; // adjtime under SunOS syscall_nr_getpeername = 141 ; // Common -// syscall_nr_gethostid = 142 SunOS Specific syscall_nr_futex = 142 ; // gethostid under SunOS syscall_nr_gettid = 143 ; // ENOSYS under SunOS syscall_nr_getrlimit = 144 ; // Common @@ -175,48 +212,52 @@ Const syscall_nr_inotify_add_watch= 152 ; // Linux specific syscall_nr_poll = 153 ; // Common syscall_nr_getdents64 = 154 ; // Linux specific +{$ifndef CPUSPARC64} syscall_nr_fcntl64 = 155 ; // Linux sparc32 Specific +{$endif ndef CPUSPARC64} syscall_nr_inotify_rm_watch = 156 ; // Linux specific syscall_nr_statfs = 157 ; // Common syscall_nr_fstatfs = 158 ; // Common syscall_nr_umount = 159 ; // Common -// syscall_nr_async_daemon = 160 SunOS Specific -// syscall_nr_getfh = 161 SunOS Specific + syscall_nr_sched_set_affinity = 160; // Linux specific, async_daemon under SunOS + syscall_nr_sched_get_affinity = 161; // Linux specific, getfh under SunOS syscall_nr_getdomainname = 162 ; // SunOS Specific syscall_nr_setdomainname = 163 ; // Common -// syscall_nr_ni_syscall = 164 ENOSYS under SunOS +{$ifdef CPUSPARC64} + syscall_nr_utrap_install = 164 ; // SYSV ABI/v9 required +{$endif def CPUSPARC64} syscall_nr_quotactl = 165 ; // Common -// syscall_nr_exportfs = 166 SunOS Specific + syscall_nr_set_tid_address = 166 ; // Linux specific, exportfs under SunOS syscall_nr_mount = 167 ; // Common syscall_nr_ustat = 168 ; // Common -// syscall_nr_semsys = 169 SunOS Specific -// syscall_nr_msgsys = 170 SunOS Specific -// syscall_nr_shmsys = 171 SunOS Specific -// syscall_nr_auditsys = 172 SunOS Specific -// syscall_nr_rfssys = 173 SunOS Specific + syscall_nr_setxattr = 169 ; // SunOS: semsys + syscall_nr_lsetxattr = 170 ; // SunOS: msgsys + syscall_nr_fsetxattr = 171 ; // SunOS: shmsys + syscall_nr_getxattr = 172 ; // SunOS: auditsys + syscall_nr_lgetxattr = 173 ; // SunOS: rfssys syscall_nr_getdents = 174 ; // Common syscall_nr_setsid = 175 ; // Common syscall_nr_fchdir = 176 ; // Common -// syscall_nr_fchroot = 177 SunOS Specific -// syscall_nr_vpixsys = 178 SunOS Specific -// syscall_nr_aioread = 179 SunOS Specific -// syscall_nr_aiowrite = 180 SunOS Specific -// syscall_nr_aiowait = 181 SunOS Specific -// syscall_nr_aiocancel = 182 SunOS Specific + syscall_nr_fgetxattr = 177 ; // SunOS: fchroot + syscall_nr_listxattr = 178 ; // SunOS: vpixsys + syscall_nr_llistxattr = 179 ; // SunOS: aioread + syscall_nr_flistxattr = 180 ; // SunOS: aiowrite + syscall_nr_removexattr = 181 ; // SunOS: aiowait + syscall_nr_lremovexattr = 182 ; // SunOS: aiocancel syscall_nr_sigpending = 183 ; // Common syscall_nr_query_module = 184 ; // Linux Specific syscall_nr_setpgid = 185 ; // Common -// syscall_nr_pathconf = 186 SunOS Specific + syscall_nr_fremovexattr = 186 ; // SunOS: pathconf syscall_nr_tkill = 187 ; // SunOS: fpathconf syscall_nr_exit_group = 188 ; // SunOS sysconf syscall_nr_uname = 189 ; // Linux Specific syscall_nr_init_module = 190 ; // Linux Specific syscall_nr_personality = 191 ; // Linux Specific -// syscall_nr_prof = 192 Linux Specific + syscall_nr_remap_file_pages = 192 ; // Linux Specific syscall_nr_epoll_create = 193 ; // Linux Specific - was break syscall_nr_epoll_ctl = 194 ; // Linux Specific - was lock syscall_nr_epoll_wait = 195 ; // Linux Specific - was mpx -// syscall_nr_ulimit = 196 Linux Specific + syscall_nr_ioprio_set = 196 ; // Linux Specific syscall_nr_getppid = 197 ; // Linux Specific syscall_nr_sigaction = 198 ; // Linux Specific syscall_nr_sgetmask = 199 ; // Linux Specific @@ -228,17 +269,17 @@ Const syscall_nr_readahead = 205 ; // Linux Specific syscall_nr_socketcall = 206 ; // Linux Specific syscall_nr_syslog = 207 ; // Linux Specific -// syscall_nr_olduname = 208 Linux Specific -// syscall_nr_iopl = 209 Linux Specific - i386 specific, unused -// syscall_nr_idle = 210 Linux Specific - was sys_idle, now unused -// syscall_nr_vm86 = 211 Linux Specific - i386 specific, unused + syscall_nr_lookup_dcookie = 208 ; // Linux Specific + syscall_nr_fadvise64 = 209 ; // Linux Specific + syscall_nr_fadvise64_64 = 210 ; // Linux Specific + syscall_nr_tgkill = 211 ; // Linux Specific syscall_nr_waitpid = 212 ; // Linux Specific syscall_nr_swapoff = 213 ; // Linux Specific syscall_nr_sysinfo = 214 ; // Linux Specific syscall_nr_ipc = 215 ; // Linux Specific syscall_nr_sigreturn = 216 ; // Linux Specific syscall_nr_clone = 217 ; // Linux Specific -// syscall_nr_modify_ldt = 218 Linux Specific - i386 specific, unused + syscall_nr_ioprio_get = 218 ; // Linux Specific syscall_nr_adjtimex = 219 ; // Linux Specific syscall_nr_sigprocmask = 220 ; // Linux Specific syscall_nr_create_module = 221 ; // Linux Specific @@ -251,11 +292,13 @@ Const syscall_nr_setfsuid = 228 ; // Linux Specific syscall_nr_setfsgid = 229 ; // Linux Specific syscall_nr__newselect = 230 ; // Linux Specific +{$ifndef CPUSPARC64} syscall_nr_time = 231 ; // Linux Specific -// syscall_nr_oldstat = 232 Linux Specific +{$endif ndef CPUSPARC64} + syscall_nr_splice = 232 ; // Linux Specific syscall_nr_stime = 233 ; // Linux Specific -// syscall_nr_oldfstat = 234 Linux Specific -// syscall_nr_phys = 235 Linux Specific + syscall_nr_statfs64 = 234 ; // Linux Specific + syscall_nr_fstatfs64 = 235 ; // Linux Specific syscall_nr__llseek = 236 ; // Linux Specific syscall_nr_mlock = 237; syscall_nr_munlock = 238; @@ -287,7 +330,9 @@ Const syscall_nr_timer_getoverrun = 264; syscall_nr_timer_delete = 265; syscall_nr_timer_create = 266; - { syscall_nr_vserver 267 Reserved for VSERVER } +{$ifdef VSERVER} + syscall_nr_vserver = 267; // Reserved for VSERVER +{$endif def VSERVER} syscall_nr_io_setup = 268; syscall_nr_io_destroy = 269; syscall_nr_io_submit = 270; @@ -332,7 +377,7 @@ Const syscall_nr_epoll_pwait = 309; syscall_nr_utimensat = 310; syscall_nr_signalfd = 311; - syscall_nr_timerfd = 312; + syscall_nr_timerfd_create = 312; syscall_nr_eventfd = 313; syscall_nr_fallocate = 314; syscall_nr_timerfd_settime = 315; @@ -381,3 +426,5 @@ Const syscall_nr_preadv2 = 358; syscall_nr_pwritev2 = 359; syscall_nr_statx = 360; + syscall_nr_io_pgetevents = 361; + diff --git a/rtl/linux/t_linux.h2paschk b/rtl/linux/t_linux.h2paschk new file mode 100644 index 0000000000..bef63a0baa --- /dev/null +++ b/rtl/linux/t_linux.h2paschk @@ -0,0 +1,151 @@ +# OpenBSD RTL-to-C structure compatibility checker description file +# +# Use +# h2paschk t_openbsd.h2paschk +# +# ...to generate Pascal and C code, then make sure they both compile and that +# the Pascal program produces the same output as the C program for each +# supported architecture. + +@Pascal uses baseunix; +@Pascal begin +@C #define _LARGEFILE_SOURCE 1 +@C #define _FILE_OFFSET_BITS 64 +## @C #define _USE_FILE_OFFSET64 + +@C #include <sys/types.h> +@C #include <sys/stat.h> +@C #include <sys/statfs.h> +@C #include <sys/mount.h> +@C #include <sys/time.h> +@C #include <sys/times.h> +@C #include <sys/resource.h> +@C #include <sys/uio.h> +@C #include <dirent.h> +@C #include <poll.h> +@C #include <utime.h> +@C #include <fcntl.h> +@C #include <unistd.h> +@C #include <stdio.h> +@C #include <stddef.h> +@C int main() +@C { + +@record timespec,struct timespec +.tv_sec +.tv_nsec + +@record stat,struct stat +.st_dev +.st_ino +.st_mode +#.st_padding0 +.st_nlink +.st_uid +.st_gid +#.st_padding1 +.st_rdev +.st_size +.st_blocks +.st_blksize +.st_atime,st_atim.tv_sec +.st_atime_nsec,st_atim.tv_nsec +.st_mtime,st_mtim.tv_sec +.st_mtime_nsec,st_mtim.tv_nsec +.st_ctime,st_ctim.tv_sec +.st_ctime_nsec,st_ctim.tv_nsec +@Pascal {$if defined (CPUPOWERPC) or defined(CPUPOWERPC64)} +@C #ifdef __powerpc__ +.__unused4 +.__unused5 +@Pascal {$ifdef CPU64} +@C #ifdef __LP64__ +.__unused6 +@C #endif +@Pascal {$endif CPU64} +@C #endif +@Pascal {$endif powerpc} +#.st_flags +#.st_gen + +@record dirent,struct dirent +.d_fileno +.d_off +.d_reclen +.d_type +#.d_pad0 +#.d_namlen +#.d_pad1 +.d_name + +@record TStatFs,struct statfs +.fstype,f_type +.bsize,f_bsize +.blocks,f_blocks +.bfree,f_bfree +.bavail,f_bavail +.files,f_files +.ffree,f_ffree +.fsid,f_fsid +.namelen,f_namelen +.frsize,f_frsize +.flags,f_flags +.spare,f_spare + +@record pollfd,struct pollfd +.fd +.events +.revents + +@record utimbuf,struct utimbuf +.actime +.modtime + +@record flock,struct flock +.l_start +.l_len +.l_pid +.l_type +.l_whence + +@record tms,struct tms +.tms_utime +.tms_stime +.tms_cutime +.tms_cstime + +@record timezone,struct timezone +.tz_minuteswest +.tz_dsttime + +#@record rusage,struct rusage +#.ru_utime +#.ru_stime +#.ru_maxrss +#.ru_ixrss +#.ru_idrss +#.ru_isrss +#.ru_minflt +#.ru_majflt +#.ru_nswap +#.ru_inblock +#.ru_oublock +#.ru_msgsnd +#.ru_msgrcv +#.ru_nsignals +#.ru_nvcsw +#.ru_nivcsw + +@record TRLimit,struct rlimit +.rlim_cur +.rlim_max + +@record iovec,struct iovec +.iov_base +.iov_len + +@C return 0; +@C } + +@Pascal end. + diff --git a/rtl/linux/termiosproc.inc b/rtl/linux/termiosproc.inc index 90c54856da..b2e9ae9fa2 100644 --- a/rtl/linux/termiosproc.inc +++ b/rtl/linux/termiosproc.inc @@ -15,7 +15,7 @@ end; Function TCSetAttr(fd:cint;OptAct:cint;const tios:TermIOS):cint; var - nr:culong; + nr:TIOCtlRequest; begin case OptAct of TCSANOW : nr:=TCSETS; diff --git a/rtl/netbsd/termiosproc.inc b/rtl/netbsd/termiosproc.inc index b18790c2ca..ac04fdd77a 100644 --- a/rtl/netbsd/termiosproc.inc +++ b/rtl/netbsd/termiosproc.inc @@ -26,7 +26,7 @@ end; Function TCSetAttr(fd:cint;OptAct:cint;const tios:TermIOS):cint; var - nr:cint; + nr:TIOCtlRequest; begin case OptAct of TCSANOW : nr:=TIOCSETA; diff --git a/rtl/objpas/classes/classesh.inc b/rtl/objpas/classes/classesh.inc index 2c31a44090..119a777980 100644 --- a/rtl/objpas/classes/classesh.inc +++ b/rtl/objpas/classes/classesh.inc @@ -894,13 +894,162 @@ type procedure SetSize(const NewSize: Int64); virtual;overload; procedure ReadNotImplemented; procedure WriteNotImplemented; + function ReadMaxSizeData(Var Buffer; aSize,aCount : NativeInt) : NativeInt; + Procedure ReadExactSizeData(Var Buffer; aSize,aCount : NativeInt); + function WriteMaxSizeData(Const Buffer; aSize,aCount : NativeInt) : NativeInt; + Procedure WriteExactSizeData(Const Buffer; aSize,aCount : NativeInt); public function Read(var Buffer; Count: Longint): Longint; virtual; + function Read(Buffer: TBytes; Count: Longint): Longint; overload; + function Read(Buffer : TBytes; aOffset, Count: Longint): Longint; overload; + + function Write(const Buffer: TBytes; Offset, Count: Longint): Longint; overload; + function Write(const Buffer: TBytes; Count: Longint): Longint; overload; function Write(const Buffer; Count: Longint): Longint; virtual; + function Seek(Offset: Longint; Origin: Word): Longint; virtual; overload; function Seek(const Offset: Int64; Origin: TSeekOrigin): Int64; virtual; overload; + + function ReadData(Buffer: Pointer; Count: NativeInt): NativeInt; overload; + function ReadData(const Buffer: TBytes; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: Boolean): NativeInt; overload; + function ReadData(var Buffer: Boolean; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: AnsiChar): NativeInt; overload; + function ReadData(var Buffer: AnsiChar; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: WideChar): NativeInt; overload; + function ReadData(var Buffer: WideChar; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: Int8): NativeInt; overload; + function ReadData(var Buffer: Int8; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: UInt8): NativeInt; overload; + function ReadData(var Buffer: UInt8; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: Int16): NativeInt; overload; + function ReadData(var Buffer: Int16; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: UInt16): NativeInt; overload; + function ReadData(var Buffer: UInt16; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: Int32): NativeInt; overload; + function ReadData(var Buffer: Int32; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: UInt32): NativeInt; overload; + function ReadData(var Buffer: UInt32; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: Int64): NativeInt; overload; + function ReadData(var Buffer: Int64; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: UInt64): NativeInt; overload; + function ReadData(var Buffer: UInt64; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: Single): NativeInt; overload; + function ReadData(var Buffer: Single; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: Double): NativeInt; overload; + function ReadData(var Buffer: Double; Count: NativeInt): NativeInt; overload; +{$IFDEF FPC_HAS_TYPE_EXTENDED} + function ReadData(var Buffer: Extended): NativeInt; overload; + function ReadData(var Buffer: Extended; Count: NativeInt): NativeInt; overload; + function ReadData(var Buffer: TExtended80Rec): NativeInt; overload; + function ReadData(var Buffer: TExtended80Rec; Count: NativeInt): NativeInt; overload; +{$ENDIF} procedure ReadBuffer(var Buffer; Count: Longint); + procedure ReadBuffer(var Buffer: TBytes; Count: NativeInt); overload; + procedure ReadBuffer(var Buffer: TBytes; Offset, Count: NativeInt); overload; + + procedure ReadBufferData(var Buffer: Boolean); overload; + procedure ReadBufferData(var Buffer: Boolean; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: AnsiChar); overload; + procedure ReadBufferData(var Buffer: AnsiChar; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: WideChar); overload; + procedure ReadBufferData(var Buffer: WideChar; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: Int8); overload; + procedure ReadBufferData(var Buffer: Int8; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: UInt8); overload; + procedure ReadBufferData(var Buffer: UInt8; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: Int16); overload; + procedure ReadBufferData(var Buffer: Int16; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: UInt16); overload; + procedure ReadBufferData(var Buffer: UInt16; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: Int32); overload; + procedure ReadBufferData(var Buffer: Int32; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: UInt32); overload; + procedure ReadBufferData(var Buffer: UInt32; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: Int64); overload; + procedure ReadBufferData(var Buffer: Int64; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: UInt64); overload; + procedure ReadBufferData(var Buffer: UInt64; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: Single); overload; + procedure ReadBufferData(var Buffer: Single; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: Double); overload; + procedure ReadBufferData(var Buffer: Double; Count: NativeInt); overload; +{$IFDEF FPC_HAS_TYPE_EXTENDED} + procedure ReadBufferData(var Buffer: Extended); overload; + procedure ReadBufferData(var Buffer: Extended; Count: NativeInt); overload; + procedure ReadBufferData(var Buffer: TExtended80Rec); overload; + procedure ReadBufferData(var Buffer: TExtended80Rec; Count: NativeInt); overload; +{$ENDIF} procedure WriteBuffer(const Buffer; Count: Longint); + procedure WriteBuffer(const Buffer: TBytes; Count: NativeInt); overload; + procedure WriteBuffer(const Buffer: TBytes; Offset, Count: NativeInt); overload; + + function WriteData(const Buffer: TBytes; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: Pointer; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: Boolean): NativeInt; overload; + function WriteData(const Buffer: Boolean; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: AnsiChar): NativeInt; overload; + function WriteData(const Buffer: AnsiChar; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: WideChar): NativeInt; overload; + function WriteData(const Buffer: WideChar; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: Int8): NativeInt; overload; + function WriteData(const Buffer: Int8; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: UInt8): NativeInt; overload; + function WriteData(const Buffer: UInt8; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: Int16): NativeInt; overload; + function WriteData(const Buffer: Int16; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: UInt16): NativeInt; overload; + function WriteData(const Buffer: UInt16; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: Int32): NativeInt; overload; + function WriteData(const Buffer: Int32; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: UInt32): NativeInt; overload; + function WriteData(const Buffer: UInt32; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: Int64): NativeInt; overload; + function WriteData(const Buffer: Int64; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: UInt64): NativeInt; overload; + function WriteData(const Buffer: UInt64; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: Single): NativeInt; overload; + function WriteData(const Buffer: Single; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: Double): NativeInt; overload; + function WriteData(const Buffer: Double; Count: NativeInt): NativeInt; overload; +{$IFDEF FPC_HAS_TYPE_EXTENDED} + function WriteData(const Buffer: Extended): NativeInt; overload; + function WriteData(const Buffer: Extended; Count: NativeInt): NativeInt; overload; + function WriteData(const Buffer: TExtended80Rec): NativeInt; overload; + function WriteData(const Buffer: TExtended80Rec; Count: NativeInt): NativeInt; overload; +{$ENDIF} + procedure WriteBufferData(Buffer: Integer); overload; + procedure WriteBufferData(Buffer: Integer; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: Boolean); overload; + procedure WriteBufferData(Buffer: Boolean; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: AnsiChar); overload; + procedure WriteBufferData(Buffer: AnsiChar; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: WideChar); overload; + procedure WriteBufferData(Buffer: WideChar; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: Int8); overload; + procedure WriteBufferData(Buffer: Int8; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: UInt8); overload; + procedure WriteBufferData(Buffer: UInt8; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: Int16); overload; + procedure WriteBufferData(Buffer: Int16; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: UInt16); overload; + procedure WriteBufferData(Buffer: UInt16; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: UInt32); overload; + procedure WriteBufferData(Buffer: UInt32; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: Int64); overload; + procedure WriteBufferData(Buffer: Int64; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: UInt64); overload; + procedure WriteBufferData(Buffer: UInt64; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: Single); overload; + procedure WriteBufferData(Buffer: Single; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: Double); overload; + procedure WriteBufferData(Buffer: Double; Count: NativeInt); overload; +{$IFDEF FPC_HAS_TYPE_EXTENDED} + procedure WriteBufferData(Buffer: Extended); overload; + procedure WriteBufferData(Buffer: Extended; Count: NativeInt); overload; + procedure WriteBufferData(Buffer: TExtended80Rec); overload; + procedure WriteBufferData(Buffer: TExtended80Rec; Count: NativeInt); overload; +{$ENDIF} function CopyFrom(Source: TStream; Count: Int64): Int64; function ReadComponent(Instance: TComponent): TComponent; function ReadComponentRes(Instance: TComponent): TComponent; @@ -990,6 +1139,7 @@ type private FMemory: Pointer; FSize, FPosition: PtrInt; + FSizeBoundsSeek : Boolean; protected Function GetSize : Int64; Override; function GetPosition: Int64; Override; @@ -1000,6 +1150,7 @@ type procedure SaveToStream(Stream: TStream); procedure SaveToFile(const FileName: string); property Memory: Pointer read FMemory; + Property SizeBoundsSeek : Boolean Read FSizeBoundsSeek Write FSizeBoundsSeek; end; { TMemoryStream } diff --git a/rtl/objpas/classes/streams.inc b/rtl/objpas/classes/streams.inc index ac842738c9..fe5d7ed0d9 100644 --- a/rtl/objpas/classes/streams.inc +++ b/rtl/objpas/classes/streams.inc @@ -30,6 +30,26 @@ begin Result := 0; end; +function TStream.Read(Buffer: TBytes; Count: Longint): Longint; +begin + Result:=Read(Buffer,0,Count); +end; + +function TStream.Read(Buffer: TBytes; aOffset, Count: Longint): Longint; +begin + Result:=Read(Buffer[aOffset],Count); +end; + +function TStream.Write(const Buffer: TBytes; Offset, Count: Longint): Longint; +begin + Result:=Write(Buffer[Offset],Count); +end; + +function TStream.Write(const Buffer: TBytes; Count: Longint): Longint; +begin + Result:=Write(Buffer,0,Count); +end; + function TStream.Write(const Buffer; Count: Longint): Longint; begin WriteNotImplemented; @@ -178,35 +198,728 @@ end; Result:=Seek(longint(Offset),ord(Origin)); end; - procedure TStream.ReadBuffer(var Buffer; Count: Longint); + function TStream.ReadData(Buffer: Pointer; Count: NativeInt): NativeInt; + begin + Result:=Read(Buffer^,Count); + end; - Var - r,t : longint; + function TStream.ReadData(const Buffer: TBytes; Count: NativeInt): NativeInt; + begin + Result:=Read(Buffer,0,Count); + end; + + function TStream.ReadData(var Buffer: Boolean): NativeInt; + begin + Result:=Read(Buffer,sizeOf(Buffer)); + end; + +function TStream.ReadMaxSizeData(Var Buffer; aSize,aCount : NativeInt) : NativeInt; + +Var + CP : Int64; + +begin + if aCount<=aSize then + Result:=read(Buffer,aCount) + else + begin + Result:=Read(Buffer,aSize); + CP:=Position; + Result:=Result+Seek(aCount-aSize,soCurrent)-CP; + end +end; + +function TStream.WriteMaxSizeData(Const Buffer; aSize,aCount : NativeInt) : NativeInt; +Var + CP : Int64; + +begin + if aCount<=aSize then + Result:=Write(Buffer,aCount) + else + begin + Result:=Write(Buffer,aSize); + CP:=Position; + Result:=Result+Seek(aCount-aSize,soCurrent)-CP; + end +end; + +procedure TStream.WriteExactSizeData(const Buffer; aSize, aCount: NativeInt); +begin + // Embarcadero docs mentions no exception. Does not seem very logical + WriteMaxSizeData(Buffer,aSize,ACount); +end; + +procedure TStream.ReadExactSizeData(var Buffer; aSize, aCount: NativeInt); +begin + if ReadMaxSizeData(Buffer,aSize,ACount)<>aCount then + Raise EReadError.Create(SReadError); +end; + + +function TStream.ReadData(var Buffer: Boolean; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: AnsiChar): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: AnsiChar; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: WideChar): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: WideChar; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: Int8): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: Int8; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: UInt8): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: UInt8; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: Int16): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: Int16; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: UInt16): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: UInt16; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: Int32): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: Int32; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: UInt32): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: UInt32; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: Int64): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: Int64; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: UInt64): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: UInt64; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: Single): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: Single; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: Double): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: Double; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +{$IFDEF FPC_HAS_TYPE_EXTENDED} +function TStream.ReadData(var Buffer: Extended): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: Extended; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.ReadData(var Buffer: TExtended80Rec): NativeInt; +begin + Result:=Read(Buffer,sizeOf(Buffer)); +end; + +function TStream.ReadData(var Buffer: TExtended80Rec; Count: NativeInt): NativeInt; +begin + Result:=ReadMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; +{$ENDIF} + +procedure TStream.ReadBuffer(var Buffer; Count: Longint); + +Var + r,t : longint; + +begin + t:=0; + repeat + r:=Read(PByte(@Buffer)[t],Count-t); + inc(t,r); + until (t=Count) or (r<=0); + if (t<Count) then + Raise EReadError.Create(SReadError); +end; + +procedure TStream.ReadBuffer(var Buffer: TBytes; Count: NativeInt); +begin + ReadBuffer(Buffer,0,Count); +end; + +procedure TStream.ReadBuffer(var Buffer: TBytes; Offset, Count: NativeInt); +begin + ReadBuffer(Buffer[OffSet],Count); +end; + +procedure TStream.ReadBufferData(var Buffer: Boolean); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: Boolean; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: AnsiChar); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: AnsiChar; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: WideChar); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: WideChar; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: Int8); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: Int8; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: UInt8); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: UInt8; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: Int16); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: Int16; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: UInt16); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: UInt16; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: Int32); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: Int32; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: UInt32); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: UInt32; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: Int64); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: Int64; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: UInt64); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: UInt64; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: Single); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: Single; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: Double); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: Double; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +{$IFDEF FPC_HAS_TYPE_EXTENDED} +procedure TStream.ReadBufferData(var Buffer: Extended); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: Extended; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.ReadBufferData(var Buffer: TExtended80Rec); +begin + ReadBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.ReadBufferData(var Buffer: TExtended80Rec; Count: NativeInt); +begin + ReadExactSizeData(Buffer,SizeOf(Buffer),Count); +end; +{$ENDIF} + +procedure TStream.WriteBuffer(const Buffer; Count: Longint); + +var + r,t : Longint; begin - t:=0; - repeat - r:=Read(PByte(@Buffer)[t],Count-t); - inc(t,r); - until (t=Count) or (r<=0); + T:=0; + Repeat + r:=Write(PByte(@Buffer)[t],Count-t); + inc(t,r); + Until (t=count) or (r<=0); if (t<Count) then - Raise EReadError.Create(SReadError); + Raise EWriteError.Create(SWriteError); end; - procedure TStream.WriteBuffer(const Buffer; Count: Longint); +procedure TStream.WriteBuffer(const Buffer: TBytes; Count: NativeInt); +begin + WriteBuffer(Buffer,0,Count); +end; - var - r,t : Longint; +procedure TStream.WriteBuffer(const Buffer: TBytes; Offset, Count: NativeInt); +begin + WriteBuffer(Buffer[Offset],Count); +end; - begin - T:=0; - Repeat - r:=Write(PByte(@Buffer)[t],Count-t); - inc(t,r); - Until (t=count) or (r<=0); - if (t<Count) then - Raise EWriteError.Create(SWriteError); - end; +function TStream.WriteData(const Buffer: TBytes; Count: NativeInt): NativeInt; +begin + Result:=Write(Buffer, 0, Count); +end; + +function TStream.WriteData(const Buffer: Pointer; Count: NativeInt): NativeInt; +begin + Result:=Write(Buffer^, Count); +end; + +function TStream.WriteData(const Buffer: Boolean): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: Boolean; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: AnsiChar): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: AnsiChar; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: WideChar): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: WideChar; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: Int8): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: Int8; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: UInt8): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: UInt8; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: Int16): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: Int16; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: UInt16): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: UInt16; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: Int32): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: Int32; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: UInt32): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: UInt32; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: Int64): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: Int64; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: UInt64): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: UInt64; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: Single): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: Single; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: Double): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: Double; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +{$IFDEF FPC_HAS_TYPE_EXTENDED} +function TStream.WriteData(const Buffer: Extended): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: Extended; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +function TStream.WriteData(const Buffer: TExtended80Rec): NativeInt; +begin + Result:=Write(Buffer,SizeOf(Buffer)); +end; + +function TStream.WriteData(const Buffer: TExtended80Rec; Count: NativeInt): NativeInt; +begin + Result:=WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; +{$ENDIF} + +procedure TStream.WriteBufferData(Buffer: Integer); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: Integer; Count: NativeInt); +begin + WriteMaxSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: Boolean); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: Boolean; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: AnsiChar); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: AnsiChar; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: WideChar); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: WideChar; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: Int8); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: Int8; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: UInt8); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: UInt8; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: Int16); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: Int16; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: UInt16); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: UInt16; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: UInt32); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: UInt32; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: Int64); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: Int64; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: UInt64); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: UInt64; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: Single); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: Single; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: Double); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: Double; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + + +{$IFDEF FPC_HAS_TYPE_EXTENDED} +procedure TStream.WriteBufferData(Buffer: Extended); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: Extended; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; + +procedure TStream.WriteBufferData(Buffer: TExtended80Rec); +begin + WriteBuffer(Buffer,SizeOf(Buffer)); +end; + +procedure TStream.WriteBufferData(Buffer: TExtended80Rec; Count: NativeInt); +begin + WriteExactSizeData(Buffer,SizeOf(Buffer),Count); +end; +{$ENDIF} function TStream.CopyFrom(Source: TStream; Count: Int64): Int64; @@ -447,6 +1160,7 @@ end; TheSize : Longint; P : PByte ; begin + Result:=''; ReadBuffer (TheSize,SizeOf(TheSize)); SetLength(Result,TheSize); // Illegal typecast if no AnsiStrings defined. @@ -621,6 +1335,8 @@ begin soFromEnd : FPosition:=FSize+Offset; soFromCurrent : FPosition:=FPosition+Offset; end; + if SizeBoundsSeek and (FPosition>FSize) then + FPosition:=FSize; Result:=FPosition; {$IFDEF DEBUG} if Result < 0 then @@ -1155,7 +1871,7 @@ begin sz := sizeof(Buffer) else sz := cb; - sz := FStream.Read(buffer, sz); + sz := FStream.Read(buffer[0],sz); inc(cbRead, sz); stm.Write(@buffer[0], sz, @sz); inc(cbWritten, sz); diff --git a/rtl/openbsd/t_openbsd.h2paschk b/rtl/openbsd/t_openbsd.h2paschk index 21de631feb..6d98b40c80 100644 --- a/rtl/openbsd/t_openbsd.h2paschk +++ b/rtl/openbsd/t_openbsd.h2paschk @@ -13,12 +13,14 @@ @Pascal begin # Adds support for M_PIl constant inside math.h header +@C #include <sys/mman.h> @C #include <sys/types.h> @C #include <sys/stat.h> @C #include <sys/time.h> @C #include <sys/times.h> @C #include <sys/resource.h> @C #include <sys/uio.h> +@C #include <sys/wait.h> @C #include <dirent.h> @C #include <poll.h> @C #include <utime.h> @@ -74,6 +76,13 @@ .state .mutex +@constant F_OK +@constant R_OK +@constant W_OK +@constant X_OK +@constant SEEK_SET +@constant SEEK_CUR +@constant SEEK_END @constant O_RDONLY @constant O_WRONLY @constant O_RDWR @@ -83,6 +92,60 @@ @constant O_NOCTTY @constant O_APPEND @constant O_NONBLOCK +@constant S_IRUSR +@constant S_IWUSR +@constant S_IXUSR +@constant S_IRGRP +@constant S_IWGRP +@constant S_IXGRP +@constant S_IROTH +@constant S_IWOTH +@constant S_IXOTH +@constant S_IRWXU +@constant S_IRWXG +@constant S_IRWXO +@constant WNOHANG +@constant WUNTRACED +@constant F_DUPFD +@constant F_GETFD +@constant F_SETFD +@constant F_GETFL +@constant F_SETFL +@constant F_GETOWN +@constant F_SETOWN +@constant F_GETLK +@constant F_SETLK +@constant F_SETLKW +@constant F_DUPFD_CLOEXEC +@constant FD_CLOEXEC +@constant F_RDLCK +@constant F_UNLCK +@constant F_WRLCK +@constant RLIMIT_CPU +@constant RLIMIT_FSIZE +@constant RLIMIT_DATA +@constant RLIMIT_STACK +@constant RLIMIT_CORE +@constant RLIMIT_RSS +@constant RLIMIT_MEMLOCK +@constant RLIMIT_NPROC +@constant RLIMIT_NOFILE +# @constant RLIMIT_AS alias of RLIMIT_RSS, but not in C headers +@constant MAP_PRIVATE +@constant MAP_ANONYMOUS +@constant POLLIN +@constant POLLPRI +@constant POLLOUT +@constant POLLERR +@constant POLLHUP +@constant POLLNVAL +@constant POLLRDNORM +@constant POLLRDBAND +@constant POLLWRNORM +@constant POLLWRBAND + + + @floatconstant PI,M_PI diff --git a/rtl/openbsd/termiosproc.inc b/rtl/openbsd/termiosproc.inc index 6892e3f7ad..7148d94edf 100644 --- a/rtl/openbsd/termiosproc.inc +++ b/rtl/openbsd/termiosproc.inc @@ -26,7 +26,7 @@ end; Function TCSetAttr(fd:cint;OptAct:cint;const tios:TermIOS):cint; var - nr:cint; + nr:TIOCtlRequest; begin case OptAct of TCSANOW : nr:=TIOCSETA; diff --git a/rtl/unix/scripts/check_rtl_types.sh b/rtl/unix/scripts/check_rtl_types.sh new file mode 100755 index 0000000000..28311b578f --- /dev/null +++ b/rtl/unix/scripts/check_rtl_types.sh @@ -0,0 +1,213 @@ +#!/usr/bin/env bash +filename="$1" +shift +FPC_OPTS="$*" + +if [ ! -f "$filename" ] ; then + echo "Usage: $0 file.h2paschk" + exit +fi + +filebase=${filename/.*/} + +filebaseonly=`basename $filebase` + +filedir=`dirname $filename` +if [ -z "$filedir" ] ; then + filedir=. +fi + +if [ -z "$MAKE" ] ; then + MAKE=`which gmake` +fi + +if [ -z "$MAKE" ] ; then + MAKE=`which make` +fi + +if [ -z "$FPC" ] ; then + FPC=fpc + default_fpc=1 +else + default_fpc=0 +fi + +if [ -z "$CC" ] ; then + CC=`which gcc` +fi + +if [ -z "$CC" ] ; then + CC=`which cc` +fi + +if [ -f "{$filebase}.c" ] ; then + rm -f ${filebase}.c +fi +if [ -f "{$filebase}.pas" ] ; then + rm -f ${filebase}.pas +fi + +function check_one () +{ +VERSION=$1 + +echo "Calling h2paschk $filename" +h2paschk $filename +res=$? +if [ $res -ne 0 ] ; then + exit +fi + +echo "Calling $CC $CC_OPT -o ${filebase}_c ${filebase}.c" +$CC $CC_OPT -o ${filebase}_c${VERSION} ${filebase}.c > ${filebase}${VERSION}_c.comp.log 2>&1 +res=$? +if [ $res -ne 0 ] ; then + echo "$CC call failed in $VERSION, res=$res" + cat ${filebase}${VERSION}_c.comp.log + exit +fi + +./${filebase}_c${VERSION} > ${filebase}_c${VERSION}.out +res=$? +if [ $res -ne 0 ] ; then + echo "./${filebase}_c${VERSION} failed in $VERSION, res=$res" + exit +fi + +echo "Calling $MAKE all OPT=\"-n -gwl $FPC_OPTS\" FPC=$FPC" +$MAKE all OPT="-n -gwl $FPC_OPTS" FPC=$FPC > ${filebase}${VERSION}_make_all.log 2>&1 +res=$? +if [ $res -ne 0 ] ; then + echo "$MAKE call failed in $VERSION, res=$res" + cat ${filebase}${VERSION}_make_all.log + exit +fi + +OS_TARGET=`$FPC $FPC_OPTS -iTO` +CPU_TARGET=`$FPC $FPC_OPTS -iTP` +echo "Calling $MAKE -C ${filedir} ${filebaseonly} FPC=$FPC OPT=\"-n -gwl $FPC_OPTS\" -Fu../units/$CPU_TARGET-$OS_TARGET" +$MAKE -C ${filedir} ${filebaseonly} FPC=$FPC OPT="-n -gwl $FPC_OPTS -Fu../units/$CPU_TARGET-$OS_TARGET" > ${filebase}${VERSION}_pas.comp.log 2>&1 +res=$? +if [ $res -ne 0 ] ; then + echo "$FPC call failed in $VERSION, res=$res" + cat ${filebase}${VERSION}_pas.comp.log + exit +fi +mv -f ${filebase} ${filebase}${VERSION} + +./${filebase}${VERSION} > ${filebase}_pas${VERSION}.out +res=$? +if [ $res -ne 0 ] ; then + echo "./${filebase}${VERSION} call failed in $VERSION, res=$res" + exit +fi + +diff ${filebase}_c${VERSION}.out ${filebase}_pas${VERSION}.out > ${filebase}${VERSION}.diffs +res=$? +if [ $res -eq 0 ] ; then + echo "No difference found!" +else + echo "Diffs for ${VERSION} are:" + echo "< C results" + echo "> Pascal results" + cat ${filebase}${VERSION}.diffs +fi +# Clean up +rm -f ${filebase}_c${VERSION} +rm -f ${filebase}${VERSION} +rm -f ${filebase}_c${VERSION}.out +rm -f ${filebase}_pas${VERSION}.out +rm -f ${filebase}${VERSION}_c.comp.log +rm -f ${filebase}${VERSION}_pas.comp.log +rm -f ${filebase}${VERSION}_make_all.log +rm -f ${filebase}.c +rm -f ${filebase}.pas + +} + +function check_64 () +{ + if [ "$FPC64" == "ppca64" ] ; then + CC_OPT="-Wall" + else + CC_OPT="-m64 -Wall" + fi + if [ $default_fpc -eq 1 ] ; then + FPC=$FPC64 + if [ "$CPU_SOURCE" != "$CPU_TARGET" ] ; then + FPC_OPTS="$FPC_OPTS -XP${CPU_TARGET}-${OS_SOURCE}-" + fi + fi + check_one 64bit +} + +function check_32 () +{ + if [ "$CPU_SOURCE" == "aarch64" ] ; then + CC=arm-linux-gnueabihf-gcc-4.8 + export BINUTILSPREFIX=arm-linux- + fi + if [ "$FPC32" == "ppcarm" ] ; then + CC_OPT="-march=armv7-a -Wall" + else + CC_OPT="-m32 -Wall" + fi + + FPC=$FPC32 + if [ "$CPU_SOURCE" != "$CPU_TARGET" ] ; then + FPC_OPTS="$FPC_OPTS -XP${CPU_TARGET}-${OS_SOURCE}-" + fi + check_one 32bit +} + +function check_gen32 () +{ + CC_OPT="-m32 -Wall" + + check_one gen32bit +} + +OS_SOURCE=`$FPC $FPC_OPTS -iSO` +CPU_SOURCE=`$FPC $FPC_OPTS -iSP` +CPU_TARGET=`$FPC $FPC_OPTS -iTP` +case $CPU_SOURCE in + arm|aarch64) FPC32=ppcarm; FPC64=ppca64;; + i386|x86_64) FPC32=ppc386; FPC64=ppcx64;; + powerpc|powerpc64) FPC32=ppcppc; FPC64=ppcppc64;; + sparc|sparc64) FPC32=ppcsparc; FPC64=ppcsparc64;; + m68k) FPC32=ppc68k; FPC64=;; + mips) FPC32=ppcmips; FPC64=;; + mipsel) FPC32=ppcmipsel; FPC64=;; + riscv32|riscv64) FPC32=ppcrv32; FPC64=ppcrv64;; +esac + +# No i386<->x86_64 cross-compilation on OpeenBSD +if [ "$OS_SOURCE" == "openbsd" ] ; then + if [ "$CPU_SOURCE" == "i386" ] ; then + FPC64= + else + FPC32= + fi +fi + + +if [ $default_fpc -eq 1 ] ; then + if [ -n "$FPC64" ] ; then + check_64 + fi + + if [ -n "$FPC32" ] ; then + check_32 + fi +else + if [ "${FPC}" == "$FPC64" ] ; then + check_64 + fi + + if [ "${FPC}" == "$FPC32" ] ; then + check_32 + fi +fi + + + diff --git a/rtl/unix/scripts/check_sys.sh b/rtl/unix/scripts/check_sys.sh index 1a748b2812..a6be01e82b 100755 --- a/rtl/unix/scripts/check_sys.sh +++ b/rtl/unix/scripts/check_sys.sh @@ -7,18 +7,20 @@ syscall_header=/usr/include/syscall.h fpc_sysnr=./sysnr.inc -i=0 -for arg in $* ; do - let i++ +i=1 +while [ $i -le "$#" ] ; do + arg="${!i}" echo "Handling arg $i, \"$arg\"" if [ "${arg//=}" != "$arg" ] ; then - echo "Evaluating $arg" - eval $arg + echo "Evaluating \"$arg\"" + arg2="${arg/=*/}=\"${arg/*=/}\"" + eval "$arg2" elif [ "$arg" == "-v" ] ; then verbose=1 else echo "arg not handled!" fi + let i++ done start_pwd=`pwd` @@ -30,6 +32,7 @@ if [ -d "rtl" ] ; then fi os=`uname -s | tr [:upper:] [:lower:] ` +os_cpu=`uname -m | tr [:upper:] [:lower:] ` now_pwd=`pwd` now_dir=`basename $now_pwd` if [ -d "$os" ] ; then @@ -70,7 +73,7 @@ fi if [ -f "$fpc_sysnr" ] ; then echo "Checking $fpc_sysnr content for Free Pascal syscall numbers" fpc_sysnr_dir=`dirname $fpc_sysnr ` - sysnr_includes=`grep -o '{\$i *[a-z_A-Z0-9/.]*' $fpc_sysnr | sed 's:.*{\$i *:'$fpc_sysnr_dir/: ` + sysnr_includes=`grep -o '{\$i *[a-z_A-Z0-9/.-]*' $fpc_sysnr | sed 's:.*{\$i *:'$fpc_sysnr_dir/: ` if [ -n "$sysnr_includes" ] ; then echo "Found $sysnr_includes include files" fpc_sysnr="$fpc_sysnr $sysnr_includes" @@ -103,6 +106,7 @@ if [ -z "$CC" ] ; then fi cpu=`$FPC -iTP` +cpu_source=`$FPC -iSP` is_16=0 is_32=0 is_64=0 @@ -129,10 +133,25 @@ case $cpu in esac if [ $is_64 -eq 1 ] ; then - CC_OPT="$CC_OPT -m64" + if [ "$os_cpu" == "aarch64" ] ; then + CC_OPT="$CC_OPT -Wall" + else + CC_OPT="$CC_OPT -m64 -Wall" + fi CPUBITS=64 elif [ $is_32 -eq 1 ] ;then - CC_OPT="$CC_OPT -m32" + if [ "$os_cpu" == "aarch64" ] ; then + CC=arm-linux-gnueabihf-gcc-4.8 + export BINUTILSPREFIX=arm-linux- + fi + if [ "${FPC/ppcarm/}" != "$FPC" ] ; then + CC_OPT="$CC_OPT -march=armv7-a -Wall" + elif [ "${os_cpu/arm/}" != "$os_cpu" ] ; then + CC_OPT="$CC_OPT -march=armv5 -Wall" + else + CC_OPT="$CC_OPT -m32 -Wall" + fi + CPUBITS=32 elif [ $is_16 -eq 1 ] ; then CPUBITS=16 @@ -197,18 +216,20 @@ macro=""; incfile=""; cpu= "cpu" proc; cpubits= "cpu" cpubits; +list_defines=macros " " cpu " " cpubits " "; +print "// FPC defined macros used " list_defines; } /\{\\\$i / { incfile=\$2; print "Include file " incfile " found"; } -/\{\\\$ifdef / { macro=gensub("[^A-Za-z_0-9].*","","",\$2); - if ( (macro == cpu) || (macro == cpubits)) { enable=1; +/\{\\\$ifdef / { macro=gensub("[^A-Za-z_0-9].*","",1,\$2) " "; + if (list_defines ~ macro) { enable=1; print "// ifdef " macro " found and accepted at line " FNR; } else {enable=0; print "// ifdef " macro " found and rejected at line " FNR; }; } -/\{\\\$ifndef / { macro=gensub("[^A-Za-z_0-9].*","","",\$2); - if ( (macro == cpu) || (macro == cpubits) ) { enable=0; +/\{\\\$ifndef / { macro=gensub("[^A-Za-z_0-9].*","",1,\$2); + if (list_defines ~ macro) { enable=0; print "// ifndef " macro " found and rejected at line " FNR; } else {enable=1; print "// ifndef " macro " found and accepted at line " FNR; @@ -219,14 +240,14 @@ cpubits= "cpu" cpubits; wholeline=\$0; code=gensub("{.*}","","g",\$0); code=gensub("[(][*].*[*][)]","","g",code); - comments=gensub(code,"","",\$0); + comments=gensub(code,"",1,\$0); comments1=gensub(".*({.*}).*","\1","g",comments); if (comments == comments1) comments1=""; comments2=gensub(".*[(][*].*[*][)]).*","\1","g",comments); if (comments == comments2) comments2=""; - comments3=gensub(".*//","","",comments); + comments3=gensub(".*//","",1,comments); if (comments == comments3) comments3=""; all_comments= comments1 comments2 comments3; @@ -250,13 +271,13 @@ fi if [ -n "$AWK" ] ; then echo "Preprocessing ${fpc_sysnr} to $tmp_fpc_sysnr" echo "$AWK -v proc=$cpu -v cpubits=$CPUBITS -f $awkfile ${fpc_sysnr} > $tmp_fpc_sysnr" - $AWK -v proc=$cpu -v cpubits=$CPUBITS -f $awkfile ${fpc_sysnr} > $tmp_fpc_sysnr + $AWK -v proc=$cpu -v cpubits=$CPUBITS -v macros="$FPC_MACROS" -f $awkfile ${fpc_sysnr} > $tmp_fpc_sysnr fpc_sysnr=$tmp_fpc_sysnr fi -sed -n "s:^\(.*\)*[ \t]*${fpc_syscall_prefix}\\([_a-zA-Z0-9]*\\)[ \t]*=[ \t]*\\([0-9]*\\)\\(.*\\)$:check_c_syscall_number_from_fpc_rtl \2 \3 \"\1 \4\":p" $fpc_sysnr > check_sys_list.sh +sed -n "s:^\(.*\)*[ \t]*${fpc_syscall_prefix}\\([_a-zA-Z0-9]*\\)[ \t]*=[ \t]*\\(.*\\);\\(.*\\)$:check_c_syscall_number_from_fpc_rtl \2 \"\3\" \"\1 \4\":p" $fpc_sysnr > check_sys_list.sh -sed -n "s:^.*#[[:space:]]*define[[:space:]]*${syscall_prefix}\\([_a-zA-Z0-9]*\\)[[:space:]]*\\([0-9]*\\)\\(.*\\)$:check_c_syscall_number_in_fpc_rtl \1 \2 \"\3\":p" ${syscall_header} > check_sys_list_reverse.sh +sed -n "s:^.*#[[:space:]]*define[[:space:]]*${syscall_prefix}\\([_a-zA-Z0-9]*\\)[[:space:]]*\\([0-9]*\\)\\(.*\\)$:check_c_syscall_number_in_fpc_rtl \1 \"\2\" \"\3\":p" ${syscall_header} > check_sys_list_reverse.sh forward_count=0 forward_ok_count=0 @@ -266,7 +287,13 @@ function check_c_syscall_number_from_fpc_rtl () { bare_sys=$1 sys=${syscall_prefix}$bare_sys - value=$2 + arg_2=\"$2\" + if [ "${2:0:1}" == "$" ] ; then + echo "Arg \"$arg_2\" needs Pascal To C hexadecimal conversion" + let "value=0x${arg_2:2}" + else + let "value=$2" + fi comment="$3" if [[ ! ( ( -n "$value" ) && ( $value -ge 0 ) ) ]] ; then echo "Computing $2 value" @@ -299,6 +326,7 @@ function check_c_syscall_number_from_fpc_rtl () let forward_failure_count++ return else + val=$CC_value rm -f ./test_c_${bare_sys} fi rm -f ./test-${bare_sys}.comp-log @@ -352,7 +380,12 @@ function check_c_syscall_number_in_fpc_rtl () sys=${fpc_syscall_prefix}${bare_sys} c_sys=${syscall_prefix}${bare_sys} value=$2 - comment="$3" + if [ -z "$value" ] ; then + let "value=$3" + comment="expression $3" + else + comment="$3" + fi echo -en "Testing $sys value $value \r" $CC $CC_OPT -DSYS_MACRO=${c_sys} -o ./test_c_${bare_sys} $c_syscall_source > ./test_${bare_sys}.comp-log 2>&1 C_COMP_RES=$? diff --git a/rtl/win/syswin.inc b/rtl/win/syswin.inc index 10a56a87a8..7736adadb4 100644 --- a/rtl/win/syswin.inc +++ b/rtl/win/syswin.inc @@ -591,10 +591,13 @@ procedure Win32Ansi2UnicodeMove(source:pchar;cp : TSystemCodePage;var dest:Unico begin // retrieve length including trailing #0 // not anymore, because this must also be usable for single characters - if cp=CP_UTF8 then - dwFlags:=0 - else - dwFlags:=MB_PRECOMPOSED; + case cp of + // Under https://docs.microsoft.com/en-us/windows/desktop/api/stringapiset/nf-stringapiset-multibytetowidechar + CP_UTF8, CP_UTF7, 50220, 50221, 50222, 50225, 50227, 50229, 57002..57011, 42: + dwFlags:=0 + else + dwFlags:=MB_PRECOMPOSED; + end; destlen:=MultiByteToWideChar(cp, dwFlags, source, len, nil, 0); // this will null-terminate setlength(dest, destlen); diff --git a/rtl/win/wininc/ascdef.inc b/rtl/win/wininc/ascdef.inc index 76dc8c6cfd..778582d299 100644 --- a/rtl/win/wininc/ascdef.inc +++ b/rtl/win/wininc/ascdef.inc @@ -481,6 +481,7 @@ function FindFirstFileTransacted(lpfilename : LPCStr;fInfoLevelId:FINDEX_INFO_LE external 'kernel32' name 'FindFirstFileTransactedA'; function GetComputerNameEx(NameType:COMPUTER_NAME_FORMAT;lpbuffer:LPSTR;nSize:LPDWORD):BOOL;stdcall;external 'kernel32' name 'GetComputerNameExA'; function QueryFullProcessImageName(hProcess:THandle;dwFlags:DWord; lpexename :lpstr;lpdwsize:pdword):BOOL; stdcall; external 'kernel32.dll' name 'QueryFullProcessImageNameA'; +function RealGetWindowClass(Wnd : HWND;ClassnameBuffer : pansichar;ClassnameBufferSize : DWORD): DWORD; stdcall; external 'user32.dll' name 'RealGetWindowClassA'; {$endif read_interface} diff --git a/rtl/win/wininc/ascfun.inc b/rtl/win/wininc/ascfun.inc index b47a4c9174..b34c3211ff 100644 --- a/rtl/win/wininc/ascfun.inc +++ b/rtl/win/wininc/ascfun.inc @@ -494,6 +494,7 @@ function GetConsoleAliasesA(AliasBuffer:LPSTR; AliasBufferLength:DWORD; ExeName: function GetConsoleAliasExesA(ExeNameBuffer:LPSTR; ExeNameBufferLength:DWORD):DWORD;stdcall;external 'kernel32' name 'GetConsoleAliasExesA'; function GetComputerNameExA(NameType:COMPUTER_NAME_FORMAT;lpbuffer:LPSTR;nSize:LPDWORD):BOOL;stdcall;external 'kernel32' name 'GetComputerNameExA'; function QueryFullProcessImageNameA(hProcess:THandle;dwFlags:DWord; lpexename :lpstr;lpdwsize:pdword):BOOL; stdcall; external 'kernel32.dll' name 'QueryFullProcessImageNameA'; +function RealGetWindowClassA(Wnd : HWND;ClassnameBuffer : pansichar;ClassnameBufferSize : DWORD): DWORD; stdcall; external 'user32.dll' name 'RealGetWindowClassA'; {$endif read_interface} diff --git a/rtl/win/wininc/defines.inc b/rtl/win/wininc/defines.inc index d7dc5f9d46..54f8a6dc8d 100644 --- a/rtl/win/wininc/defines.inc +++ b/rtl/win/wininc/defines.inc @@ -1162,18 +1162,23 @@ KEY_WOW64_64KEY = $0100; KEY_WOW64_32KEY = $0200; KEY_WRITE = $20006; - PROCESS_ALL_ACCESS = $1f0fff; - PROCESS_CREATE_PROCESS = 128; - PROCESS_CREATE_THREAD = 2; - PROCESS_DUP_HANDLE = 64; - PROCESS_QUERY_INFORMATION = 1024; + PROCESS_ALL_ACCESS = $1fFfff; + PROCESS_TERMINATE = $0001; + PROCESS_CREATE_THREAD = $0002; + PROCESS_SET_SESSIONID = $0004; + PROCESS_VM_OPERATION = $0008; + PROCESS_VM_READ = $0010; + PROCESS_VM_WRITE = $0020; + PROCESS_DUP_HANDLE = $0040; + PROCESS_CREATE_PROCESS = $0080; + PROCESS_SET_QUOTA = $0100; + PROCESS_SET_INFORMATION = $0200; + PROCESS_QUERY_INFORMATION = $0400; + PROCESS_SUSPEND_RESUME = $0800; PROCESS_QUERY_LIMITED_INFORMATION = $1000; - PROCESS_SET_INFORMATION = 512; - PROCESS_TERMINATE = 1; - PROCESS_VM_OPERATION = 8; - PROCESS_VM_READ = 16; - PROCESS_VM_WRITE = 32; - THREAD_ALL_ACCESS = $1f03ff; + PROCESS_SET_LIMITED_INFORMATION = $2000; + + THREAD_ALL_ACCESS = $1FFFFF; // vista+, for old systems 0x3FF THREAD_DIRECT_IMPERSONATION = 512; THREAD_GET_CONTEXT = 8; THREAD_IMPERSONATE = 256; @@ -1183,6 +1188,10 @@ THREAD_SET_THREAD_TOKEN = 128; THREAD_SUSPEND_RESUME = 2; THREAD_TERMINATE = 1; + THREAD_SET_LIMITED_INFORMATION = $0400; + THREAD_QUERY_LIMITED_INFORMATION = $0800; + THREAD_RESUME = $1000; + { EditWordBreakProc } WB_ISDELIMITER = 2; WB_LEFT = 0; @@ -2686,7 +2695,6 @@ Type CAL_SMONTHNAME13 = 33; CAL_SSHORTDATE = 5; { SetProcessWorkingSetSize } - PROCESS_SET_QUOTA = 256; { SetPrinter } { SetService } { SetStretchBltMode } @@ -6381,6 +6389,11 @@ const CONSOLE_WINDOWED_MODE = 2; PROCESS_NAME_NATIVE = 1; + GR_GDIOBJECTS = 0; { Count of GDI objects } + GR_USEROBJECTS = 1; { Count of USER objects } + GR_GDIOBJECTS_PEAK = 2; { Peak count of GDI objects } + GR_USEROBJECTS_PEAK = 4; { Peak count of USER objects } + {$endif read_interface} {$ifdef read_implementation} diff --git a/rtl/win/wininc/func.inc b/rtl/win/wininc/func.inc index c3d58a8d97..e86e0db8b9 100644 --- a/rtl/win/wininc/func.inc +++ b/rtl/win/wininc/func.inc @@ -1326,6 +1326,10 @@ function CONSOLE_REAL_OUTPUT_HANDLE : HANDLE; function Wow64RevertWow64FsRedirection(RedirectionState : pointer) : BOOL; stdcall; external 'kernel32.dll' name 'Wow64RevertWow64FsRedirection'; function IsWow64Process(hProcess:THandle; Wow64Process:PBOOL):BOOL;stdcall; external 'kernel32.dll' name 'IsWow64Process'; function GetPhysicallyInstalledSystemMemory(TotalMemoryInKilobytes: PULONGLONG ):BOOL; stdcall; external 'kernel32.dll' name 'GetPhysicallyInstalledSystemMemory'; + function OpenThread(DesiredAccess : DWORD; InheritHandle : BOOL; ThreadId : DWORD) : THANDLE; stdcall; external 'kernel32.dll' name 'OpenThread'; + function GetShellWindow:HWND; stdcall; external 'user32.dll' name 'GetShellWindow'; + function RealChildWindowFromPoint(Parent : HWND; Pt : TPOINT): HWND; stdcall; external 'user32.dll' name 'RealChildWindowFromPoint'; + function GetGuiResources(ProcessHandle : THANDLE; ResourceType : DWORD): DWORD; stdcall; external 'user32.dll' name 'GetGuiResources'; {$endif read_interface} diff --git a/rtl/win/wininc/unidef.inc b/rtl/win/wininc/unidef.inc index b8a260efdb..da566c503c 100644 --- a/rtl/win/wininc/unidef.inc +++ b/rtl/win/wininc/unidef.inc @@ -474,6 +474,7 @@ function FindFirstFileEx(lpfilename : LPCWStr;fInfoLevelId:FINDEX_INFO_LEVELS ;l function FindFirstFileTransacted(lpfilename : LPCWStr;fInfoLevelId:FINDEX_INFO_LEVELS ;lpFindFileData:pointer;fSearchOp : FINDEX_SEARCH_OPS;lpSearchFilter:pointer;dwAdditionalFlags:dword;htransaction : HANDLE):Handle; stdcall; external 'kernel32' name 'FindFirstFileTransactedW'; function GetComputerNameEx(NameType:COMPUTER_NAME_FORMAT;lpbuffer:LPWSTR;nSize:LPDWORD):BOOL;stdcall;external 'kernel32' name 'GetComputerNameExW'; function QueryFullProcessImageName(hProcess:THandle;dwFlags:DWord; lpexename :lpwstr;lpdwsize:pdword):BOOL; stdcall; external 'kernel32.dll' name 'QueryFullProcessImageNameW'; +function RealGetWindowClass(Wnd : HWND;ClassnameBuffer : pwidechar;ClassnameBufferSize : DWORD): DWORD; stdcall; external 'user32.dll' name 'RealGetWindowClassW'; {$endif read_interface} diff --git a/rtl/win/wininc/unifun.inc b/rtl/win/wininc/unifun.inc index 8de59c5a8c..9b37aac0af 100644 --- a/rtl/win/wininc/unifun.inc +++ b/rtl/win/wininc/unifun.inc @@ -497,6 +497,7 @@ function GetConsoleAliasesW(AliasBuffer:LPWSTR; AliasBufferLength:DWORD; ExeName function GetConsoleAliasExesW(ExeNameBuffer:LPWSTR; ExeNameBufferLength:DWORD):DWORD;stdcall;external 'kernel32' name 'GetConsoleAliasExesW'; function GetComputerNameExW(NameType:COMPUTER_NAME_FORMAT;lpbuffer:LPWSTR;nSize:LPDWORD):BOOL;stdcall;external 'kernel32' name 'GetComputerNameExW'; function QueryFullProcessImageNameW(hProcess:THandle;dwFlags:DWord; lpexename :lpwstr;lpdwsize:pdword):BOOL; stdcall; external 'kernel32.dll' name 'QueryFullProcessImageNameW'; +function RealGetWindowClassW(Wnd : HWND;ClassnameBuffer : pwidechar;ClassnameBufferSize : DWORD): DWORD; stdcall; external 'user32.dll' name 'RealGetWindowClassW'; {$endif read_interface} diff --git a/tests/Makefile b/tests/Makefile index 5fca581d3f..df1d180d00 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -2444,10 +2444,10 @@ ifndef SINGLEDOTESTRUNS endif alltests: alltest alltbs alltbf allwebtbs allwebtbf test_c_objects: testprep - $(MAKE) $(patsubst %.pp,%.log, $(wildcard test/cg/cdecl/tcalext*.pp))) - $(MAKE) $(patsubst %.pp,%.elg, $(wildcard test/cg/cdecl/tcalext*.pp))) - $(MAKE) $(patsubst %.pp,%.log, $(wildcard test/cg/cdecl/tcppcl*.pp))) - $(MAKE) $(patsubst %.pp,%.elg, $(wildcard test/cg/cdecl/tcppcl*.pp))) + $(MAKE) $(patsubst %.pp,%.log, $(wildcard test/cg/cdecl/tcalext*.pp)) + $(MAKE) $(patsubst %.pp,%.elg, $(wildcard test/cg/cdecl/tcalext*.pp)) + $(MAKE) $(patsubst %.pp,%.log, $(wildcard test/cg/cdecl/tcppcl*.pp)) + $(MAKE) $(patsubst %.pp,%.elg, $(wildcard test/cg/cdecl/tcppcl*.pp)) ifdef SINGLEDOTESTRUNS .PHONY: allexectbs allexectbf allexecwebtbs allexecwebtbf allexectest allexectests allexectbs: $(addsuffix .tbslog, $(LOGFILES)) @@ -2561,6 +2561,11 @@ ifneq ($(SVNVERSION),) $(ECHOREDIR) svnpackagesrevision=$(SVN_PACKAGES_REV_STR) >> $(TEST_OUTPUTDIR)/dbdigest.cfg endif ifeq ($(OS_SOURCE),openbsd) +ifeq ($(TARPROG),$(subst gtar,,$(TARPROG))) + BSD_SYSTEM_TAR=1 +endif +endif +ifdef BSD_SYSTEM_TAR TARFROM=-I tar.lst else TARFROM=--files-from=tar.lst diff --git a/tests/Makefile.fpc b/tests/Makefile.fpc index 7a23ec6ff0..eb88d1eeab 100644 --- a/tests/Makefile.fpc +++ b/tests/Makefile.fpc @@ -451,10 +451,10 @@ endif alltests: alltest alltbs alltbf allwebtbs allwebtbf test_c_objects: testprep - $(MAKE) $(patsubst %.pp,%.log, $(wildcard test/cg/cdecl/tcalext*.pp))) - $(MAKE) $(patsubst %.pp,%.elg, $(wildcard test/cg/cdecl/tcalext*.pp))) - $(MAKE) $(patsubst %.pp,%.log, $(wildcard test/cg/cdecl/tcppcl*.pp))) - $(MAKE) $(patsubst %.pp,%.elg, $(wildcard test/cg/cdecl/tcppcl*.pp))) + $(MAKE) $(patsubst %.pp,%.log, $(wildcard test/cg/cdecl/tcalext*.pp)) + $(MAKE) $(patsubst %.pp,%.elg, $(wildcard test/cg/cdecl/tcalext*.pp)) + $(MAKE) $(patsubst %.pp,%.log, $(wildcard test/cg/cdecl/tcppcl*.pp)) + $(MAKE) $(patsubst %.pp,%.elg, $(wildcard test/cg/cdecl/tcppcl*.pp)) ################################ # Compile and Run tests @@ -647,6 +647,12 @@ endif # OpenBSD system tar executable doesn't know # about --files-from option, but supports -I ifeq ($(OS_SOURCE),openbsd) +ifeq ($(TARPROG),$(subst gtar,,$(TARPROG))) + BSD_SYSTEM_TAR=1 +endif +endif + +ifdef BSD_SYSTEM_TAR TARFROM=-I tar.lst else TARFROM=--files-from=tar.lst diff --git a/tests/test/cg/tcalext6.pp b/tests/test/cg/tcalext6.pp index 93b2375037..f162d3e3bf 100644 --- a/tests/test/cg/tcalext6.pp +++ b/tests/test/cg/tcalext6.pp @@ -28,9 +28,22 @@ uses ctypes; {$if defined(CPUARMEL) and defined(FPUSOFT)} { for softfloat calls in the C code } + {$define LIBGCC_NEEDED} +{$endif} + +{$ifdef OPENBSD} + { OpenBSD GCC uses __guard_local which is defined in crtbegin.o or crtbeginS.o} + {$define LIBC_NEEDED} +{$endif} + +{$ifdef LIBGCC_NEEDED} {$linklib gcc} {$endif} +{$ifdef LIBC_NEEDED} +{$linklib c} +{$endif} + type int8_t = shortint; pint8_t = ^int8_t; diff --git a/tests/test/cg/tcppcl2.pp b/tests/test/cg/tcppcl2.pp index 69db22fbbb..7726dd8059 100644 --- a/tests/test/cg/tcppcl2.pp +++ b/tests/test/cg/tcppcl2.pp @@ -4,6 +4,10 @@ program tcppcl2; {$mode objfpc} {$L cpptcl2.o} +{$ifdef openbsd} + {$linklib stdc++} + {$linklib c} +{$endif} type TestClass = cppclass external diff --git a/tests/test/tcasecov1.pp b/tests/test/tcasecov1.pp new file mode 100644 index 0000000000..5ada1dbdc0 --- /dev/null +++ b/tests/test/tcasecov1.pp @@ -0,0 +1,11 @@ +{ %fail } +{$mode iso} + +var + l: longint; +begin + l:=1; + case l of + 2: writeln; + end; +end. diff --git a/tests/test/tcasecov2.pp b/tests/test/tcasecov2.pp new file mode 100644 index 0000000000..14e68f6f47 --- /dev/null +++ b/tests/test/tcasecov2.pp @@ -0,0 +1,12 @@ +{ %fail } +{ %opt=-Sew } +{$mode extendedpascal} + +var + l: longint; +begin + l:=1; + case l of + 2: writeln; + end; +end. diff --git a/tests/test/tcasecov3.pp b/tests/test/tcasecov3.pp new file mode 100755 index 0000000000..29f14012f1 --- /dev/null +++ b/tests/test/tcasecov3.pp @@ -0,0 +1,11 @@ +{ %result=201 } +{$mode extendedpascal} + +var + l: longint; +begin + l:=1; + case l of + 2: writeln; + end; +end. diff --git a/tests/test/tcasecov4.pp b/tests/test/tcasecov4.pp new file mode 100755 index 0000000000..4afec810de --- /dev/null +++ b/tests/test/tcasecov4.pp @@ -0,0 +1,11 @@ +{ %opt=-Sew } +{ %norun } + +var + l: longint; +begin + l:=1; + case l of + 2: writeln; + end; +end. diff --git a/tests/test/tcasecov5.pp b/tests/test/tcasecov5.pp new file mode 100755 index 0000000000..e7b3135464 --- /dev/null +++ b/tests/test/tcasecov5.pp @@ -0,0 +1,12 @@ +{ %opt=-Sew } +{ %norun } + +{ should not print a warning } +var + l: qword; +begin + l:=1; + case l of + 2: writeln; + end; +end. diff --git a/tests/test/tcasecov6.pp b/tests/test/tcasecov6.pp new file mode 100755 index 0000000000..b022cb0805 --- /dev/null +++ b/tests/test/tcasecov6.pp @@ -0,0 +1,12 @@ +{ %fail } +{ %opt=-Sew } +{ %norun } + +var + l: 0..3; +begin + l:=1; + case l of + 2: writeln; + end; +end. diff --git a/tests/test/tcasecov7.pp b/tests/test/tcasecov7.pp new file mode 100755 index 0000000000..9fedb11c1e --- /dev/null +++ b/tests/test/tcasecov7.pp @@ -0,0 +1,11 @@ +{ %opt=-Sew } +{ %norun } + +var + s: shortstring; +begin + s:='abc'; + case s[1] of + 'b': writeln; + end; +end. diff --git a/tests/test/tcasecov8.pp b/tests/test/tcasecov8.pp new file mode 100755 index 0000000000..8ebff02afb --- /dev/null +++ b/tests/test/tcasecov8.pp @@ -0,0 +1,13 @@ +{ %opt=-Sew } +{ %norun } + +const + OT_SIZE_MASK = $3000001F; +var + l: longint; +begin + l:=1; + case l and OT_SIZE_MASK of + 1: writeln; + end; +end. diff --git a/tests/test/tcasecov9.pp b/tests/test/tcasecov9.pp new file mode 100755 index 0000000000..2f641a410d --- /dev/null +++ b/tests/test/tcasecov9.pp @@ -0,0 +1,15 @@ +{ %fail } +{ %opt=-Sew } +{ %norun } + +var + l: 0..1; +begin + l:=1; + case l of + 0: write('a'); + 1: writeln; + else + writeln('unreachable'); + end; +end. diff --git a/tests/test/tmshlp1.pp b/tests/test/tmshlp1.pp new file mode 100644 index 0000000000..a92134ea5f --- /dev/null +++ b/tests/test/tmshlp1.pp @@ -0,0 +1,38 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch multihelpers} + +program tmshlp1; + +type + TMyObject = class + procedure DoThis_1; + end; + THelper1 = class helper for TMyObject + procedure DoThis_2; + end; + THelper2 = class helper for TMyObject + procedure DoThis_3; + end; + +procedure TMyObject.DoThis_1; +begin +end; + +procedure THelper1.DoThis_2; +begin +end; + +procedure THelper2.DoThis_3; +begin +end; + +var + obj: TMyObject; +begin + obj := TMyObject.Create; + obj.DoThis_1; + obj.DoThis_2; + obj.DoThis_3; +end. diff --git a/tests/test/tmshlp10.pp b/tests/test/tmshlp10.pp new file mode 100644 index 0000000000..638187c23f --- /dev/null +++ b/tests/test/tmshlp10.pp @@ -0,0 +1,38 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch multihelpers} + +program tmshlp10; + +type + TMyObject = class + procedure DoThis(param: integer); overload; + end; + THelper1 = class helper for TMyObject + procedure DoThis(param: string); overload; + end; + THelper2 = class helper for TMyObject + procedure DoThis(param: pointer); overload; + end; + +procedure TMyObject.DoThis(param: integer); +begin +end; + +procedure THelper1.DoThis(param: string); +begin +end; + +procedure THelper2.DoThis(param: pointer); +begin +end; + +var + obj: TMyObject; +begin + obj := TMyObject.Create; + obj.DoThis(1); + obj.DoThis('string'); + obj.DoThis(nil); +end. diff --git a/tests/test/tmshlp11.pp b/tests/test/tmshlp11.pp new file mode 100644 index 0000000000..cdee6bfaba --- /dev/null +++ b/tests/test/tmshlp11.pp @@ -0,0 +1,40 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch multihelpers} + +program tmshlp11; + +type + TMyObject = class + class function Create1: TMyObject; + end; + THelper1 = class helper for TMyObject + class function Create2: TMyObject; + end; + THelper2 = class helper for TMyObject + class function Create3: TMyObject; + end; + +class function TMyObject.Create1: TMyObject; +begin + result := TMyObject.Create; +end; + +class function THelper1.Create2: TMyObject; +begin + result := TMyObject.Create; +end; + +class function THelper2.Create3: TMyObject; +begin + result := TMyObject.Create; +end; + +var + obj: TMyObject; +begin + obj := TMyObject.Create1; + obj := TMyObject.Create2; + obj := TMyObject.Create3; +end. diff --git a/tests/test/tmshlp12.pp b/tests/test/tmshlp12.pp new file mode 100644 index 0000000000..6483db996f --- /dev/null +++ b/tests/test/tmshlp12.pp @@ -0,0 +1,43 @@ +{$mode objfpc} +{$modeswitch multihelpers} + +program tmshlp12; + +type + TMyObject = class + procedure DoThis; + end; + THelper1 = class helper for TMyObject + procedure DoThis; + end; + THelper2 = class helper for TMyObject + procedure DoThis; + end; + +var + Res: integer; + +procedure TMyObject.DoThis; +begin + Res := 1; +end; + +procedure THelper1.DoThis; +begin + Res := 2; +end; + +procedure THelper2.DoThis; +begin + Res := 3; +end; + +var + obj: TMyObject; +begin + obj := TMyObject.Create; + obj.DoThis; + writeln(Res); + if Res <> 3 then + Halt(1); +end. diff --git a/tests/test/tmshlp13.pp b/tests/test/tmshlp13.pp new file mode 100644 index 0000000000..0640a53e84 --- /dev/null +++ b/tests/test/tmshlp13.pp @@ -0,0 +1,19 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch multihelpers} + +program tmshlp13; + +type + THelper1 = class helper for TObject + class var field1: integer; + end; + THelper2 = class helper for TObject + class var field2: integer; + end; + +begin + TObject.field1 := 1; + TObject.field2 := 2; +end. diff --git a/tests/test/tmshlp14.pp b/tests/test/tmshlp14.pp new file mode 100644 index 0000000000..6b2be29833 --- /dev/null +++ b/tests/test/tmshlp14.pp @@ -0,0 +1,21 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch multihelpers} + +program tmshlp14; + +type + THelper1 = class helper for TObject + type TInteger = integer; + end; + THelper2 = class helper for TObject + type TString = string; + end; + +var + obj: TObject; +begin + writeln(sizeof(TObject.TInteger)); + writeln(sizeof(TObject.TString)); +end. diff --git a/tests/test/tmshlp15.pp b/tests/test/tmshlp15.pp new file mode 100644 index 0000000000..c315da412e --- /dev/null +++ b/tests/test/tmshlp15.pp @@ -0,0 +1,14 @@ +program tmshlp15; + +{$mode objfpc} +{$modeswitch multihelpers} + +uses + umshlp15a, umshlp15b; + +var + o: TObject; +begin + if o.Test <> 2 then + Halt(1); +end. diff --git a/tests/test/tmshlp16.pp b/tests/test/tmshlp16.pp new file mode 100644 index 0000000000..acce4ab023 --- /dev/null +++ b/tests/test/tmshlp16.pp @@ -0,0 +1,14 @@ +program tmshlp16; + +{$mode objfpc} +{$modeswitch multihelpers} + +uses + umshlp15b, umshlp15a; + +var + o: TObject; +begin + if o.Test <> 1 then + Halt(1); +end. diff --git a/tests/test/tmshlp2.pp b/tests/test/tmshlp2.pp new file mode 100644 index 0000000000..fba1262fe1 --- /dev/null +++ b/tests/test/tmshlp2.pp @@ -0,0 +1,38 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch advancedrecords} +{$modeswitch multihelpers} + +program tmshlp2; + +type + TMyObject = record + procedure DoThis_1; + end; + THelper1 = record helper for TMyObject + procedure DoThis_2; + end; + THelper2 = record helper for TMyObject + procedure DoThis_3; + end; + +procedure TMyObject.DoThis_1; +begin +end; + +procedure THelper1.DoThis_2; +begin +end; + +procedure THelper2.DoThis_3; +begin +end; + +var + obj: TMyObject; +begin + obj.DoThis_1; + obj.DoThis_2; + obj.DoThis_3; +end. diff --git a/tests/test/tmshlp3.pp b/tests/test/tmshlp3.pp new file mode 100644 index 0000000000..ca030de79c --- /dev/null +++ b/tests/test/tmshlp3.pp @@ -0,0 +1,32 @@ +{$mode objfpc} +{$modeswitch typehelpers} +{$modeswitch multihelpers} + +program tmshlp3; + +type + TStringHelper1 = type helper for String + function Length: integer; + end; + +function TStringHelper1.Length: integer; +begin + result := System.Length(self); +end; + +type + TStringHelper2 = type helper for string + function LengthSquared: integer; + end; + +function TStringHelper2.LengthSquared: integer; +begin + result := self.Length * self.Length; +end; + +var + s: string = 'abcd'; +begin + if (s.Length <> 4) or (s.LengthSquared <> 16 ) then + Halt(1); +end.
\ No newline at end of file diff --git a/tests/test/tmshlp4.pp b/tests/test/tmshlp4.pp new file mode 100644 index 0000000000..77dcbf43dd --- /dev/null +++ b/tests/test/tmshlp4.pp @@ -0,0 +1,50 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch multihelpers} + +program tmshlp4; + +type + TMyObject = class + procedure DoThis_1; + end; + THelperBase = class helper for TMyObject + procedure DoThis_4; + end; + THelper1 = class helper(THelperBase) for TMyObject + procedure DoThis_2; + end; + THelper2 = class helper(THelperBase) for TMyObject + procedure DoThis_3; + end; + +procedure THelperBase.DoThis_4; +begin + writeln('DoThis_4'); +end; + +procedure TMyObject.DoThis_1; +begin + writeln('DoThis_1'); +end; + +procedure THelper1.DoThis_2; +begin + writeln('DoThis_2'); +end; + +procedure THelper2.DoThis_3; +begin + writeln('DoThis_3'); +end; + +var + obj: TMyObject; +begin + obj := TMyObject.Create; + obj.DoThis_1; + obj.DoThis_2; + obj.DoThis_3; + obj.DoThis_4; +end. diff --git a/tests/test/tmshlp5.pp b/tests/test/tmshlp5.pp new file mode 100644 index 0000000000..ac8fd205d8 --- /dev/null +++ b/tests/test/tmshlp5.pp @@ -0,0 +1,37 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch multihelpers} + +program tmshlp5; + +type + TMyObject = class + constructor Create1; + end; + THelper1 = class helper for TMyObject + constructor Create2; + end; + THelper2 = class helper for TMyObject + constructor Create3; + end; + +constructor TMyObject.Create1; +begin +end; + +constructor THelper1.Create2; +begin +end; + +constructor THelper2.Create3; +begin +end; + +var + obj: TMyObject; +begin + obj := TMyObject.Create1; + obj := TMyObject.Create2; + obj := TMyObject.Create3; +end. diff --git a/tests/test/tmshlp6.pp b/tests/test/tmshlp6.pp new file mode 100644 index 0000000000..ea01d8e5cc --- /dev/null +++ b/tests/test/tmshlp6.pp @@ -0,0 +1,37 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch multihelpers} + +program tmshlp6; + +type + TMyObject = class + m_num: integer; + property num1: integer read m_num; + end; + THelperBase = class helper for TMyObject + function GetNum: integer; + end; + THelper1 = class helper(THelperBase) for TMyObject + property num2: integer read GetNum; + end; + THelper2 = class helper(THelperBase) for TMyObject + property num3: integer read GetNum; + end; + +function THelperBase.GetNum: integer; +begin + result := m_num; +end; + +var + obj: TMyObject; + num: integer; +begin + obj := TMyObject.Create; + // 2^3 + obj.m_num := 2; + num := obj.num1 * obj.num2 * obj.num3; + writeln(num); +end. diff --git a/tests/test/tmshlp7.pp b/tests/test/tmshlp7.pp new file mode 100644 index 0000000000..0bb12dabad --- /dev/null +++ b/tests/test/tmshlp7.pp @@ -0,0 +1,38 @@ +{ %NORUN } + +{$mode delphi} +{$modeswitch multihelpers} + +program tmshlp7; + +type + TMyObject = class + procedure DoThis_1; + end; + THelper1 = class helper for TMyObject + procedure DoThis_2; + end; + THelper2 = class helper for TMyObject + procedure DoThis_3; + end; + +procedure TMyObject.DoThis_1; +begin +end; + +procedure THelper1.DoThis_2; +begin +end; + +procedure THelper2.DoThis_3; +begin +end; + +var + obj: TMyObject; +begin + obj := TMyObject.Create; + obj.DoThis_1; + obj.DoThis_2; + obj.DoThis_3; +end. diff --git a/tests/test/tmshlp8.pp b/tests/test/tmshlp8.pp new file mode 100644 index 0000000000..5e2ac0cd70 --- /dev/null +++ b/tests/test/tmshlp8.pp @@ -0,0 +1,36 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch typehelpers} +{$modeswitch multihelpers} + +program tmshlp8; +uses + umshlp1; + +type + TClassHelper = class helper for TObject + procedure DoThis; + end; + TStringHelper = type helper for String + function Length: integer; + end; + +procedure TClassHelper.DoThis; +begin + DoThisExt; +end; + +function TStringHelper.Length: integer; +begin + result := LengthExt; +end; + +var + obj: TObject; + str: string; +begin + obj := TObject.Create; + obj.DoThis; + writeln(str.Length + str.LengthTimesTwo); +end. diff --git a/tests/test/tmshlp9.pp b/tests/test/tmshlp9.pp new file mode 100644 index 0000000000..6f86df6030 --- /dev/null +++ b/tests/test/tmshlp9.pp @@ -0,0 +1,38 @@ +{ %NORUN } + +{$mode objfpc} +{$modeswitch multihelpers} + +program tmshlp9; + +type + TMyObject = class + procedure DoThis_1; + end; + THelper1 = class helper for TMyObject + procedure DoThis_2; + end; + THelper2 = class helper for TMyObject + procedure DoThis_3; + end; + +procedure TMyObject.DoThis_1; +begin +end; + +procedure THelper1.DoThis_2; +begin + DoThis_1; +end; + +procedure THelper2.DoThis_3; +begin + DoThis_2; +end; + +var + obj: TMyObject; +begin + obj := TMyObject.Create; + obj.DoThis_3; +end. diff --git a/tests/test/tthlp27.pp b/tests/test/tthlp27.pp new file mode 100644 index 0000000000..425e7c98cc --- /dev/null +++ b/tests/test/tthlp27.pp @@ -0,0 +1,21 @@ +{ %FAIL } + +program tthlp27; + +{$mode delphi} + +type + TLongIntHelper = record helper for LongInt + procedure Test; + end; + +procedure TLongIntHelper.Test; +begin + +end; + +var + p: PLongInt; +begin + p.Test; +end. diff --git a/tests/test/tthlp28.pp b/tests/test/tthlp28.pp new file mode 100644 index 0000000000..4882904e84 --- /dev/null +++ b/tests/test/tthlp28.pp @@ -0,0 +1,21 @@ +{ %NORUN } + +program tthlp28; + +{$mode delphi} + +type + TPLongIntHelper = record helper for PLongInt + procedure Test; + end; + +procedure TPLongIntHelper.Test; +begin + +end; + +var + p: PLongInt; +begin + p.Test; +end. diff --git a/tests/test/umshlp1.pp b/tests/test/umshlp1.pp new file mode 100644 index 0000000000..29766816bb --- /dev/null +++ b/tests/test/umshlp1.pp @@ -0,0 +1,35 @@ +{$mode objfpc} +{$modeswitch advancedrecords} +{$modeswitch typehelpers} + +unit umshlp1; +interface + +type + TExtClassHelper = class helper for TObject + procedure DoThisExt; + end; + TExtStringHelper = type helper for String + function LengthExt: integer; + end; + TExtStringHelperMore = type helper for String + function LengthTimesTwo: integer; + end; + +implementation + +procedure TExtClassHelper.DoThisExt; +begin +end; + +function TExtStringHelper.LengthExt: integer; +begin + result := System.Length(self); +end; + +function TExtStringHelperMore.LengthTimesTwo: integer; +begin + result := System.Length(self) * 2; +end; + +end. diff --git a/tests/test/umshlp15a.pp b/tests/test/umshlp15a.pp new file mode 100644 index 0000000000..140dcf52f4 --- /dev/null +++ b/tests/test/umshlp15a.pp @@ -0,0 +1,19 @@ +unit umshlp15a; + +{$mode objfpc} + +interface + +type + THelperA = class helper for TObject + function Test: LongInt; + end; + +implementation + +function THelperA.Test: LongInt; +begin + Result := 1; +end; + +end. diff --git a/tests/test/umshlp15b.pp b/tests/test/umshlp15b.pp new file mode 100644 index 0000000000..125c8e1062 --- /dev/null +++ b/tests/test/umshlp15b.pp @@ -0,0 +1,19 @@ +unit umshlp15b; + +{$mode objfpc} + +interface + +type + THelperB = class helper for TObject + function Test: LongInt; + end; + +implementation + +function THelperB.Test: LongInt; +begin + Result := 2; +end; + +end. diff --git a/tests/webtbs/tw35533.pp b/tests/webtbs/tw35533.pp new file mode 100644 index 0000000000..04e8b167ce --- /dev/null +++ b/tests/webtbs/tw35533.pp @@ -0,0 +1,30 @@ +{ %NORUN } + +program tw35533; +{$mode delphiunicode} + +type + TPointerHelper = record helper for pointer + function AsNativeUint: nativeuint; + function PCharLen: uint32; + end; + +function TPointerHelper.AsNativeUint: nativeuint; +begin + Result := nativeuint(self); +end; + +function TPointerHelper.PCharLen: uint32; +begin + Result := 5; //- Just here to illustrate the issue. +end; + +var + P: pointer; + +begin + P := @ParamStr(0); //- Just a nonsense pointer. + Writeln( P.AsNativeUInt ); + Writeln( P.PCharLen ); + Readln; +end. diff --git a/utils/h2pas/h2paschk.pas b/utils/h2pas/h2paschk.pas index 96aa831f97..7fcdb75fdf 100644 --- a/utils/h2pas/h2paschk.pas +++ b/utils/h2pas/h2paschk.pas @@ -171,27 +171,27 @@ end; procedure TH2PasCheckerCodeGen.HandleConstant(ConstantID: TIdentifier); begin - HandleConstant(ConstantID,'qword','16','unsigned long long','%016llx'); + HandleConstant(ConstantID,'qword','16','unsigned long long','%016llX'); end; procedure TH2PasCheckerCodeGen.HandleConstantU8(ConstantID: TIdentifier); begin - HandleConstant(ConstantID,'byte','2','unsigned char','%02x'); + HandleConstant(ConstantID,'byte','2','unsigned char','%02X'); end; procedure TH2PasCheckerCodeGen.HandleConstantU16(ConstantID: TIdentifier); begin - HandleConstant(ConstantID,'word','4','unsigned short','%04x'); + HandleConstant(ConstantID,'word','4','unsigned short','%04X'); end; procedure TH2PasCheckerCodeGen.HandleConstantU32(ConstantID: TIdentifier); begin - HandleConstant(ConstantID,'dword','8','unsigned int','%08x'); + HandleConstant(ConstantID,'dword','8','unsigned int','%08X'); end; procedure TH2PasCheckerCodeGen.HandleConstantU64(ConstantID: TIdentifier); begin - HandleConstant(ConstantID,'qword','16','unsigned int','%016llx'); + HandleConstant(ConstantID,'qword','16','unsigned int','%016llX'); end; procedure TH2PasCheckerCodeGen.HandleSignedConstant(ConstantID: TIdentifier); |