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

@ -128,6 +128,8 @@ ERROR: node is still EOpNull!
Linked vertex stage:
ERROR: Linking vertex stage: No function definition (body) found:
g(
Shader version: 100
ERROR: node is still EOpNull!

View file

@ -130,6 +130,10 @@ ERROR: node is still EOpNull!
Linked vertex stage:
ERROR: Linking vertex stage: No function definition (body) found:
sin(f1;
ERROR: Linking vertex stage: No function definition (body) found:
g(
Shader version: 110
ERROR: node is still EOpNull!

View file

@ -131,6 +131,8 @@ ERROR: node is still EOpNull!
Linked vertex stage:
ERROR: Linking vertex stage: No function definition (body) found:
g(
Shader version: 300
ERROR: node is still EOpNull!

View file

@ -127,6 +127,8 @@ ERROR: node is still EOpNull!
Linked vertex stage:
ERROR: Linking vertex stage: No function definition (body) found:
g(
Shader version: 430
ERROR: node is still EOpNull!

View file

@ -0,0 +1,117 @@
missingBodies.vert
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
Shader version: 450
0:? Sequence
0:4 Function Definition: foo( (global void)
0:4 Function Parameters:
0:4 Sequence
0:4 Function Call: bar( (global void)
0:8 Function Definition: C(i1;i1; (global void)
0:8 Function Parameters:
0:8 '' (in int)
0:8 '' (in int)
0:10 Function Definition: A( (global void)
0:10 Function Parameters:
0:10 Sequence
0:10 Function Call: B( (global void)
0:10 Function Call: C(i1; (global void)
0:10 Constant:
0:10 1 (const int)
0:10 Function Call: C(b1; (global void)
0:10 Constant:
0:10 true (const bool)
0:10 Function Call: C(i1;i1; (global void)
0:10 Constant:
0:10 1 (const int)
0:10 Constant:
0:10 2 (const int)
0:12 Function Definition: main( (global void)
0:12 Function Parameters:
0:14 Sequence
0:14 Function Call: foo( (global void)
0:15 Function Call: C(b1; (global void)
0:15 Constant:
0:15 true (const bool)
0:20 Sequence
0:20 move second child to first child (temp int)
0:20 'f1' (global int)
0:20 Function Call: ret1( (global int)
0:22 Function Definition: ret2( (global int)
0:22 Function Parameters:
0:22 Sequence
0:22 Branch: Return with expression
0:22 Constant:
0:22 3 (const int)
0:24 Sequence
0:24 move second child to first child (temp int)
0:24 'f2' (global int)
0:24 Function Call: ret2( (global int)
0:? Linker Objects
0:? 'f1' (global int)
0:? 'f2' (global int)
0:? 'gl_VertexID' (gl_VertexId int VertexId)
0:? 'gl_InstanceID' (gl_InstanceId int InstanceId)
Linked vertex stage:
ERROR: Linking vertex stage: No function definition (body) found:
ret1(
ERROR: Linking vertex stage: No function definition (body) found:
C(b1;
ERROR: Linking vertex stage: No function definition (body) found:
bar(
Shader version: 450
0:? Sequence
0:4 Function Definition: foo( (global void)
0:4 Function Parameters:
0:4 Sequence
0:4 Function Call: bar( (global void)
0:8 Function Definition: C(i1;i1; (global void)
0:8 Function Parameters:
0:8 '' (in int)
0:8 '' (in int)
0:10 Function Definition: A( (global void)
0:10 Function Parameters:
0:10 Sequence
0:10 Function Call: B( (global void)
0:10 Function Call: C(i1; (global void)
0:10 Constant:
0:10 1 (const int)
0:10 Function Call: C(b1; (global void)
0:10 Constant:
0:10 true (const bool)
0:10 Function Call: C(i1;i1; (global void)
0:10 Constant:
0:10 1 (const int)
0:10 Constant:
0:10 2 (const int)
0:12 Function Definition: main( (global void)
0:12 Function Parameters:
0:14 Sequence
0:14 Function Call: foo( (global void)
0:15 Function Call: C(b1; (global void)
0:15 Constant:
0:15 true (const bool)
0:20 Sequence
0:20 move second child to first child (temp int)
0:20 'f1' (global int)
0:20 Function Call: ret1( (global int)
0:22 Function Definition: ret2( (global int)
0:22 Function Parameters:
0:22 Sequence
0:22 Branch: Return with expression
0:22 Constant:
0:22 3 (const int)
0:24 Sequence
0:24 move second child to first child (temp int)
0:24 'f2' (global int)
0:24 Function Call: ret2( (global int)
0:? Linker Objects
0:? 'f1' (global int)
0:? 'f2' (global int)
0:? 'gl_VertexID' (gl_VertexId int VertexId)
0:? 'gl_InstanceID' (gl_InstanceId int InstanceId)

24
Test/missingBodies.vert Normal file
View file

@ -0,0 +1,24 @@
#version 450
void bar();
void foo() { bar(); }
void B();
void C(int);
void C(int, int) { }
void C(bool);
void A() { B(); C(1); C(true); C(1, 2); }
void main()
{
foo();
C(true);
}
int ret1();
int f1 = ret1();
int ret2() { return 3; }
int f2 = ret2();