Skip to content

assembler output customization #17839

@Trass3r

Description

@Trass3r
Bugzilla Link 17465
Version trunk
OS All
CC @gnzlbg,@jryans,@nico

Extended Description

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.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:driver'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions