diff options
author | Adrian Thurston <thurston@complang.org> | 2014-12-20 12:07:22 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2014-12-20 12:07:22 -0500 |
commit | 9153bb402e7f18df2c600a716021e004438aaf1e (patch) | |
tree | 07f0101a684424b80ea78790260d09fe43d167e9 /src/pdabuild.cc | |
parent | 0b6d8c987f90868c6fc6ed1aa3346d6cd10201aa (diff) | |
download | colm-9153bb402e7f18df2c600a716021e004438aaf1e.tar.gz |
added structElInfo to the runtime data
Storing size and can add trees offsets for downreffing on free.
Diffstat (limited to 'src/pdabuild.cc')
-rw-r--r-- | src/pdabuild.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/pdabuild.cc b/src/pdabuild.cc index f644d2e7..67bdd262 100644 --- a/src/pdabuild.cc +++ b/src/pdabuild.cc @@ -199,6 +199,13 @@ void Compiler::makeLangElIds() assert( ignoreLangEl->id == LEL_ID_IGNORE ); } +void Compiler::makeStructElIds() +{ + int nextId = 0; + for ( StructElList::Iter sel = structEls; sel.lte(); sel++ ) + sel->id = nextId++; +} + void Compiler::refNameSpace( LangEl *lel, Namespace *nspace ) { if ( nspace == rootNamespace ) { @@ -1446,6 +1453,19 @@ void Compiler::makeRuntimeData() } /* + * selInfo + */ + + count = structEls.length(); + runtimeData->selInfo = new StructElInfo[count]; + runtimeData->numStructEls = count; + memset( runtimeData->selInfo, 0, sizeof(StructElInfo)*count ); + StructElList::Iter sel = structEls; + for ( int i = 0; i < count; i++, sel++ ) { + runtimeData->selInfo[i].size = sel->context->objectDef->size(); + } + + /* * FunctionInfo */ count = functionList.length(); |