aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/Basic/Attributes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/lib/Basic/Attributes.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/Basic/Attributes.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/llvm-project/clang/lib/Basic/Attributes.cpp b/contrib/llvm-project/clang/lib/Basic/Attributes.cpp
index ff6dbf870fcf..62eea9c59082 100644
--- a/contrib/llvm-project/clang/lib/Basic/Attributes.cpp
+++ b/contrib/llvm-project/clang/lib/Basic/Attributes.cpp
@@ -20,6 +20,14 @@ int clang::hasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope,
else if (ScopeName == "_Clang")
ScopeName = "clang";
+ // As a special case, look for the omp::sequence and omp::directive
+ // attributes. We support those, but not through the typical attribute
+ // machinery that goes through TableGen. We support this in all OpenMP modes
+ // so long as double square brackets are enabled.
+ if (LangOpts.OpenMP && LangOpts.DoubleSquareBracketAttributes &&
+ ScopeName == "omp")
+ return (Name == "directive" || Name == "sequence") ? 1 : 0;
+
#include "clang/Basic/AttrHasAttributeImpl.inc"
return 0;