|
@@ -299,7 +299,7 @@ TYPE
|
|
IF baseType # NIL THEN
|
|
IF baseType # NIL THEN
|
|
offset := baseType.sizeInBits; alignment := baseType.alignmentInBits;
|
|
offset := baseType.sizeInBits; alignment := baseType.alignmentInBits;
|
|
ELSE
|
|
ELSE
|
|
- offset := 0; alignment := dataUnit;
|
|
|
|
|
|
+ offset := 0; alignment := x.alignmentInBits;
|
|
END;
|
|
END;
|
|
|
|
|
|
variable := x.recordScope.firstVariable;
|
|
variable := x.recordScope.firstVariable;
|
|
@@ -319,7 +319,7 @@ TYPE
|
|
INC(offset,size);
|
|
INC(offset,size);
|
|
variable := variable.nextVariable;
|
|
variable := variable.nextVariable;
|
|
END;
|
|
END;
|
|
- x.SetAlignment(alignment);
|
|
|
|
|
|
+ x.SetAlignmentInBits(alignment);
|
|
Basic.Align(offset, alignment); (* strictly speaking not necessary, but with the old object file format otherwise problems with the GC show up *)
|
|
Basic.Align(offset, alignment); (* strictly speaking not necessary, but with the old object file format otherwise problems with the GC show up *)
|
|
x.SetSize(offset);
|
|
x.SetSize(offset);
|
|
RETURN TRUE
|
|
RETURN TRUE
|
|
@@ -355,7 +355,7 @@ TYPE
|
|
INC(offset,size);
|
|
INC(offset,size);
|
|
variable := variable.nextVariable;
|
|
variable := variable.nextVariable;
|
|
END;
|
|
END;
|
|
- x.SetAlignment(alignment);
|
|
|
|
|
|
+ x.SetAlignmentInBits(alignment);
|
|
Basic.Align(offset, alignment); (* strictly speaking not necessary, but with the old object file format otherwise problems with the GC show up *)
|
|
Basic.Align(offset, alignment); (* strictly speaking not necessary, but with the old object file format otherwise problems with the GC show up *)
|
|
x.SetSize(offset);
|
|
x.SetSize(offset);
|
|
RETURN TRUE
|
|
RETURN TRUE
|
|
@@ -581,7 +581,7 @@ TYPE
|
|
BEGIN
|
|
BEGIN
|
|
type := type.resolved;
|
|
type := type.resolved;
|
|
IF type IS SyntaxTree.RecordType THEN
|
|
IF type IS SyntaxTree.RecordType THEN
|
|
- IF type.alignmentInBits < 0 THEN
|
|
|
|
|
|
+ IF type.alignmentInBits <= 0 THEN
|
|
IF GenerateRecordOffsets(type(SyntaxTree.RecordType)) THEN
|
|
IF GenerateRecordOffsets(type(SyntaxTree.RecordType)) THEN
|
|
result := type.alignmentInBits
|
|
result := type.alignmentInBits
|
|
END
|
|
END
|
|
@@ -589,13 +589,13 @@ TYPE
|
|
result := type.alignmentInBits
|
|
result := type.alignmentInBits
|
|
END;
|
|
END;
|
|
ELSIF type IS SyntaxTree.ArrayType THEN
|
|
ELSIF type IS SyntaxTree.ArrayType THEN
|
|
- IF type.alignmentInBits <0 THEN
|
|
|
|
|
|
+ IF type.alignmentInBits <= 0 THEN
|
|
IF type(SyntaxTree.ArrayType).form = SyntaxTree.Static THEN
|
|
IF type(SyntaxTree.ArrayType).form = SyntaxTree.Static THEN
|
|
result := AlignmentOf(alignment,type(SyntaxTree.ArrayType).arrayBase.resolved);
|
|
result := AlignmentOf(alignment,type(SyntaxTree.ArrayType).arrayBase.resolved);
|
|
ELSE
|
|
ELSE
|
|
result := alignment.max
|
|
result := alignment.max
|
|
END;
|
|
END;
|
|
- type.SetAlignment(result)
|
|
|
|
|
|
+ type.SetAlignmentInBits(result)
|
|
ELSE
|
|
ELSE
|
|
result := type.alignmentInBits
|
|
result := type.alignmentInBits
|
|
END;
|
|
END;
|