在Clang 10中查看CFG

问题描述

根据分析器manual,我们应该能够通过以下方式以点格式查看CFG:

$ clang -cc1 -analyze -analyzer-checker=debug.ViewCFG test.c

但是,当我执行命令时什么也没发生。

就像Clang在我们拥有的地方使用LLVM的CFG printer

/// viewCFG - This function is meant for use from the debugger.  You can just
/// say 'call F->viewCFG()' and a ghostview window should pop up from the
/// program,displaying the CFG of the current function.  This depends on there
/// being a 'dot' and 'gv' program in your path.

我确保dotgv在我的路径中,但还是没有运气,即没有创建点文件,也没有弹出窗口。

如果我直接使用opt,例如opt -view-cfg -analyze test.bc,则会发出一个文件

这是在Clang上解决的吗?

我在使用Clang / LLVM 10的Fedora32上。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)