mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-28 16:30:59 +00:00
Remove some unnecessary/duplicate code.
This mainly comments out statements that zero out data that was already set to zero by a preceding Calloc call.
This commit is contained in:
parent
60efb4d882
commit
fd54fd70d0
4
DAG.pas
4
DAG.pas
@ -3343,7 +3343,7 @@ var
|
||||
str^.opcode := pc_str;
|
||||
str^.optype := optype;
|
||||
str^.r := llab;
|
||||
str^.q := 0;
|
||||
{str^.q := 0;}
|
||||
str^.left := op2;
|
||||
if lop = nil then begin {insert the store in the basic block}
|
||||
str^.next := bb^.code;
|
||||
@ -4941,7 +4941,7 @@ var
|
||||
str^.opcode := pc_str;
|
||||
str^.optype := optype;
|
||||
str^.r := loc^.r;
|
||||
str^.q := 0;
|
||||
{str^.q := 0;}
|
||||
str^.left := op2;
|
||||
str^.next := loc^.next; {insert the store in the basic block}
|
||||
loc^.next := str;
|
||||
|
@ -1971,15 +1971,11 @@ var
|
||||
{get controlling type after conversions}
|
||||
if expressionType^.kind = functionType then begin
|
||||
controllingType.size := cgPointerSize;
|
||||
controllingType.saveDisp := 0;
|
||||
controllingType.qualifiers := [];
|
||||
controllingType.kind := pointerType;
|
||||
controllingType.pType := expressionType;
|
||||
end {if}
|
||||
else if expressionType^.kind in [structType,unionType] then begin
|
||||
controllingType.size := expressionType^.size;
|
||||
controllingType.saveDisp := 0;
|
||||
controllingType.qualifiers := [];
|
||||
controllingType.kind := definedType;
|
||||
controllingType.dType := expressionType;
|
||||
end {else if}
|
||||
@ -1988,9 +1984,9 @@ var
|
||||
if controllingType.kind = arrayType then begin
|
||||
controllingType.kind := pointerType;
|
||||
controllingType.size := cgPointerSize;
|
||||
controllingType.saveDisp := 0;
|
||||
end; {if}
|
||||
controllingType.qualifiers := [];
|
||||
controllingType.saveDisp := 0;
|
||||
|
||||
typesSeen := nil;
|
||||
resultExpr := nil;
|
||||
@ -2068,7 +2064,7 @@ var
|
||||
resultExpr := pointer(Calloc(sizeof(tokenRecord)));
|
||||
resultExpr^.token.kind := intconst;
|
||||
resultExpr^.token.class := intConstant;
|
||||
resultExpr^.token.ival := 0;
|
||||
{resultExpr^.token.ival := 0;}
|
||||
end; {if}
|
||||
if resultExpr <> nil then begin
|
||||
resultExpr^.next := stack; {stack the resulting expression}
|
||||
|
14
Parser.pas
14
Parser.pas
@ -4684,8 +4684,8 @@ table := functionTable;
|
||||
len := ord(functionName^[0]) + 1;
|
||||
tp := pointer(GCalloc(sizeof(typeRecord)));
|
||||
tp^.size := len;
|
||||
tp^.saveDisp := 0;
|
||||
tp^.qualifiers := [];
|
||||
{tp^.saveDisp := 0;}
|
||||
{tp^.qualifiers := [];}
|
||||
tp^.kind := arrayType;
|
||||
tp^.aType := constCharPtr;
|
||||
tp^.elements := len;
|
||||
@ -4695,13 +4695,13 @@ sval := pointer(GCalloc(len + sizeof(integer)));
|
||||
sval^.length := len;
|
||||
for i := 1 to len-1 do
|
||||
sval^.str[i] := functionName^[i];
|
||||
sval^.str[len] := chr(0);
|
||||
{sval^.str[len] := chr(0);}
|
||||
iPtr := pointer(GCalloc(sizeof(initializerRecord)));
|
||||
iPtr^.next := nil;
|
||||
{iPtr^.next := nil;}
|
||||
iPtr^.count := 1;
|
||||
iPtr^.bitdisp := 0;
|
||||
iPtr^.bitsize := 0;
|
||||
iPtr^.isStructOrUnion := false;
|
||||
{iPtr^.bitdisp := 0;}
|
||||
{iPtr^.bitsize := 0;}
|
||||
{iPtr^.isStructOrUnion := false;}
|
||||
iPtr^.isConstant := true;
|
||||
iPtr^.itype := cgString;
|
||||
iPtr^.sval := sval;
|
||||
|
Loading…
Reference in New Issue
Block a user