Add link validation infrastructure for multiple compilation units per stage. Includes a new, straightforward, C++ interface to the front end.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@22927 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2013-09-04 21:19:27 +00:00
parent 2f1eb37d82
commit 69f4b517c2
24 changed files with 655 additions and 161 deletions

View file

@ -909,6 +909,30 @@ void TIntermediate::addSymbolLinkageNode(TIntermAggregate*& linkage, const TVari
linkage = growAggregate(linkage, node);
}
//
// Merge the information in 'unit' into 'this'
//
void TIntermediate::merge(TIntermediate& unit)
{
numMains += unit.numMains;
}
void TIntermediate::errorCheck(TInfoSink& infoSink)
{
if (numMains < 1)
error(infoSink, "Missing entry point: Each stage requires one \"void main()\" entry point");
if (numMains > 1)
error(infoSink, "Too many entry points: Each stage can have at most one \"void main()\" entry point.");
}
void TIntermediate::error(TInfoSink& infoSink, const char* message)
{
infoSink.info.prefix(EPrefixError);
infoSink.info << message << "\n";
++numErrors;
}
//
// This deletes the tree.
//