[PATCH] D69876: Allow output constraints on "asm goto"

James Y Knight via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 6 09:56:49 PST 2020


jyknight accepted this revision.
jyknight added a comment.

LGTM modulo some minor wording.



================
Comment at: clang/docs/LanguageExtensions.rst:1256-1258
+Clang provides support for the `goto form of GCC's extended
+assembly<https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html>`_ with output
+constraints.
----------------
I find that sentence confusing. Maybe,
"In addition to the functionality provided by <GCC's extended assembly>, Clang also supports output constraints with the goto form."


================
Comment at: clang/lib/AST/Stmt.cpp:646-648
+      // Labels are placed after "InOut" operands. Adjust accordingly.
+      if (IsLabel)
+        N += getNumPlusOperands();
----------------
I'm confused about this part. Why isn't the "N" specified in the assembly string already the correct value for the labels? Is the ordering we use internally and that users use externally not the same? I'm assuming your code here is correct, just I'm not understanding, so probably an improved comment would be nice.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69876/new/

https://reviews.llvm.org/D69876





More information about the cfe-commits mailing list