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

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 4 10:05:56 PST 2020


nickdesaulniers marked an inline comment 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";
----------------
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.


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