Possible to detect unused functions (or variables)?

Started by
1 comment, last by WitchLord 1 year, 3 months ago

I was wondering if it's possible to detect unused functions (or variables). This would be a very minimal impact thing, but the larger a script, the longer it takes to compile, and if you have a lot of unused stuff I imagine that can impact it quite a bit.

Is it possible for me to write code for this or would it require some API changes/additions in Angelscript?

Advertisement

I actually had a similar question not too long ago.

I think it can be done without modifying the API using the methods available for reflection and JIT compilation, but perhaps it will be easier with some changes to the API to expose internal logic. The implementation of the internal method asCScriptFunction::FindNextFunctionCalled is particularly useful, as it shows how to iterate through the bytecode in the script functions to identify the functions that are called from another function.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement