<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/112099>112099</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
how to get cfg
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
6eanut
</td>
</tr>
</table>
<pre>
I am new to llvm. I was recently trying to generate a cfg diagram of a c program using llvm. But there were some problems.
**environment:**
`ubuntu@ubuntu:~/code$ uname -a
Linux ubuntu 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:26:41 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux
ubuntu@ubuntu:~/code$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.1 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo`
**test:**
i wrote a c program
run the command "clang -S -emit-llvm test.c -o test.ll", and then got a test.ll successly
`ubuntu@ubuntu:~/code$ opt -dot-cfg test.ll
opt: Unknown command line argument '-dot-cfg'. Try: 'opt --help'
opt: Did you mean '--dot-dom'?`
or
`ubuntu@ubuntu:~/code$ opt -passes=dot-cfg test.ll
WARNING: You're attempting to print out a bitcode file.
This is inadvisable as it may cause display problems. If
you REALLY want to taste LLVM bitcode first-hand, you
can force output with the `-f' option.`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVU2P4jgQ_TXmUkqUOCHAgQPdQC9aGhANs-oTKhKTeNexI380y2V_-8pJ6OmZ2R7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