aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CocoaConventions.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-07-23 10:55:15 +0000
committerChris Lattner <sabre@nondot.org>2011-07-23 10:55:15 +0000
commit5f9e272e632e951b1efe824cd16acb4d96077930 (patch)
tree3268557d12b85d0c2e72de5329ec83d4fc0bca48 /lib/Analysis/CocoaConventions.cpp
parentd47d3b0cfeb7e8564ff77f48130fe63282b6d127 (diff)
remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CocoaConventions.cpp')
-rw-r--r--lib/Analysis/CocoaConventions.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/Analysis/CocoaConventions.cpp b/lib/Analysis/CocoaConventions.cpp
index 90f7092f90..176701a3ef 100644
--- a/lib/Analysis/CocoaConventions.cpp
+++ b/lib/Analysis/CocoaConventions.cpp
@@ -17,12 +17,9 @@
#include "clang/AST/DeclObjC.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/ErrorHandling.h"
-
using namespace clang;
using namespace ento;
-using llvm::StringRef;
-
// The "fundamental rule" for naming conventions of methods:
// (url broken into two lines)
// http://developer.apple.com/documentation/Cocoa/Conceptual/
@@ -63,11 +60,11 @@ cocoa::NamingConvention cocoa::deriveNamingConvention(Selector S,
return NoConvention;
}
-bool cocoa::isRefType(QualType RetTy, llvm::StringRef Prefix,
- llvm::StringRef Name) {
+bool cocoa::isRefType(QualType RetTy, StringRef Prefix,
+ StringRef Name) {
// Recursively walk the typedef stack, allowing typedefs of reference types.
while (const TypedefType *TD = dyn_cast<TypedefType>(RetTy.getTypePtr())) {
- llvm::StringRef TDName = TD->getDecl()->getIdentifier()->getName();
+ StringRef TDName = TD->getDecl()->getIdentifier()->getName();
if (TDName.startswith(Prefix) && TDName.endswith("Ref"))
return true;
@@ -127,10 +124,10 @@ bool cocoa::isCocoaObjectRef(QualType Ty) {
return false;
}
-bool coreFoundation::followsCreateRule(llvm::StringRef functionName) {
- llvm::StringRef::iterator it = functionName.begin();
- llvm::StringRef::iterator start = it;
- llvm::StringRef::iterator endI = functionName.end();
+bool coreFoundation::followsCreateRule(StringRef functionName) {
+ StringRef::iterator it = functionName.begin();
+ StringRef::iterator start = it;
+ StringRef::iterator endI = functionName.end();
while (true) {
// Scan for the start of 'create' or 'copy'.
@@ -149,7 +146,7 @@ bool coreFoundation::followsCreateRule(llvm::StringRef functionName) {
// Scan for *lowercase* 'reate' or 'opy', followed by no lowercase
// character.
- llvm::StringRef suffix = functionName.substr(it - start);
+ StringRef suffix = functionName.substr(it - start);
if (suffix.startswith("reate")) {
it += 5;
}