diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index efc933ef5cbcd..56c40e18ca28f 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -1659,10 +1659,7 @@ void CXXRecordDecl::setLambdaNumbering(LambdaNumbering Numbering) { unsigned CXXRecordDecl::getDeviceLambdaManglingNumber() const { assert(isLambda() && "Not a lambda closure type!"); - auto I = getASTContext().DeviceLambdaManglingNumbers.find(this); - if (I != getASTContext().DeviceLambdaManglingNumbers.end()) - return I->second; - return 0; + return getASTContext().DeviceLambdaManglingNumbers.lookup(this); } static CanQualType GetConversionType(ASTContext &Context, NamedDecl *Conv) { diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index d70f1a19acbbd..1f9687e322c9d 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -290,12 +290,8 @@ class MicrosoftMangleContextImpl : public MicrosoftMangleContext { assert(!RD->isExternallyVisible() && "RD must not be visible!"); assert(RD->getLambdaManglingNumber() == 0 && "RD must not have a mangling number!"); - llvm::DenseMap::iterator Result = - LambdaIds.find(RD); // The lambda should exist, but return 0 in case it doesn't. - if (Result == LambdaIds.end()) - return 0; - return Result->second; + return LambdaIds.lookup(RD); } /// Return a character sequence that is (somewhat) unique to the TU suitable