As noted below by @thakis, newer versions of Clang (3.5+) accept the -masm=intel
argument.
For older versions, this should get clang to emit assembly code with Intel syntax:
clang++ -S -mllvm --x86-asm-syntax=intel test.cpp
You can use -mllvm <arg>
to pass in llvm options from the clang command line. Sadly this option doesn't appear to be well documented, and thus I only found it by browsing through the llvm mailing lists.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…