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
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 57d1cc7..1e3a310 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -555,12 +555,12 @@
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 @@
}
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)