aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CheckObjCInstMethSignature.cpp
diff options
context:
space:
mode:
authorMike Stump <mrs@apple.com>2009-09-09 15:08:12 +0000
committerMike Stump <mrs@apple.com>2009-09-09 15:08:12 +0000
commit1eb4433ac451dc16f4133a88af2d002ac26c58ef (patch)
tree07065b80cb7787bb7b9ffcb985196007a57e86f7 /lib/Analysis/CheckObjCInstMethSignature.cpp
parent79d39f92590cf2e91bf81486b02cd1156d13ca54 (diff)
Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/CheckObjCInstMethSignature.cpp')
-rw-r--r--lib/Analysis/CheckObjCInstMethSignature.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/Analysis/CheckObjCInstMethSignature.cpp b/lib/Analysis/CheckObjCInstMethSignature.cpp
index aae1e1da3b..8c0d39629d 100644
--- a/lib/Analysis/CheckObjCInstMethSignature.cpp
+++ b/lib/Analysis/CheckObjCInstMethSignature.cpp
@@ -40,14 +40,14 @@ static void CompareReturnTypes(const ObjCMethodDecl *MethDerived,
const ObjCMethodDecl *MethAncestor,
BugReporter &BR, ASTContext &Ctx,
const ObjCImplementationDecl *ID) {
-
+
QualType ResDerived = MethDerived->getResultType();
- QualType ResAncestor = MethAncestor->getResultType();
-
+ QualType ResAncestor = MethAncestor->getResultType();
+
if (!AreTypesCompatible(ResDerived, ResAncestor, Ctx)) {
std::string sbuf;
llvm::raw_string_ostream os(sbuf);
-
+
os << "The Objective-C class '"
<< MethDerived->getClassInterface()->getNameAsString()
<< "', which is derived from class '"
@@ -63,7 +63,7 @@ static void CompareReturnTypes(const ObjCMethodDecl *MethDerived,
<< ResAncestor.getAsString()
<< "'. These two types are incompatible, and may result in undefined "
"behavior for clients of these classes.";
-
+
BR.EmitBasicReport("Incompatible instance method return type",
os.str().c_str(), MethDerived->getLocStart());
}
@@ -71,23 +71,23 @@ static void CompareReturnTypes(const ObjCMethodDecl *MethDerived,
void clang::CheckObjCInstMethSignature(const ObjCImplementationDecl* ID,
BugReporter& BR) {
-
+
const ObjCInterfaceDecl* D = ID->getClassInterface();
const ObjCInterfaceDecl* C = D->getSuperClass();
if (!C)
return;
-
+
ASTContext& Ctx = BR.getContext();
-
+
// Build a DenseMap of the methods for quick querying.
typedef llvm::DenseMap<Selector,ObjCMethodDecl*> MapTy;
MapTy IMeths;
unsigned NumMethods = 0;
-
+
for (ObjCImplementationDecl::instmeth_iterator I=ID->instmeth_begin(),
- E=ID->instmeth_end(); I!=E; ++I) {
-
+ E=ID->instmeth_end(); I!=E; ++I) {
+
ObjCMethodDecl* M = *I;
IMeths[M->getSelector()] = M;
++NumMethods;
@@ -101,19 +101,19 @@ void clang::CheckObjCInstMethSignature(const ObjCImplementationDecl* ID,
ObjCMethodDecl* M = *I;
Selector S = M->getSelector();
-
+
MapTy::iterator MI = IMeths.find(S);
if (MI == IMeths.end() || MI->second == 0)
continue;
-
+
--NumMethods;
ObjCMethodDecl* MethDerived = MI->second;
MI->second = 0;
-
+
CompareReturnTypes(MethDerived, M, BR, Ctx, ID);
}
-
+
C = C->getSuperClass();
}
}