[PATCH] D75563: [clang][Parse] properly parse asm-qualifiers, asm inline

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 6 13:48:28 PST 2020


nickdesaulniers marked 4 inline comments as done.
nickdesaulniers added inline comments.


================
Comment at: clang/lib/Parse/ParseStmtAsm.cpp:746-755
   ParseTypeQualifierListOpt(DS, AR_VendorAttributesParsed);
 
   // GNU asms accept, but warn, about type-qualifiers other than volatile.
   if (DS.getTypeQualifiers() & DeclSpec::TQ_const)
     Diag(Loc, diag::warn_asm_qualifier_ignored) << "const";
   if (DS.getTypeQualifiers() & DeclSpec::TQ_restrict)
     Diag(Loc, diag::warn_asm_qualifier_ignored) << "restrict";
----------------
nickdesaulniers wrote:
> I think in a follow up commit, I'll just delete this (the call to `ParseTypeQualifierListOpt` and subsequent `warn_asm_qualifier_ignored` emission); making it a parse error to put type qualifiers after the keyword `asm`, which would match the behavior of GCC, and not waste time looking for and parsing type qualifiers.  It maybe made sense when `ParseTypeQualifierListOpt` was being abused to parse `volatile`, but this patch fixes that.
Chatting with @aaron.ballman , I think it makes sense to tackle this in this CL, which will simplify the requested changes to parsing (above).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75563





More information about the cfe-commits mailing list