An array that a SORTA sorts keeps the name of its helper _QRNI_SORT_A_<name> #804
Loading…
Reference in a new issue
No description provided.
Delete branch "ldev4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An array that a SORTA sorts keeps the name of its helper
_QRNI_SORT_A_<name>Two development programs whose round trips compile with the same instructions
and the same control flow as the original, and differ in the constant area and
the initialization only (the sizes of both are equal), have one cause: the
helper procedure of
SORTA.The compiler writes a helper
_QRNI_SORT_A_<array name>(_QRNI_SORT_D_forSORTA(D)) for each array that the source sorts, and the stripped object keepsits name. The names of the symbols are gone, so the emit called the array
A_00256, and the rebuild named the helper_QRNI_SORT_A_A_00256. The twoprocedure names are strings of the object: the constant area and the
initialization differ by them and by nothing else.
rpg_sort_names.zig(new, PURE) reads the helpers of the module and gives thearray of each its name:
rpg_sorta.sortedBy, new: the samefour measured bodies as a call, without the call, and the symbol
ARof thebody), and the name proves the direction (
rpg_sort_value.arrayNameOf:_QRNI_SORT_A_for an ascending body,_QRNI_SORT_D_for a descending one);SORTA qwithDCL-S q PACKED(7:2) DIM(10)has the helper_QRNI_SORT_A_Qand the array is declaredQ.The array gets that name when all of these hold, and keeps its placeholder when
one fails (each rule has a test of the emitted text,
rpg_sort_names_test.zig):_,at most 30 characters (8 in the fixed and mixed forms: a factor holds 14, and
the placeholders after a kept name are the name,
_and 5 digits). RPGallows 4096 and a source line holds 100, but a name of 100 characters made
every declaration after it "longer than 100 bytes" (13 failures against the 3
of lsrt-sorta-subarr-sn, measured with a throwaway test), and 60 characters
cost none. 30 is a limit of this change, below what was measured; a longer
name keeps the placeholder;
SORTAandSORTA(D)of the same array have the samesuffix and agree; two different suffixes for one array name neither
(policy test, no probe sorts one array both ways);
keep their placeholders (policy test);
the module, the imports, the file and record names, the SQL host names and
every other kept name (probe lsrt-sorta-all, a procedure named
wordsbeside a helper_QRNI_SORT_A_WORDS);A_00254,V00254,A_00253_F10): the placeholders are computed after the kept names;dcl-sarray: the emitter has anarray_elementfact for it, the declaration has a
dim(, it is no parameter and no basedfield, no data structure proves it (
ds_arrays), every part of it that astatement names is an element, and its length is the dimension times the
width;
the symbols, and two names of arrays that do not sort as their symbols are
numbered stay out (neither is kept):
rpg_sort_names.inOrder, which takes thecomparison as
names_mod.udatePlacedoes. The slot of UDATE is not among thoseneighbours: it is placed after this pass, with the new names among the kept
names, and omitted when it has no place, as it is for a procedure name.
A kept name is an anchor, as a procedure name is (
nameSymbols): the compilernumbers the symbols in the order of their names, and the placeholders around the
name sort between it and the next kept name. So the names near a renamed array
change too. lsrt-sorta-char (
SORTA %SUBARR(c: 1: n)) wroteA_00254for thearray and
A_00256forn; it writesCandC_00256(the prefix of the nextrun is the kept name and
_,rpg_source.namePrefix). The names that thisproduces are the names of the source on every public probe:
A,C,Q,INTEGER_LIST,ZONED_VALUES.Deviation from the brief:
#,@and$are not accepted in the suffix.@isa variant character of CCSID 273 and a name with it does not compile
(
rpg_source.tagPrefix, calibration K). The placeholders after a kept name startwith that name and
_, andA#B_00254is split at the#by the name check ofthe emitter (
the name B_00255 names no symbol): the first run of the testmeasured 5 failures against the 3 of the probe.
$was not run apart from#;it is refused with it. Such a name keeps the placeholder until the
prefix and the check handle it; a capture of an array with a
#or$in itsname is the probe that a rule needs.
Out of scope, and why:
The object has one symbol for the structure and for an array that fills it, so
the suffix cannot show whether it is
ROW#2_Xof a structure or a plain arrayof that name; the emitter declares both as a
dcl-sarray (isStructurereturns false for an array first). Only what a structure proves is refused
(
ds_arrays, a part that is no element); the case needs a probe that sortsds.arr, and until it exists the mapping is not proved.reading of the columns and is tested through
validName, not through an emit.plainArray(a parameter, a based field, a faileddeclaration, an array that a structure proves, a part that is no element, a
length that is not dimension times width) have no probe: no capture sorts such
an array. The test of the helper names and of the order is on the policy.
because the symbol numbers contradict a helper name and the object does not
say which.
Tests:
rpg_sort_names_test.zig(new): the whole array,SORTA(D),%SUBARR,the other uses of the name and the names after it (lsrt-sorta-all, -desc,
-char, -subarr-n); a helper suffix of another name (
TOTALS); a name of 30characters costs no statement (lsrt-sorta-subarr-sn); the suffixes
1A,a,_A,9,A#B,A$B,A@B,#B, a suffix of 31 characters,A_00254,V00254andA_00253_F10refuse;sortedByof the two directions, of a symbolthat is no procedure, of one outside the module and of a changed comparison;
foundwith no names, a name of the other direction and a limit below thename;
inOrderfor a name between its neighbours, below, above, equal to thekept name, two out of order, and a drop that exposes a new pair; the suffix equal to the name of
another procedure refuses (and names the array when the other procedure has
another name); the policy on its own for one array with two names, one name for
two arrays, SORTA and SORTA(D) agreeing, a taken name in either case, and the
valid names.
rpg_lsrt_test.zigandrpg_lsrt2_test.zigpinned theplaceholders of the 14 SORTA probes: they pin the names of the source now (
A,C,Q,INTEGER_LIST,ZONED_VALUES).Before and after, the Debug build of this branch against the Debug build of
the ldev3 worktree before this change: the 34 cases of the batteries lsrt-sorta and lsrt-sorta2
change in 14 emits, the 14 that have a SORTA; the 20
%LOOKUPcases are the samebytes. In all 34 the counts of statements, emitted and failures and the count of
failure and placeholder comment lines are equal. The census is 645 recovered, 0
regressions, 0 newly recovered. The development programs p3 and p4 (a fit
measurement, not evidence of a rule) name their two sorted arrays and every use
of them as the helper does, and the fields after them take the prefix of the
last kept name and
_; their emitted and failure counts are equal. Whether therecompile of either now matches is the host gate of the coordinator.
Gate (host round trips, base = ldev3 build, the code of v0.1.520)
7c49fcb520dfd1fedca4