[PATCH] D135500: [Clang] reject bit-fields as instruction operands in Microsoft style inline asm blocks.

Tom Honermann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 10 13:14:09 PDT 2022


tahonermann marked 2 inline comments as done.
tahonermann added inline comments.


================
Comment at: clang/lib/Sema/SemaStmtAsm.cpp:937
   for (uint64_t I = 0; I < NumOutputs + NumInputs; ++I) {
-    if (Exprs[I]->getType()->isBitIntType())
-      return StmtError(
-          Diag(Exprs[I]->getBeginLoc(), diag::err_asm_invalid_type)
+    if (Exprs[I]->getType()->isBitIntType()) {
+      InvalidOperand = true;
----------------
erichkeane wrote:
> There is enough repetition of Exprs[I] I suspect there is value to splitting them up as:
> 
> `Expr *CurExpr = Exprs[I];`
> 
> for readability purposes.
Thank you, this was a good suggestion!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135500



More information about the cfe-commits mailing list