[cfe-commits] r50822 - /cfe/trunk/lib/Analysis/CFRefCount.cpp
Ted Kremenek
kremenek at apple.com
Wed May 7 11:36:45 PDT 2008
Author: kremenek
Date: Wed May 7 13:36:45 2008
New Revision: 50822
URL: http://llvm.org/viewvc/llvm-project?rev=50822&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Analysis/CFRefCount.cpp
Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=50822&r1=50821&r2=50822&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Wed May 7 13:36:45 2008
@@ -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 @@
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();
More information about the cfe-commits
mailing list