diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-20 04:42:34 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-20 04:42:34 +0000 |
commit | 92e62b02226410bcad8584541b8f1ff4d35ebab9 (patch) | |
tree | aff14a293c5b7307ead4c35ae21ff1c6e940196e /lib/Sema/SemaDeclAttr.cpp | |
parent | a751217e769cbe73df2d579a28153f1c947aef10 (diff) |
Rename IdentifierInfo::isName to ::isStr. Use a nifty trick
from Sebastian to enforce that a literal string is passed in,
and use this to avoid having to call strlen on it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59706 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 57d1cc7fa0..1e3a310305 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -555,12 +555,12 @@ static void HandleObjCGCAttr(Decl *d, const AttributeList &Attr, Sema &S) { ObjCGCAttr::GCAttrTypes type; - if (Attr.getParameterName()->isName("weak")) { + if (Attr.getParameterName()->isStr("weak")) { if (isa<FieldDecl>(d)) S.Diag(Attr.getLoc(), diag::warn_attribute_weak_on_field); type = ObjCGCAttr::Weak; } - else if (Attr.getParameterName()->isName("strong")) + else if (Attr.getParameterName()->isStr("strong")) type = ObjCGCAttr::Strong; else { S.Diag(Attr.getLoc(), diag::warn_attribute_type_not_supported) @@ -584,7 +584,7 @@ static void HandleBlocksAttr(Decl *d, const AttributeList &Attr, Sema &S) { } BlocksAttr::BlocksAttrTypes type; - if (Attr.getParameterName()->isName("byref")) + if (Attr.getParameterName()->isStr("byref")) type = BlocksAttr::ByRef; else { S.Diag(Attr.getLoc(), diag::warn_attribute_type_not_supported) |