]> granicus.if.org Git - clang/commitdiff
Use llvm::CStrInCStrNoCase instead of strcasestr, since the latter is not portable.
authorTed Kremenek <kremenek@apple.com>
Wed, 7 May 2008 18:36:45 +0000 (18:36 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 7 May 2008 18:36:45 +0000 (18:36 +0000)
Correctly check if the result of CStrInCStrNoCase is NULL to generate summaries; before we were inverting the condition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50822 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFRefCount.cpp

index 5698dc8a21bc60a831589229832a50870d061d0c..5c4cc12f36d4add88f318690c3513db133332a47 100644 (file)
 #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();