KalebDark / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

Add a way to quickly end an AST Traversal #827

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In the translator we sometimes traverse the AST to check the existence of 
things. It would be useful to have a way to say we are finished with the 
traversal to end it quickly. Right now when implementing a new TIntermTraverser 
we can either:
1) traverse the whole AST and ignore  everything after we have found what we 
wanted
2) override all the other visit* to return false when we found something.

1) isn't efficient CPU wise and 2) isn't efficient developer-time wise. It 
would be better to have a way to ask for the traversal to stop, and change 
NodeSearch and DetectDiscontinuity to use that.

Original issue reported on code.google.com by cwal...@chromium.org on 10 Nov 2014 at 8:36