<div dir="ltr"><div>This looks like we're lexing multiple __asm one line statements in macros incorrectly.</div><div><br></div>On top of that, MSVC supports using labels in inline asm in ways that LLVM cannot. I think this is the relevant open issue: <a href="https://bugs.llvm.org/show_bug.cgi?id=24529">https://bugs.llvm.org/show_bug.cgi?id=24529</a><div><br></div><div>Even if you overcome the lexing issue, I don't think this asm will work as intended with clang.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 21, 2017 at 7:26 AM, via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2" face="sans-serif">Hello friendly Clang-World,</font>
<br>
<br><font size="2" face="sans-serif">this is my first time using a mailing
list, so I hope I do everything right. For my company I try to compile
some old x86 code with clang, which compiled with Visual Studio 6. There
I found the following macro:<br>
<br>
<i>#define POINT_TO_LABEL(variable, address) {        void*
dest; __asm push eax __asm mov eax, offset seq_lbl##address __asm mov dest,eax
__asm {pop eax} variable = dest;}</i></font>
<br>
<br><font size="2" face="sans-serif">Clang says:<br>
error: unexpected token in</font>
<br><font size="2" face="sans-serif">      argument list</font>
<br><font size="2" face="sans-serif">        POINT_TO_LABEL(<wbr>pTableOfEntryPoints[seq_<wbr>BEGINROW(1)],seq_BeginRow1);</font>
<br><font size="2" face="sans-serif">        </font><font size="2" color="#00c200" face="sans-serif"><b>^</b></font>
<br><font size="2" face="sans-serif">Include\vSeqCodeModule.h(183,<wbr>155):  note:
expanded from macro 'POINT_TO_LABEL'</font>
<br><font size="2" face="sans-serif">  ...seq_lbl##address __asm mov
dest,eax __asm {pop eax} variable = dest;}<br>
                    
                     
                     
                     
                     
                     
     </font><font size="2" color="#00a000" face="sans-serif"><b>^</b></font>
<br>
<br><font size="2" face="sans-serif">When I remove the {} from the last __asm
code, the error from the <i>'='</i> disappears, but the first message keeps
coming.<br>
<br>
So... What is the problem? Is this kind of inline assembler not compatible
with Clang? <br>
<br>
I have a second question for a private project. Do I have to send another
mail with this question?</font>
<br>
<br><font size="2" face="sans-serif">Kind regards from Germany</font>
<br><font size="2" face="sans-serif">Björn<br>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr.
DE 114 165 789<br>
Geschäftsführer: Hiroshi Kawamura, Dr Hiroshi Nakamura, Markus Bode, Heiko
Lampert, Takashi Nagano, Takeshi Fukushima.</font><br>______________________________<wbr>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>