[PATCH] D15115: [Microsoft][C++] Clang doesn't support a use of "this" pointer inside inline asm

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 09:38:40 PST 2015


rnk requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: lib/Parse/ParseExprCXX.cpp:2567-2568
@@ -2566,3 +2566,4 @@
   }
-  
+  if (Tok.is(tok::kw_this))
+    return false;
   Diag(Tok, diag::err_expected_unqualified_id)
----------------
Surely this breaks the contract of ParseUnqualifiedId, which should not return success if called on a 'this' token.

================
Comment at: test/CodeGen/ms_this.cpp:25
@@ +24,3 @@
+       mov rax,[this]
+      //CHECK :%this.addr = alloca %class.t2*
+       mov rbx,[rax]
----------------
I think FileCheck will insist that this is spelled without a space before the colon.

It would also be better to test that %this.addr is used as an argument to an asm blob, something like this:
  // CHECK: call void asm sideeffect {{.*}}%this.addr


http://reviews.llvm.org/D15115





More information about the llvm-commits mailing list