summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp12
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:
OpenPOWER on IntegriCloud