clang interleaved source and assembly

assembly, c++, clang, gcc, visual-studio

Solution

There seems to be a bug reported sometimes last year stating exactly this: http://llvm.org/bugs/show_bug.cgi?id=16647

Bug 16647 - No option to produce mixed source + assembly listing?

So since it is still `NEW` I guess clang does not have this supported yet.

As an alternative, how about compiling your code and then use `objdump -S` ? The output format is somewhat similar ...

Problem

Wondering if it is possible to generate interleaved source and assembly from clang? I am looking for something equivalent to gcc command (as demonstrated at http://www.fclose.com/240/generate-a-mixed-source-and-assembly-listing-using-gcc/) ``` gcc -Wa,-adhln -g source_code.c > assembly_list.s ``` I have visited Link: How do you get assembler output from C/C++ source in gcc? but it gets so far as to list the assembly - but no interleaving. Also Visual Studio does give you pretty nice interleaved assembly output, details here: How to view the assembly behind the code using Visual C++? Thank you for all the help. Sarang

Original source

Related problems