aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-05-19 10:43:54 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-05-19 10:43:54 +0000
commit93a8534090a6de23d655679205b974032d092a89 (patch)
tree840a8abad9ba4a9307014c3ae926417f3abb68f0
parent37e4cea0f548fc8a4b3c46aa92c925d6ea49d071 (diff)
Simplify code, add an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157111 91177308-0d34-0410-b5e6-96231b3b80d8
-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;
}