[PATCH] D29819: Introduce an 'external_source_symbol' attribute that describes the origin and the nature of a declaration

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 28 08:32:05 PST 2017


arphaman added inline comments.


================
Comment at: lib/Parse/ParseDeclCXX.cpp:3818-3819
+  if (ScopeName && (ScopeName->getName() == "gnu" ||
+                    (ScopeName->getName() == "clang" &&
+                     AttrName->isStr("external_source_symbol"))))
     // GNU-scoped attributes have some special cases to handle GNU-specific
----------------
aaron.ballman wrote:
> aaron.ballman wrote:
> > I don't really like hard-coding a list of attributes like this. I think you should handle clang-namespaced attributes with a separate helper function.
> This still isn't quite what I was looking for -- the helper function I was talking about was a replacement for `ParseGNUAttributeArgs()`. I'm sorry if I was unclear.
> 
> I think we should have a `ParseClangAttributeArgs()` that handles your custom parsing; it can then call through to `ParseAttributeArgsCommon()` for common argument handling in the same way `ParseGNUAttributeArgs()` does. So the predicate would be `else if (ScopeName && ScopeName->getName() == "clang")`.
I see, I added `ParseClangAttributeArgs` in the updated patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D29819





More information about the cfe-commits mailing list