aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/ASTContext.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h
index d760e6dbbf..49f76fe180 100644
--- a/include/clang/AST/ASTContext.h
+++ b/include/clang/AST/ASTContext.h
@@ -1721,15 +1721,12 @@ public:
/// interface, or null if non exists.
const ObjCMethodDecl *getObjCMethodRedeclaration(
const ObjCMethodDecl *MD) const {
- llvm::DenseMap<const ObjCMethodDecl*, const ObjCMethodDecl*>::const_iterator
- I = ObjCMethodRedecls.find(MD);
- if (I == ObjCMethodRedecls.end())
- return 0;
- return I->second;
+ return ObjCMethodRedecls.lookup(MD);
}
void setObjCMethodRedeclaration(const ObjCMethodDecl *MD,
const ObjCMethodDecl *Redecl) {
+ assert(!getObjCMethodRedeclaration(MD) && "MD already has a redeclaration");
ObjCMethodRedecls[MD] = Redecl;
}