I'm looking for something like __traits(getAST, fn). The AST should represent only run-time (instantiated) code without any compile-time features. How hard it would be to implement this in the frontend? It would enable analysis of code at compile-time (without the need to modify the compiler).