gpt4 book ai didi

haxe - 在 Haxe 项目中查找未使用的类或死代码

转载 作者:行者123 更新时间:2023-12-05 00:54:22 29 4
gpt4 key购买 nike

有人知道一种自动获取 Haxe 项目中未使用类列表的方法吗?
我没有找到有关此的文档,但该信息应该在某处可用。就像消除死代码后的差异。

最佳答案

可以通过 -D dce-debug 编译得到 DCE 日志. ( relevant entry in the manual )

例如,编译一个 class Hello { static function main() trace("Hello!"); }haxe --interp -main Hello -D dce-debug产生类似的东西:

...
[DCE] Removed field Type.getClass
[DCE] Removed field Type.getEnum
[DCE] Removed field Type.getSuperClass
[DCE] Removed field Type.getClassName
[DCE] Removed field Type.getEnumName
[DCE] Removed field Type.resolveClass
[DCE] Removed field Type.resolveEnum
[DCE] Removed field Type.createInstance
[DCE] Removed field Type.createEmptyInstance
[DCE] Removed field Type.createEnum
[DCE] Removed field Type.createEnumIndex
[DCE] Removed field Type.getInstanceFields
[DCE] Removed field Type.getClassFields
[DCE] Removed field Type.getEnumConstructs
[DCE] Removed field Type.typeof
[DCE] Removed field Type.enumEq
[DCE] Removed field Type.enumConstructor
[DCE] Removed field Type.enumParameters
[DCE] Removed field Type.enumIndex
[DCE] Removed field Type.allEnums
[DCE] Removed class Type
[DCE] Removed enum ValueType
...

关于haxe - 在 Haxe 项目中查找未使用的类或死代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40235585/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com