aboutsummaryrefslogtreecommitdiff
path: root/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-12-19 14:11:27 +0000
committerSteve Naroff <snaroff@apple.com>2007-12-19 14:11:27 +0000
commit0592cbe16266d560ba87ef0b6d29e14af1c56e08 (patch)
tree1e80e9e45b64bedc3480d0615435a54d88346b77 /Sema/SemaDecl.cpp
parent78aaae9a611d53803fc645de83b297a06f581306 (diff)
Revert Anders r45191 commit...it broke several of the tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45199 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Sema/SemaDecl.cpp')
-rw-r--r--Sema/SemaDecl.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index f5115dbaab..c53ca42efb 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -1653,14 +1653,8 @@ void Sema::HandleDeclAttribute(Decl *New, AttributeList *rawAttr) {
const char *attrName = rawAttr->getAttributeName()->getName();
unsigned attrLen = rawAttr->getAttributeName()->getLength();
- // Normalize the attribute name, __foo__ becomes foo.
- if (attrLen > 4 && attrName[0] == '_' && attrName[1] == '_' &&
- attrName[attrLen - 2] == '_' && attrName[attrLen - 1] == '-') {
- attrName += 2;
- attrLen -= 4;
- }
-
- if (attrLen == 11 && !memcmp(attrName, "vector_size", 11)) {
+ if (!strcmp(rawAttr->getAttributeName()->getName(), "vector_size") ||
+ !strcmp(rawAttr->getAttributeName()->getName(), "__vector_size__")) {
if (ValueDecl *vDecl = dyn_cast<ValueDecl>(New)) {
QualType newType = HandleVectorTypeAttribute(vDecl->getType(), rawAttr);
if (!newType.isNull()) // install the new vector type into the decl
@@ -1672,7 +1666,9 @@ void Sema::HandleDeclAttribute(Decl *New, AttributeList *rawAttr) {
if (!newType.isNull()) // install the new vector type into the decl
tDecl->setUnderlyingType(newType);
}
- } else if (attrLen == 15 && !memcmp(attrName, "ocu_vector_type", 15)) {
+ }
+ if (!strcmp(rawAttr->getAttributeName()->getName(), "ocu_vector_type") ||
+ !strcmp(rawAttr->getAttributeName()->getName(), "__ocu_vector_type__")) {
if (TypedefDecl *tDecl = dyn_cast<TypedefDecl>(New))
HandleOCUVectorTypeAttribute(tDecl, rawAttr);
else