[LLVMbugs] [Bug 17465] New: assembler output customization

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 3 05:29:42 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17465

            Bug ID: 17465
           Summary: assembler output customization
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: mrmocool at gmx.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

It would be nice to have if clang supported gcc's -masm=dialect switch so I can
get readable asm without a special case for clang to use -mllvm
--x86-asm-syntax=intel.

But more importantly I'd love to have a way to generate assembler output with
properly embedded source code, especially on Linux.
But that would even allow to support the /FAs switch in clang-cl and enable me
to seamlessly use my existing VS addin for quick asm inspection with the newly
available clang toolkit.

I already tried several different approaches.
* -fverbose-asm is pretty useless.
* Then there's the -Wa trick
(http://www.fclose.com/240/generate-a-mixed-source-and-assembly-listing-using-gcc)
which only works with gcc.
* objdump works with both:
  clang++ -c -g -O3 test.cpp
  objdump -dSC -M intel test.o

But neither of these approaches reaches the readability of /FAs (in combination
with AsmHighlighter):

?set at Point@@QEAAXNNN at Z PROC    ; Point::set, COMDAT
; 47   :     void set(const double X, const double Y, const double Z) { _xyz[0]
= X; _xyz[1] = Y; _xyz[2] = Z; }

    movsdx    QWORD PTR [rcx], xmm1
    movsdx    QWORD PTR [rcx+8], xmm2
    movsdx    QWORD PTR [rcx+16], xmm3
    ret       0
?set at Point@@QEAAXNNN at Z ENDP    ; Point::set

In this case source code is properly injected as assembler comments and there
are no line numbers or machine code confusing the syntax highlighter.
But the /FA switch also allows you to add these if you need.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131003/faaf9948/attachment.html>


More information about the llvm-bugs mailing list