Defect #681 ยป forward.patch
tools/obemitter.cpp (working copy) | ||
---|---|---|
const auto record = IsPointer (*designator.type) ? DereferenceRecord (designator) : DesignateRecord (designator);
|
||
if (!HasDynamicType (designator) || IsFinal (*expression.selector.declaration)) return {Designate (*expression.selector.declaration), record};
|
||
const auto address = record.address, descriptor = MakeRegister (record.descriptor);
|
||
return {MakeMemory (platform.function, descriptor, ProcedureTableOffset * platform.function.size - Displacement (expression.selector.declaration->procedure.index) * platform.function.size), {address, descriptor}};
|
||
return {MakeMemory (platform.function, descriptor, ProcedureTableOffset * platform.function.size - Displacement (GetDefinition (*expression.selector.declaration).procedure.index) * platform.function.size), {address, descriptor}};
|
||
}
|
||
default:
|
tools/oberon.cpp (working copy) | ||
---|---|---|
auto array = &type; while (dimension && IsArray (*array)) --dimension, array = array->array.elementType; assert (!dimension); assert (IsArray (*array)); return *array;
|
||
}
|
||
const Declaration& Oberon::GetDefinition (const Declaration& declaration)
|
||
{
|
||
return IsForward (declaration) ? GetDefinition (*declaration.storage.definition) : declaration;
|
||
}
|
||
Size Oberon::CountDimensions (const Type& type)
|
||
{
|
||
Size count = 0; auto array = &type; while (IsArray (*array)) ++count, array = array->array.elementType; return count;
|
tools/oberon.hpp (working copy) | ||
---|---|---|
auto CountOpenDimensions (const Type&) -> Size;
|
||
auto GetArgument (const Expression&, Size) -> Expression&;
|
||
auto GetArray (const Type&, Size) -> const Type&;
|
||
auto GetDefinition (const Declaration&) -> const Declaration&;
|
||
auto GetFilename (const QualifiedIdentifier&) -> Source;
|
||
auto GetModule (const Scope&) -> Module&;
|
||
auto GetOptionalArgument (const Expression&, Size) -> Expression*;
|