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/Sema/SemaDeclAttr.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/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index d302e40d7f0..17f053c0d3a 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -3182,12 +3182,9 @@ static void handleCallConvAttr(Sema &S, Decl *D, const AttributeList &Attr) { static void handleOpenCLImageAccessAttr(Sema &S, Decl *D, const AttributeList &Attr) { - uint32_t ArgNum; - if (!checkUInt32Argument(S, Attr, Attr.getArgAsExpr(0), ArgNum)) - return; - - D->addAttr(::new (S.Context) OpenCLImageAccessAttr(Attr.getRange(), - S.Context, ArgNum)); + D->addAttr(::new (S.Context) + OpenCLImageAccessAttr(Attr.getRange(), S.Context, + Attr.getAttributeSpellingListIndex())); } bool Sema::CheckCallingConvAttr(const AttributeList &attr, CallingConv &CC, @@ -4176,8 +4173,7 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, case AttributeList::AT_OpenCLKernel: handleSimpleAttribute<OpenCLKernelAttr>(S, D, Attr); break; case AttributeList::AT_OpenCLImageAccess: - handleOpenCLImageAccessAttr(S, D, Attr); - break; + handleSimpleAttribute<OpenCLImageAccessAttr>(S, D, Attr); break; // Microsoft attributes: case AttributeList::AT_MsStruct: |