summaryrefslogtreecommitdiff
path: root/lib/Basic/Attributes.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-03-27 22:12:09 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-03-27 22:12:09 +0000
commit28dc6f98d23f665e6be451cf0dce4dfefaeff9ae (patch)
tree4951d4b7b7198a93eb8fa3172d8a20cf895c4a29 /lib/Basic/Attributes.cpp
parent297e5869c5c643cb01a535b626ed787e8ecb4a72 (diff)
downloadclang-28dc6f98d23f665e6be451cf0dce4dfefaeff9ae.tar.gz
clang-28dc6f98d23f665e6be451cf0dce4dfefaeff9ae.tar.bz2
clang-28dc6f98d23f665e6be451cf0dce4dfefaeff9ae.tar.xz
Reapplying r204952 with fixes which should hopefully resolve linking issues with non-MSVC compilers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@204968 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Attributes.cpp')
-rw-r--r--lib/Basic/Attributes.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Basic/Attributes.cpp b/lib/Basic/Attributes.cpp
new file mode 100644
index 0000000000..c882bc226d
--- /dev/null
+++ b/lib/Basic/Attributes.cpp
@@ -0,0 +1,17 @@
+#include "clang/Basic/Attributes.h"
+#include "clang/Basic/IdentifierTable.h"
+#include "llvm/ADT/StringSwitch.h"
+using namespace clang;
+
+bool clang::HasAttribute(AttrSyntax Syntax, const IdentifierInfo *Scope,
+ const IdentifierInfo *Attr, const llvm::Triple &T,
+ const LangOptions &LangOpts) {
+ StringRef Name = Attr->getName();
+ // Normalize the attribute name, __foo__ becomes foo.
+ if (Name.size() >= 4 && Name.startswith("__") && Name.endswith("__"))
+ Name = Name.substr(2, Name.size() - 4);
+
+#include "clang/Basic/AttrHasAttributeImpl.inc"
+
+ return false;
+}