diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-05-07 18:36:45 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-05-07 18:36:45 +0000 |
commit | b6cbf28d82fb70edd84b45d65e4eaebd30401f25 (patch) | |
tree | 85864783e105cb93cf46f283f6b27e6629321b45 /clang/lib | |
parent | 3a9fa4e36075fdb1aca294045e1ab52f63da746b (diff) | |
download | bcm5719-llvm-b6cbf28d82fb70edd84b45d65e4eaebd30401f25.tar.gz bcm5719-llvm-b6cbf28d82fb70edd84b45d65e4eaebd30401f25.zip |
Use llvm::CStrInCStrNoCase instead of strcasestr, since the latter is not portable.
Correctly check if the result of CStrInCStrNoCase is NULL to generate summaries; before we were inverting the condition.
llvm-svn: 50822
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Analysis/CFRefCount.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 5698dc8a21b..5c4cc12f36d 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/lib/Analysis/CFRefCount.cpp @@ -23,11 +23,13 @@ #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/ImmutableMap.h" +#include "llvm/ADT/StringExtras.h" #include "llvm/Support/Compiler.h" #include <ostream> #include <sstream> using namespace clang; +using llvm::CStrInCStrNoCase; //===----------------------------------------------------------------------===// // Utility functions. @@ -604,8 +606,8 @@ RetainSummaryManager::getMethodSummary(ObjCMessageExpr* ME) { if (!isNSType(ME->getReceiver()->getType())) return 0; - if (strcasestr(s, "create") == 0 || strcasestr(s, "copy") == 0 || - strcasestr(s, "new") == 0) { + if (CStrInCStrNoCase(s, "create") || CStrInCStrNoCase(s, "copy") || + CStrInCStrNoCase(s, "new")) { RetEffect E = isGCEnabled() ? RetEffect::MakeNoRet() : RetEffect::MakeOwned(); |