From: Jeffrey Yasskin Date: Tue, 10 Nov 2009 01:17:45 +0000 (+0000) Subject: Fix clang's use of DenseMap iterators after r86636 fixed their constness. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3958b502404b4bd67f26fee398cb347abe89e6a8;p=clang Fix clang's use of DenseMap iterators after r86636 fixed their constness. Patch by Victor Zverovich! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86638 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index a6b0dfbaf4..bb3559b50f 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -258,7 +258,7 @@ ASTContext::setInstantiatedFromStaticDataMember(VarDecl *Inst, VarDecl *Tmpl, UnresolvedUsingDecl * ASTContext::getInstantiatedFromUnresolvedUsingDecl(UsingDecl *UUD) { - llvm::DenseMap::iterator Pos + llvm::DenseMap::const_iterator Pos = InstantiatedFromUnresolvedUsingDecl.find(UUD); if (Pos == InstantiatedFromUnresolvedUsingDecl.end()) return 0; diff --git a/lib/Analysis/ExplodedGraph.cpp b/lib/Analysis/ExplodedGraph.cpp index 0dc81a4225..3b339ffc0d 100644 --- a/lib/Analysis/ExplodedGraph.cpp +++ b/lib/Analysis/ExplodedGraph.cpp @@ -273,7 +273,7 @@ ExplodedGraph::TrimInternal(const ExplodedNode* const* BeginSources, ExplodedNode* InterExplodedGraphMap::getMappedNode(const ExplodedNode* N) const { - llvm::DenseMap::iterator I = + llvm::DenseMap::const_iterator I = M.find(N); return I == M.end() ? 0 : I->second; diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index 7dbb085153..528a469286 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -2841,7 +2841,7 @@ void GRExprEngine::VisitBinaryOperator(BinaryOperator* B, //===----------------------------------------------------------------------===// Checker *GRExprEngine::lookupChecker(void *tag) const { - CheckerMap::iterator I = CheckerM.find(tag); + CheckerMap::const_iterator I = CheckerM.find(tag); return (I == CheckerM.end()) ? NULL : Checkers[I->second].second; } diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 070481fa14..2510445a7f 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -346,7 +346,7 @@ void LiveVariables::dumpLiveness(const ValTy& V, const SourceManager& SM) const } void LiveVariables::dumpBlockLiveness(const SourceManager& M) const { - for (BlockDataMapTy::iterator I = getBlockDataMap().begin(), + for (BlockDataMapTy::const_iterator I = getBlockDataMap().begin(), E = getBlockDataMap().end(); I!=E; ++I) { llvm::errs() << "\n[ B" << I->first->getBlockID() << " (live variables at block exit) ]\n"; diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp index 45c42281ab..8106260f18 100644 --- a/lib/Analysis/RegionStore.cpp +++ b/lib/Analysis/RegionStore.cpp @@ -164,7 +164,7 @@ public: ~RegionStoreSubRegionMap() {} bool iterSubRegions(const MemRegion* Parent, Visitor& V) const { - Map::iterator I = M.find(Parent); + Map::const_iterator I = M.find(Parent); if (I == M.end()) return true; diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp index d43d13e26b..1f83f37e04 100644 --- a/lib/CodeGen/CodeGenTypes.cpp +++ b/lib/CodeGen/CodeGenTypes.cpp @@ -492,7 +492,7 @@ const CGRecordLayout & CodeGenTypes::getCGRecordLayout(const TagDecl *TD) const { const Type *Key = Context.getTagDeclType(TD).getTypePtr(); - llvm::DenseMap::iterator I + llvm::DenseMap::const_iterator I = CGRecordLayouts.find(Key); assert (I != CGRecordLayouts.end() && "Unable to find record layout information for type");