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

Yueh-Ting (eop) Chen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 27 01:28:26 PDT 2022


eopXD marked an inline comment as done.
eopXD 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();
----------------
SjoerdMeijer wrote:
> 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());
> 
> 
Your suggestion is better than mine, thank you :)


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