summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-24 03:33:13 +0000
committerChris Lattner <sabre@nondot.org>2008-11-24 03:33:13 +0000
commite4b95698df99424e287b34c76da92add5a773392 (patch)
tree7e5bd35e6fdb76f86c7c56137405e4e2a50e0e08 /clang/lib/Analysis/CFRefCount.cpp
parent8361d4c51bd191f29dca50f5320e9c36955887c4 (diff)
downloadbcm5719-llvm-e4b95698df99424e287b34c76da92add5a773392.tar.gz
bcm5719-llvm-e4b95698df99424e287b34c76da92add5a773392.zip
Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. llvm-svn: 59933
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index 8c16c9fd6b1..56f5ab62340 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -1887,7 +1887,7 @@ CFRefCount::HandleSymbolDeath(GRStateManager& VMgr,
if (V.isReturnedOwned() && V.getCount() == 0)
if (const ObjCMethodDecl* MD = dyn_cast<ObjCMethodDecl>(CD)) {
- std::string s = MD->getSelector().getName();
+ std::string s = MD->getSelector().getAsString();
if (!followsReturnRule(s.c_str())) {
hasLeak = true;
state = state.set<RefBindings>(sid, V ^ RefVal::ErrorLeakReturned);
@@ -2635,7 +2635,7 @@ PathDiagnosticPiece* CFRefReport::getEndPath(BugReporter& br,
if (RV->getKind() == RefVal::ErrorLeakReturned) {
ObjCMethodDecl& MD = cast<ObjCMethodDecl>(BR.getGraph().getCodeDecl());
os << " is returned from a method whose name ('"
- << MD.getSelector().getName()
+ << MD.getSelector().getAsString()
<< "') does not contain 'create' or 'copy' or otherwise starts with"
" 'new' or 'alloc'. This violates the naming convention rules given"
" in the Memory Management Guide for Cocoa (object leaked).";
OpenPOWER on IntegriCloud