[PATCH] D144404: [clang] Extract function for generated part of clang::hasAttribute (NFC) r=aaron.ballman
Anders Waldenborg via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 20 08:36:34 PST 2023
wanders created this revision.
wanders added a reviewer: aaron.ballman.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
wanders requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This makes it easier to add additional handling when the
tablegen-generated code does not find a match.
No functional change intended.
Depends on D144403 <https://reviews.llvm.org/D144403>
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D144404
Files:
clang/lib/Basic/Attributes.cpp
Index: clang/lib/Basic/Attributes.cpp
===================================================================
--- clang/lib/Basic/Attributes.cpp
+++ clang/lib/Basic/Attributes.cpp
@@ -4,6 +4,15 @@
#include "clang/Basic/IdentifierTable.h"
using namespace clang;
+static int hasAttributeImpl(AttributeCommonInfo::Syntax Syntax, StringRef Name,
+ StringRef ScopeName, const TargetInfo &Target,
+ const LangOptions &LangOpts) {
+
+#include "clang/Basic/AttrHasAttributeImpl.inc"
+
+ return 0;
+}
+
int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
const IdentifierInfo *Scope, const IdentifierInfo *Attr,
const TargetInfo &Target, const LangOptions &LangOpts) {
@@ -27,7 +36,9 @@
ScopeName == "omp")
return (Name == "directive" || Name == "sequence") ? 1 : 0;
-#include "clang/Basic/AttrHasAttributeImpl.inc"
+ int res = hasAttributeImpl(Syntax, Name, ScopeName, Target, LangOpts);
+ if (res)
+ return res;
return 0;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144404.498871.patch
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230220/824882e0/attachment.bin>
More information about the cfe-commits
mailing list