[PATCH] D136784: [Clang] Improve diagnostic message for loop hint pragma

Sjoerd Meijer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 01:22:46 PDT 2022


SjoerdMeijer added inline comments.


================
Comment at: clang/lib/Parse/ParsePragma.cpp:1306
   StringRef Str = PragmaName.getIdentifierInfo()->getName();
+  if (Str == "loop")
+    return (llvm::Twine("clang loop ") + Option.getIdentifierInfo()->getName()).str();
----------------
eopXD wrote:
> SjoerdMeijer wrote:
> > We've got some duplication now, as "loop" is also checked in line 1310. Can you see if you can merge these checks, simplify things here a bit?
> Yes, the case for `loop` in below can now be removed. Thank you.
I was hoping that modifying the "loop" case would work:

  .Case("loop", (llvm::Twine("clang loop ") + Option.getIdentifierInfo()->getName()).str());




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136784



More information about the cfe-commits mailing list