]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programparser.cpp
Remove unused variable and struct declarations from the syntax tree
[libs/gl.git] / source / programparser.cpp
index bf2d42daedbfd232dcc0dd194deb7c60ddf76625..c6cdfd06246f1c14683919fcfec637b8adf85058 100644 (file)
@@ -310,7 +310,7 @@ bool ProgramParser::is_builtin_type(const string &token)
 
 bool ProgramParser::is_type(const string &token)
 {
-       return is_builtin_type(token) || cur_module->structs.count(token);
+       return is_builtin_type(token) || declared_types.count(token);
 }
 
 bool ProgramParser::is_identifier(const string &token)
@@ -550,7 +550,7 @@ StructDeclaration *ProgramParser::parse_struct_declaration()
        parse_block(strct->members, true);
        expect(";");
 
-       cur_module->structs[strct->name] = strct.get();
+       declared_types.insert(strct->name);
        return strct.release();
 }