summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker/CocoaConventions.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-02-08 16:45:01 +0000
committerTed Kremenek <kremenek@apple.com>2010-02-08 16:45:01 +0000
commitac5ab795558838da3a2907598339320ecf05b63a (patch)
tree16f05d479b909de2f94fb22f4496b6a5b89b0225 /clang/lib/Checker/CocoaConventions.cpp
parent30949dd9f9af7dad4563e4e755631cf042f1e563 (diff)
downloadbcm5719-llvm-ac5ab795558838da3a2907598339320ecf05b63a.tar.gz
bcm5719-llvm-ac5ab795558838da3a2907598339320ecf05b63a.zip
Revert 95546 since it changed the algorithmic characteristics of the convention lookup.
llvm-svn: 95547
Diffstat (limited to 'clang/lib/Checker/CocoaConventions.cpp')
-rw-r--r--clang/lib/Checker/CocoaConventions.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Checker/CocoaConventions.cpp b/clang/lib/Checker/CocoaConventions.cpp
index 9198b3be807..ff3a0c97b41 100644
--- a/clang/lib/Checker/CocoaConventions.cpp
+++ b/clang/lib/Checker/CocoaConventions.cpp
@@ -131,19 +131,19 @@ cocoa::NamingConvention cocoa::deriveNamingConvention(Selector S) {
return C;
}
-bool cocoa::isRefType(QualType RetTy, llvm::StringRef Prefix,
- llvm::StringRef Name) {
+bool cocoa::isRefType(QualType RetTy, const char* prefix,
+ const char* name) {
// Recursively walk the typedef stack, allowing typedefs of reference types.
while (TypedefType* TD = dyn_cast<TypedefType>(RetTy.getTypePtr())) {
llvm::StringRef TDName = TD->getDecl()->getIdentifier()->getName();
- if (TDName.startswith(Prefix) && TDName.endswith("Ref"))
+ if (TDName.startswith(prefix) && TDName.endswith("Ref"))
return true;
RetTy = TD->getDecl()->getUnderlyingType();
}
- if (Name.empty())
+ if (!name)
return false;
// Is the type void*?
@@ -152,7 +152,7 @@ bool cocoa::isRefType(QualType RetTy, llvm::StringRef Prefix,
return false;
// Does the name start with the prefix?
- return Name.startswith(Prefix);
+ return llvm::StringRef(name).startswith(prefix);
}
bool cocoa::isCFObjectRef(QualType T) {
OpenPOWER on IntegriCloud