<div dir="ltr">The whole MS inline asm parser could stand to be cleaned up. It's basically designed to parse a fixed set of inputs. If you feed it invalid input, it gets really upset with you, which you can see in the diagnostics. That, and it's easy to make it assert.
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-03 16:40 GMT-07:00 Nico Weber <span dir="ltr"><<a href="mailto:thakis@chromium.org" target="_blank">thakis@chromium.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Zombie comment, I saw this error message today (I know it's not yours,<br>
but it looks like you touched it recently): This error message is a<br>
lot more dramatic than clang's error messages – could this be changed<br>
to start with a lowercase letter, and to not end in a "!"? Also, I<br>
think it's "look up" with a space when used as a verb.<br>
<br>
2014-03-06 11:19 GMT-08:00 Reid Kleckner <<a href="mailto:reid@kleckner.net">reid@kleckner.net</a>>:<br>
<div class="HOEnZb"><div class="h5">> Author: rnk<br>
> Date: Thu Mar 6 13:19:36 2014<br>
> New Revision: 203147<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=203147&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=203147&view=rev</a><br>
> Log:<br>
> Add tests for MS inline asm change r203146<br>
><br>
> Modified:<br>
> cfe/trunk/test/CodeGen/ms-inline-asm.c<br>
> cfe/trunk/test/Sema/ms-inline-asm.c<br>
><br>
> Modified: cfe/trunk/test/CodeGen/ms-inline-asm.c<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm.c?rev=203147&r1=203146&r2=203147&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/ms-inline-asm.c?rev=203147&r1=203146&r2=203147&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/CodeGen/ms-inline-asm.c (original)<br>
> +++ cfe/trunk/test/CodeGen/ms-inline-asm.c Thu Mar 6 13:19:36 2014<br>
> @@ -445,3 +445,18 @@ void cpuid() {<br>
> // CHECK-LABEL: define void @cpuid<br>
> // CHECK: call void asm sideeffect inteldialect "cpuid", "~{eax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()<br>
> }<br>
> +<br>
> +typedef struct {<br>
> + int a;<br>
> + int b;<br>
> +} A;<br>
> +<br>
> +void t39() {<br>
> + __asm mov eax, [eax].A.b<br>
> + __asm mov eax, [eax] A.b<br>
> + __asm mov eax, fs:[0] A.b<br>
> + // CHECK-LABEL: define void @t39<br>
> + // CHECK: call void asm sideeffect inteldialect "mov eax, [eax].4", "~{eax},~{dirflag},~{fpsr},~{flags}"()<br>
> + // CHECK: call void asm sideeffect inteldialect "mov eax, [eax] .4", "~{eax},~{dirflag},~{fpsr},~{flags}"()<br>
> + // CHECK: call void asm sideeffect inteldialect "mov eax, fs:[$$0] .4", "~{eax},~{dirflag},~{fpsr},~{flags}"()<br>
> +}<br>
><br>
> Modified: cfe/trunk/test/Sema/ms-inline-asm.c<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/ms-inline-asm.c?rev=203147&r1=203146&r2=203147&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/ms-inline-asm.c?rev=203147&r1=203146&r2=203147&view=diff</a><br>
> ==============================================================================<br>
> --- cfe/trunk/test/Sema/ms-inline-asm.c (original)<br>
> +++ cfe/trunk/test/Sema/ms-inline-asm.c Thu Mar 6 13:19:36 2014<br>
> @@ -75,3 +75,29 @@ int t2(int *arr, int i) {<br>
> //__asm mov eax, [arr + i];<br>
> return 0;<br>
> }<br>
> +<br>
> +typedef struct {<br>
> + int a;<br>
> + int b;<br>
> +} A;<br>
> +<br>
> +void t3() {<br>
> + __asm mov eax, [eax] UndeclaredId // expected-error {{unknown token in expression}}<br>
> +<br>
> + // FIXME: Only emit one diagnostic here.<br>
> + // expected-error@+2 {{unexpected type name 'A': expected expression}}<br>
> + // expected-error@+1 {{unknown token in expression}}<br>
> + __asm mov eax, [eax] A<br>
> +}<br>
> +<br>
> +void t4() {<br>
> + // The dot in the "intel dot operator" is optional in MSVC. MSVC also does<br>
> + // global field lookup, but we don't.<br>
> + __asm mov eax, [0] A.a<br>
> + __asm mov eax, [0].A.a<br>
> + __asm mov eax, [0].a // expected-error {{Unable to lookup field reference!}}<br>
> + __asm mov eax, fs:[0] A.a<br>
> + __asm mov eax, fs:[0].A.a<br>
> + __asm mov eax, fs:[0].a // expected-error {{Unable to lookup field reference!}}<br>
> + __asm mov eax, fs:[0]. A.a // expected-error {{Unexpected token type!}}<br>
> +}<br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</div></div></blockquote></div><br></div>