[cfe-commits] r45199 - /cfe/trunk/Sema/SemaDecl.cpp
Steve Naroff
snaroff at apple.com
Wed Dec 19 06:11:30 PST 2007
Author: snaroff
Date: Wed Dec 19 08:11:27 2007
New Revision: 45199
URL: http://llvm.org/viewvc/llvm-project?rev=45199&view=rev
Log:
Revert Anders r45191 commit...it broke several of the tests.
Modified:
cfe/trunk/Sema/SemaDecl.cpp
Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=45199&r1=45198&r2=45199&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Wed Dec 19 08:11:27 2007
@@ -1653,14 +1653,8 @@
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 @@
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
More information about the cfe-commits
mailing list