[PATCH] D53621: Support for groups of attributes in #pragma clang attribute

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 28 19:30:53 PDT 2018


erik.pilkington marked an inline comment as done.
erik.pilkington added inline comments.


================
Comment at: clang/docs/LanguageExtensions.rst:2666
 
-  #pragma clang attribute push(__attribute__((annotate("custom"))), apply_to = function)
+  #pragma clang attribute push (__attribute__((annotate("custom"))), apply_to = function)
 
----------------
aaron.ballman wrote:
> The whitespace changes here are not needed as part of this patch, right? (It's just changing the style of the docs?)
Oh, no it doesn't make a difference to clang. Just thought that it makes it a bit more obvious that this operation is a combination of:
```
#pragma clang attribute push
#pragma clang attribute (__attribute__((annotate("custom"))), apply_to = function)
```


================
Comment at: clang/lib/Parse/ParsePragma.cpp:3149
   else {
-    PP.Diag(Tok.getLocation(), diag::err_pragma_attribute_invalid_argument)
-        << PP.getSpelling(Tok);
-    return;
+    const auto *II = Tok.getIdentifierInfo();
+    if (II->isStr("push"))
----------------
aaron.ballman wrote:
> I'd prefer dropping the `auto` here.
Sure, done in the commit. Thanks for reviewing!


https://reviews.llvm.org/D53621





More information about the cfe-commits mailing list