[PATCH] ms-inline-asm: Scope inline asm labels to functions

Ehsan Akhgari ehsan.akhgari at gmail.com
Sat Jul 19 13:04:55 PDT 2014


================
Comment at: lib/Parse/ParseStmtAsm.cpp:308-312
@@ -291,1 +307,7 @@
     assert(!SpellingInvalid && "spelling was invalid after correct parse?");
+    if (isNewStatement && Tok.is(tok::identifier) && i + 1 < e &&
+        AsmToks[i + 1].is(tok::colon)) {
+      // Encountered a label
+      const Sema::MSAsmLabelEntry& Entry = Actions.GetMSAsmLabel(TokenSpelling, Tok.getLocation(), true);
+      TokenSpelling = Entry.InternalName;
+    }
----------------
Ehsan Akhgari wrote:
> Reid Kleckner wrote:
> > This seems like the responsibility of the assembly parser.  IMO it should call back into clang when it encounters a label in inline assembly mode, and then clang can set up the mapping.
> Do we have access to the sema callback there?  AFAICT we don't... :/
Actually I think I can make this work...  Will upload a new patch later today.

http://reviews.llvm.org/D4589






More information about the cfe-commits mailing list