summaryrefslogtreecommitdiff
path: root/src/loadcolm.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/loadcolm.cc')
-rw-r--r--src/loadcolm.cc39
1 files changed, 11 insertions, 28 deletions
diff --git a/src/loadcolm.cc b/src/loadcolm.cc
index 1028da7a..97388eca 100644
--- a/src/loadcolm.cc
+++ b/src/loadcolm.cc
@@ -828,36 +828,19 @@ struct LoadColm
return repeatType;
}
- BstSet<String, CmpStr> defined;
-
- void structHead2( const InputLoc &loc,
- const String &data, ObjectDef::Type objectType )
- {
- Namespace *inNspace = pd->rootNamespace;
-
- ObjectDef *objectDef = ObjectDef::cons( objectType,
- data, pd->nextObjectId++ );
-
- StructDef *context = new StructDef( loc, data, objectDef );
- structStack.push( context );
-
- inNspace->structDefList.append( context );
-
- /* Make the namespace for the struct. */
- createNamespace( loc, data );
- }
+ BstSet<String, CmpStr> genericElDefined;
TypeRef *walkValueList( type_ref typeRef )
{
TypeRef *valType = walkTypeRef( typeRef._type_ref() );
/* Create the value list element. */
- String name( 32, "vlist_el_%s", valType->stringify().data );
+ String name( 32, "vlist_el_%s", valType->stringify().c_str() );
- if ( !defined.find( name ) ) {
- defined.insert( name );
+ if ( !genericElDefined.find( name ) ) {
+ genericElDefined.insert( name );
- structHead2( internal, name, ObjectDef::StructType );
+ structHead( internal, pd->rootNamespace, name, ObjectDef::StructType );
/* Var def. */
String id = "value";
@@ -881,13 +864,13 @@ struct LoadColm
TypeRef *keyType = walkTypeRef( typeRef.KeyType() );
TypeRef *valType = walkTypeRef( typeRef.ValType() );
- String name( 32, "vmap_el_%s_%s", keyType->stringify().data,
- valType->stringify().data );
+ String name( 32, "vmap_el_%s_%s", keyType->stringify().c_str(),
+ valType->stringify().c_str() );
- if ( !defined.find( name ) ) {
- defined.insert( name );
+ if ( !genericElDefined.find( name ) ) {
+ genericElDefined.insert( name );
- structHead2( internal, name, ObjectDef::StructType );
+ structHead( internal, pd->rootNamespace, name, ObjectDef::StructType );
/* Var def. */
String id = "value";
@@ -2327,7 +2310,7 @@ struct LoadColm
void walkStructDef( struct_def structDef )
{
String name = structDef.id().data();
- structHead( structDef.id().loc(), name, ObjectDef::StructType );
+ structHead( structDef.id().loc(), curNspace(), name, ObjectDef::StructType );
_repeat_struct_item structItemList = structDef.ItemList();
while ( !structItemList.end() ) {