summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorDmitry Polukhin <dmitry.polukhin@gmail.com>2016-04-11 07:48:59 +0000
committerDmitry Polukhin <dmitry.polukhin@gmail.com>2016-04-11 07:48:59 +0000
commit85eda12d093714bfc9f266d50254e82888c9e8c3 (patch)
tree9216c6a571a665d295ab1d8f783c27e121c349a4 /clang/lib/AST/DeclBase.cpp
parentbbffeac569e89a61201ce159790f68b8493042b6 (diff)
downloadbcm5719-llvm-85eda12d093714bfc9f266d50254e82888c9e8c3.tar.gz
bcm5719-llvm-85eda12d093714bfc9f266d50254e82888c9e8c3.zip
[GCC] Attribute ifunc support in clang
This patch add support for GCC attribute((ifunc("resolver"))) for targets that use ELF as object file format. In general ifunc is a special kind of function alias with type @gnu_indirect_function. LLVM patch http://reviews.llvm.org/D15525 Differential Revision: http://reviews.llvm.org/D15524 llvm-svn: 265917
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 2722b82ef12..57149af3c10 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -362,6 +362,18 @@ bool Decl::isReferenced() const {
return false;
}
+bool Decl::hasDefiningAttr() const {
+ return hasAttr<AliasAttr>() || hasAttr<IFuncAttr>();
+}
+
+const Attr *Decl::getDefiningAttr() const {
+ if (AliasAttr *AA = getAttr<AliasAttr>())
+ return AA;
+ if (IFuncAttr *IFA = getAttr<IFuncAttr>())
+ return IFA;
+ return nullptr;
+}
+
/// \brief Determine the availability of the given declaration based on
/// the target platform.
///
OpenPOWER on IntegriCloud