0

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?

arc111
  • 1
  • 1

1 Answers1

0

I was able to generate the llvm IR and the CFG dot files for the above mentioned speck.c file. The message cannot be used when linking appears 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.c command, which would generate the bitcode (.bc) file for the LLVM IR, which can be used in any place where the .ll file is used.

anirudh
  • 4,116
  • 2
  • 20
  • 35