Refactor TLiveTraverser from the former reflection traverser, for future use in binding mapping.

This PR factors out the code that knows how to walk just the live parts of the AST.
The traverser in reflect.cpp is renamed to TReflectionTraverser, and inherits from
TLiveTraverser, which will also be used by a future binding offset PR.

The code is now smart about the entry point name (no longer hardcoded to "main").

There is an option to traverse all code (live+dead), because a consumer of the
class may wish to use it for both purposes without wanting a whole separate
class hierarchy.
This commit is contained in:
steve-lunarg 2016-09-19 15:35:12 -06:00
parent 6fccb3cd75
commit 55717302ef
4 changed files with 150 additions and 67 deletions

View file

@ -49,7 +49,7 @@ namespace glslang {
class TIntermediate;
class TIntermAggregate;
class TLiveTraverser;
class TReflectionTraverser;
// Data needed for just a single object at the granularity exchanged by the reflection API
class TObjectReflection {
@ -116,7 +116,7 @@ public:
void dump();
protected:
friend class glslang::TLiveTraverser;
friend class glslang::TReflectionTraverser;
// Need a TString hash: typedef std::unordered_map<TString, int> TNameToIndex;
typedef std::map<TString, int> TNameToIndex;