Bug 1163029 - Use NamedDecl::getName instead of expensive NamedDecl::getNameAsString. r=ehsan

This commit is contained in:
Birunthan Mohanathas 2015-05-08 09:29:11 -07:00
parent b2ee671e29
commit 24ee07fb04

View File

@ -421,7 +421,7 @@ bool classHasAddRefRelease(const CXXRecordDecl *D) {
bool seenRelease = false;
for (CXXRecordDecl::method_iterator method = D->method_begin();
method != D->method_end(); ++method) {
std::string name = method->getNameAsString();
const auto &name = method->getName();
if (name == "AddRef") {
seenAddRef = true;
} else if (name == "Release") {
@ -588,7 +588,7 @@ AST_MATCHER(MemberExpr, isAddRefOrRelease) {
ValueDecl *Member = Node.getMemberDecl();
CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(Member);
if (Method) {
std::string Name = Method->getNameAsString();
const auto &Name = Method->getName();
return Name == "AddRef" || Name == "Release";
}
return false;