mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-30 14:31:04 +00:00
Rename itype field of initializerRecord to basetype.
This commit is contained in:
parent
b6d3dfb075
commit
8cfc14b50a
@ -328,7 +328,7 @@ type
|
|||||||
case isConstant: boolean of {is this a constant initializer?}
|
case isConstant: boolean of {is this a constant initializer?}
|
||||||
false: (iTree: tokenPtr);
|
false: (iTree: tokenPtr);
|
||||||
true : ( {Note: qVal.lo must overlap iVal}
|
true : ( {Note: qVal.lo must overlap iVal}
|
||||||
case itype: baseTypeEnum of
|
case basetype: baseTypeEnum of
|
||||||
cgByte,
|
cgByte,
|
||||||
cgUByte,
|
cgUByte,
|
||||||
cgWord,
|
cgWord,
|
||||||
|
30
Parser.pas
30
Parser.pas
@ -1888,13 +1888,13 @@ var
|
|||||||
iPtr^.isStructOrUnion := false;
|
iPtr^.isStructOrUnion := false;
|
||||||
iPtr^.iVal := bitvalue;
|
iPtr^.iVal := bitvalue;
|
||||||
if bitcount <= 8 then
|
if bitcount <= 8 then
|
||||||
iPtr^.itype := cgUByte
|
iPtr^.basetype := cgUByte
|
||||||
else if bitcount <= 16 then
|
else if bitcount <= 16 then
|
||||||
iPtr^.itype := cgUWord
|
iPtr^.basetype := cgUWord
|
||||||
else if bitcount > 24 then
|
else if bitcount > 24 then
|
||||||
iPtr^.itype := cgULong
|
iPtr^.basetype := cgULong
|
||||||
else begin {3-byte bitfield: split into two parts}
|
else begin {3-byte bitfield: split into two parts}
|
||||||
iPtr^.itype := cgUWord;
|
iPtr^.basetype := cgUWord;
|
||||||
iPtr^.iVal := bitvalue & $0000FFFF;
|
iPtr^.iVal := bitvalue & $0000FFFF;
|
||||||
bitcount := bitcount - 16;
|
bitcount := bitcount - 16;
|
||||||
bitvalue := bitvalue >> 16;
|
bitvalue := bitvalue >> 16;
|
||||||
@ -2064,7 +2064,7 @@ var
|
|||||||
iPtr^.qval.hi := 0;
|
iPtr^.qval.hi := 0;
|
||||||
iPtr^.iVal := expressionValue;
|
iPtr^.iVal := expressionValue;
|
||||||
end; {else}
|
end; {else}
|
||||||
iPtr^.itype := tp^.baseType;
|
iPtr^.basetype := tp^.baseType;
|
||||||
InitializeBitField;
|
InitializeBitField;
|
||||||
end; {if}
|
end; {if}
|
||||||
case tp^.kind of
|
case tp^.kind of
|
||||||
@ -2128,7 +2128,7 @@ var
|
|||||||
if (etype = stringTypePtr) or (etype = utf16StringTypePtr)
|
if (etype = stringTypePtr) or (etype = utf16StringTypePtr)
|
||||||
or (etype = utf32StringTypePtr) then begin
|
or (etype = utf32StringTypePtr) then begin
|
||||||
iPtr^.isConstant := true;
|
iPtr^.isConstant := true;
|
||||||
iPtr^.iType := ccPointer;
|
iPtr^.basetype := ccPointer;
|
||||||
iPtr^.pval := 0;
|
iPtr^.pval := 0;
|
||||||
iPtr^.pPlus := false;
|
iPtr^.pPlus := false;
|
||||||
iPtr^.isName := false;
|
iPtr^.isName := false;
|
||||||
@ -2137,7 +2137,7 @@ var
|
|||||||
else if etype^.kind = scalarType then
|
else if etype^.kind = scalarType then
|
||||||
if etype^.baseType in [cgByte..cgULong] then
|
if etype^.baseType in [cgByte..cgULong] then
|
||||||
if expressionValue = 0 then
|
if expressionValue = 0 then
|
||||||
iPtr^.iType := cgULong
|
iPtr^.basetype := cgULong
|
||||||
else begin
|
else begin
|
||||||
Error(47);
|
Error(47);
|
||||||
errorFound := true;
|
errorFound := true;
|
||||||
@ -2145,7 +2145,7 @@ var
|
|||||||
else if etype^.baseType in [cgQuad,cgUQuad] then
|
else if etype^.baseType in [cgQuad,cgUQuad] then
|
||||||
if (llExpressionValue.hi = 0) and
|
if (llExpressionValue.hi = 0) and
|
||||||
(llExpressionValue.lo = 0) then
|
(llExpressionValue.lo = 0) then
|
||||||
iPtr^.iType := cgULong
|
iPtr^.basetype := cgULong
|
||||||
else begin
|
else begin
|
||||||
Error(47);
|
Error(47);
|
||||||
errorFound := true;
|
errorFound := true;
|
||||||
@ -2155,7 +2155,7 @@ var
|
|||||||
errorFound := true;
|
errorFound := true;
|
||||||
end {else}
|
end {else}
|
||||||
else if etype^.kind = pointerType then begin
|
else if etype^.kind = pointerType then begin
|
||||||
iPtr^.iType := cgULong;
|
iPtr^.basetype := cgULong;
|
||||||
iPtr^.pval := expressionValue;
|
iPtr^.pval := expressionValue;
|
||||||
end {else if}
|
end {else if}
|
||||||
else begin
|
else begin
|
||||||
@ -2179,7 +2179,7 @@ var
|
|||||||
or ((tp^.kind = scalarType) and (tp^.baseType in [cgLong,cgULong])))
|
or ((tp^.kind = scalarType) and (tp^.baseType in [cgLong,cgULong])))
|
||||||
and (bitsize = 0)
|
and (bitsize = 0)
|
||||||
then begin
|
then begin
|
||||||
iPtr^.iType := ccPointer;
|
iPtr^.basetype := ccPointer;
|
||||||
if variable^.storage in [external,global,private] then begin
|
if variable^.storage in [external,global,private] then begin
|
||||||
|
|
||||||
{do pointer constants with + or -}
|
{do pointer constants with + or -}
|
||||||
@ -2431,13 +2431,13 @@ var
|
|||||||
{iPtr^.isStructOrUnion := false;}
|
{iPtr^.isStructOrUnion := false;}
|
||||||
if iPtr^.isConstant then begin
|
if iPtr^.isConstant then begin
|
||||||
if tp^.kind = scalarType then
|
if tp^.kind = scalarType then
|
||||||
iPtr^.itype := tp^.baseType
|
iPtr^.basetype := tp^.baseType
|
||||||
else if tp^.kind = pointertype then begin
|
else if tp^.kind = pointertype then begin
|
||||||
iPtr^.itype := cgULong;
|
iPtr^.basetype := cgULong;
|
||||||
{iPtr^.iVal := 0;}
|
{iPtr^.iVal := 0;}
|
||||||
end {else if}
|
end {else if}
|
||||||
else begin
|
else begin
|
||||||
iPtr^.itype := cgWord;
|
iPtr^.basetype := cgWord;
|
||||||
Error(47);
|
Error(47);
|
||||||
errorFound := true;
|
errorFound := true;
|
||||||
end; {else}
|
end; {else}
|
||||||
@ -2530,7 +2530,7 @@ var
|
|||||||
iPtr^.isStructOrUnion := false;
|
iPtr^.isStructOrUnion := false;
|
||||||
if (variable^.storage in [external,global,private]) then begin
|
if (variable^.storage in [external,global,private]) then begin
|
||||||
iPtr^.isConstant := true;
|
iPtr^.isConstant := true;
|
||||||
iPtr^.itype := cgString;
|
iPtr^.basetype := cgString;
|
||||||
iPtr^.sval := token.sval;
|
iPtr^.sval := token.sval;
|
||||||
count := tp^.elements - stringLength;
|
count := tp^.elements - stringLength;
|
||||||
if count > 0 then
|
if count > 0 then
|
||||||
@ -4775,7 +4775,7 @@ iPtr^.count := 1;
|
|||||||
{iPtr^.bitsize := 0;}
|
{iPtr^.bitsize := 0;}
|
||||||
{iPtr^.isStructOrUnion := false;}
|
{iPtr^.isStructOrUnion := false;}
|
||||||
iPtr^.isConstant := true;
|
iPtr^.isConstant := true;
|
||||||
iPtr^.itype := cgString;
|
iPtr^.basetype := cgString;
|
||||||
iPtr^.sval := sval;
|
iPtr^.sval := sval;
|
||||||
id^.iPtr := iPtr;
|
id^.iPtr := iPtr;
|
||||||
|
|
||||||
|
12
Symbol.pas
12
Symbol.pas
@ -699,17 +699,17 @@ procedure DoGlobals;
|
|||||||
Gen2Name(dc_glb, 0, ord(sp^.storage = private), sp^.name);
|
Gen2Name(dc_glb, 0, ord(sp^.storage = private), sp^.name);
|
||||||
ip := sp^.iPtr;
|
ip := sp^.iPtr;
|
||||||
while ip <> nil do begin
|
while ip <> nil do begin
|
||||||
case ip^.itype of
|
case ip^.basetype of
|
||||||
cgByte,cgUByte,cgWord,cgUWord: begin
|
cgByte,cgUByte,cgWord,cgUWord: begin
|
||||||
lval := ip^.ival;
|
lval := ip^.ival;
|
||||||
Gen2t(dc_cns, long(lval).lsw, ip^.count, ip^.itype);
|
Gen2t(dc_cns, long(lval).lsw, ip^.count, ip^.basetype);
|
||||||
end;
|
end;
|
||||||
cgLong,cgULong:
|
cgLong,cgULong:
|
||||||
GenL1(dc_cns, ip^.ival, ip^.count);
|
GenL1(dc_cns, ip^.ival, ip^.count);
|
||||||
cgQuad,cgUQuad:
|
cgQuad,cgUQuad:
|
||||||
GenQ1(dc_cns, ip^.qval, ip^.count);
|
GenQ1(dc_cns, ip^.qval, ip^.count);
|
||||||
cgReal,cgDouble,cgComp,cgExtended:
|
cgReal,cgDouble,cgComp,cgExtended:
|
||||||
GenR1t(dc_cns, ip^.rval, ip^.count, ip^.itype);
|
GenR1t(dc_cns, ip^.rval, ip^.count, ip^.basetype);
|
||||||
cgString:
|
cgString:
|
||||||
GenS(dc_cns, ip^.sval);
|
GenS(dc_cns, ip^.sval);
|
||||||
ccPointer: begin
|
ccPointer: begin
|
||||||
@ -790,17 +790,17 @@ procedure DoGlobals;
|
|||||||
if sp^.state = initialized then begin
|
if sp^.state = initialized then begin
|
||||||
Gen2Name(dc_glb, 0, ord(sp^.storage = private), sp^.name);
|
Gen2Name(dc_glb, 0, ord(sp^.storage = private), sp^.name);
|
||||||
ip := sp^.iPtr;
|
ip := sp^.iPtr;
|
||||||
case ip^.itype of
|
case ip^.basetype of
|
||||||
cgByte,cgUByte,cgWord,cgUWord: begin
|
cgByte,cgUByte,cgWord,cgUWord: begin
|
||||||
lval := ip^.ival;
|
lval := ip^.ival;
|
||||||
Gen2t(dc_cns, long(lval).lsw, 1, ip^.itype);
|
Gen2t(dc_cns, long(lval).lsw, 1, ip^.basetype);
|
||||||
end;
|
end;
|
||||||
cgLong,cgULong:
|
cgLong,cgULong:
|
||||||
GenL1(dc_cns, ip^.ival, 1);
|
GenL1(dc_cns, ip^.ival, 1);
|
||||||
cgQuad,cgUQuad:
|
cgQuad,cgUQuad:
|
||||||
GenQ1(dc_cns, ip^.qval, 1);
|
GenQ1(dc_cns, ip^.qval, 1);
|
||||||
cgReal,cgDouble,cgComp,cgExtended:
|
cgReal,cgDouble,cgComp,cgExtended:
|
||||||
GenR1t(dc_cns, ip^.rval, 1, ip^.itype);
|
GenR1t(dc_cns, ip^.rval, 1, ip^.basetype);
|
||||||
cgString:
|
cgString:
|
||||||
GenS(dc_cns, ip^.sval);
|
GenS(dc_cns, ip^.sval);
|
||||||
ccPointer: begin
|
ccPointer: begin
|
||||||
|
Loading…
Reference in New Issue
Block a user