Linker: Walk the call graph to report an error on missing bodies.

This commit is contained in:
John Kessenich 2016-12-08 21:01:59 -07:00
parent e795cc915c
commit 6a60c2f9ea
11 changed files with 228 additions and 8 deletions

View file

@ -67,7 +67,9 @@ struct TVectorFields {
// by TIntermediate.
//
// Used for detecting recursion: A "call" is a pair: <caller, callee>.
// Used for call-graph algorithms for detecting recursion, missing bodies, and dead bodies.
// A "call" is a pair: <caller, callee>.
// There can be duplicates. General assumption is the list is small.
struct TCall {
TCall(const TString& pCaller, const TString& pCallee) : caller(pCaller), callee(pCallee) { }
TString caller;
@ -75,6 +77,7 @@ struct TCall {
bool visited;
bool currentPath;
bool errorGiven;
int calleeBodyPosition;
};
// A generic 1-D range.
@ -393,6 +396,7 @@ protected:
void mergeImplicitArraySizes(TType&, const TType&);
void mergeErrorCheck(TInfoSink&, const TIntermSymbol&, const TIntermSymbol&, bool crossStage);
void checkCallGraphCycles(TInfoSink&);
void checkCallGraphBodies(TInfoSink&);
void inOutLocationCheck(TInfoSink&);
TIntermSequence& findLinkerObjects() const;
bool userOutputUsed() const;