yaxunl marked an inline comment as done.
================
Comment at: include/clang/Basic/Attr.td:701
@@ -699,1 +700,3 @@
+def OpenCLNoSVM : Attr {
+ let Spellings = [GNU<"nosvm">];
----------------
aaron.ballman wrote:
> yaxunl wrote:
> > aaron.ballman wrote:
> > > Since the attribute is ignored by clang, you should inherit from
> > > IgnoredAttr.
> > I tried that from beginning. If I inherit from IgnoredAttr, it seems to be
> > ignored by the parser and won't reach the sema check part, and I cannot
> > emit error msg based on OpenCL version.
> Ah. so it isn't *totally* ignored. Okay, in that case, you should set ASTNode
> = 0 and SemaHandler = 0.
If I set ASTNode = 0 and SemaHandler = 0, tablegen will not generate an id
AT_OpenCLNoSVM to identify this attribute, and I cannot diagnose its invalid
usage in SemaDeclAttr.cpp due to that. Then it seems the only viable place to
diagnose its invalid usage is in Parser::ParseGNUAttributes. However currently
Parser::ParseGNUAttributes only does generic processing of GNU attributes and
does not diagnose specific attribute. Since there is no id for NoSVM attribute,
I have to diagnose based on its name string.
Do we really want to do this?
Repository:
rL LLVM
http://reviews.llvm.org/D17861
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits