I want to create a software-generated control flow diagram for this code using LLVM CFG https://github.com/inmcm/Simon_Speck_Ciphers/blob/master/C/speck.c
But when I followed the instructions given on the LLVM webpage (https://www.programmersought.com/article/61364910575/), and typed the following command: clang -S -emit-llvm simon.c -o g.ll
Terminal shows this error message:
clang: error: -emit-llvm cannot be used when linking
I am new to this tool and Linux, can someone please help?
I was able to generate the llvm IR and the CFG dot files for the above mentioned
speck.cfile. The messagecannot be used when linkingappears only when you haven't passed any special flags for output like-S,-c, etc. so I'm guessing you have made some typo in the command.You can try using
clang -save-temps speck.ccommand, which would generate the bitcode (.bc) file for the LLVM IR, which can be used in any place where the.llfile is used.