<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - assembler output customization"
   href="http://llvm.org/bugs/show_bug.cgi?id=17465">17465</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>assembler output customization
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Driver
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>mrmocool@gmx.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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
(<a href="http://www.fclose.com/240/generate-a-mixed-source-and-assembly-listing-using-gcc">http://www.fclose.com/240/generate-a-mixed-source-and-assembly-listing-using-gcc</a>)
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@Point@@QEAAXNNN@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@Point@@QEAAXNNN@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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>