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.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index f4cce2febd9..e99876b10b7 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -4185,6 +4185,17 @@ static void handleTypeTagForDatatypeAttr(Sema &S, Decl *D,
Attr.getAttributeSpellingListIndex()));
}
+static void handleKernelAttr(Sema &S, Decl *D, const AttributeList &Attr) {
+ if (S.LangOpts.RenderScript) {
+ D->addAttr(::new (S.Context)
+ KernelAttr(Attr.getRange(), S.Context,
+ Attr.getAttributeSpellingListIndex()));
+ } else {
+ S.Diag(Attr.getLoc(), diag::warn_attribute_ignored) << "kernel";
+ }
+}
+
+
//===----------------------------------------------------------------------===//
// Checker-specific attribute handlers.
//===----------------------------------------------------------------------===//
@@ -5914,6 +5925,10 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
case AttributeList::AT_TypeTagForDatatype:
handleTypeTagForDatatypeAttr(S, D, Attr);
break;
+
+ case AttributeList::AT_Kernel:
+ handleKernelAttr(S, D, Attr);
+ break;
}
}
OpenPOWER on IntegriCloud