diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-01-14 17:41:53 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-01-14 17:41:53 +0000 |
commit | 26891338050e0570041cff565d041af56eaa26cd (patch) | |
tree | 5e7566e88e23cfff35d6ef1f02fea9ee0b4b1f08 /clang/lib/Parse/ParseDecl.cpp | |
parent | 303eb178a9b3806563cf346ae03199192aa8720a (diff) | |
download | bcm5719-llvm-26891338050e0570041cff565d041af56eaa26cd.tar.gz bcm5719-llvm-26891338050e0570041cff565d041af56eaa26cd.zip |
Simplifying the OpenCL image attribute. It does not need a semantic integer parameter because the required information is encoded in the spelling. Added an appropriate subject to the attribute, and simplified the semantic checking (which will likely be expanded upon in a future patch). Also, removed the GNU spelling since it was unsupported in the first place.
llvm-svn: 199229
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 0f74e13783d..febf9e68544 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -16,7 +16,6 @@ #include "clang/AST/DeclTemplate.h" #include "clang/Basic/AddressSpaces.h" #include "clang/Basic/CharInfo.h" -#include "clang/Basic/OpenCL.h" #include "clang/Parse/ParseDiagnostic.h" #include "clang/Sema/Lookup.h" #include "clang/Sema/ParsedTemplate.h" @@ -654,31 +653,8 @@ void Parser::ParseOpenCLAttributes(ParsedAttributes &attrs) { void Parser::ParseOpenCLQualifiers(ParsedAttributes &Attrs) { IdentifierInfo *AttrName = Tok.getIdentifierInfo(); SourceLocation AttrNameLoc = Tok.getLocation(); - ArgsUnion Expr; - switch (Tok.getKind()) { - // OpenCL qualifiers: - case tok::kw___private: - case tok::kw___global: - case tok::kw___local: - case tok::kw___constant: - // These are handled automatically below and have no args. - break; - case tok::kw___read_only: - Expr = Actions.ActOnIntegerConstant(SourceLocation(), - CLIA_read_only).take(); - break; - case tok::kw___write_only: - Expr = Actions.ActOnIntegerConstant(SourceLocation(), - CLIA_write_only).take(); - break; - case tok::kw___read_write: - Expr = Actions.ActOnIntegerConstant(SourceLocation(), - CLIA_read_write).take(); - break; - default: llvm_unreachable("Unknown OpenCL qualifier"); - } - Attrs.addNew(AttrName, AttrNameLoc, 0, AttrNameLoc, &Expr, - Expr.isNull() ? 0 : 1, AttributeList::AS_Keyword); + Attrs.addNew(AttrName, AttrNameLoc, 0, AttrNameLoc, 0, 0, + AttributeList::AS_Keyword); } /// \brief Parse a version number. |