summaryrefslogtreecommitdiff
path: root/src/pdabuild.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2014-12-20 12:07:22 -0500
committerAdrian Thurston <thurston@complang.org>2014-12-20 12:07:22 -0500
commit9153bb402e7f18df2c600a716021e004438aaf1e (patch)
tree07f0101a684424b80ea78790260d09fe43d167e9 /src/pdabuild.cc
parent0b6d8c987f90868c6fc6ed1aa3346d6cd10201aa (diff)
downloadcolm-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.cc20
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();