diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-24 18:22:12 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-03-24 18:22:12 +0000 |
commit | 7e42392eb2ea29ddeb6d125417fb4c17d847b5e0 (patch) | |
tree | a97e6cace2a755d86c6aabb0ce9925153028b9f6 /lib | |
parent | 790d295ed4938a24012ef9eb7fe296cf320b0fca (diff) |
Simplify some users of DenseMap::erase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153389 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ARCMigrate/FileRemapper.cpp | 5 | ||||
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 5 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 5 | ||||
-rw-r--r-- | lib/Lex/PreprocessingRecord.cpp | 5 |
4 files changed, 4 insertions, 16 deletions
diff --git a/lib/ARCMigrate/FileRemapper.cpp b/lib/ARCMigrate/FileRemapper.cpp index 1e97c9eed5..474ce7dcba 100644 --- a/lib/ARCMigrate/FileRemapper.cpp +++ b/lib/ARCMigrate/FileRemapper.cpp @@ -280,10 +280,7 @@ void FileRemapper::resetTarget(Target &targ) { delete oldmem; } else { const FileEntry *toFE = targ.get<const FileEntry *>(); - llvm::DenseMap<const FileEntry *, const FileEntry *>::iterator - I = ToFromMappings.find(toFE); - if (I != ToFromMappings.end()) - ToFromMappings.erase(I); + ToFromMappings.erase(toFE); } } diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 1e0eeb2122..90eb861d93 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -1235,10 +1235,7 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty) { } LexicalBlockStack.pop_back(); - llvm::DenseMap<const Decl *, llvm::WeakVH>::iterator RI = - RegionMap.find(Ty->getDecl()); - if (RI != RegionMap.end()) - RegionMap.erase(RI); + RegionMap.erase(Ty->getDecl()); llvm::DIArray Elements = DBuilder.getOrCreateArray(EltTys); // FIXME: Magic numbers ahoy! These should be changed when we diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 5fdb427e27..1c8f5f65f9 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -823,10 +823,7 @@ void CodeGenModule::EmitGlobal(GlobalDecl GD) { FD->getBody(InlineDefinition); StringRef MangledName = getMangledName(GD); - llvm::StringMap<GlobalDecl>::iterator DDI = - DeferredDecls.find(MangledName); - if (DDI != DeferredDecls.end()) - DeferredDecls.erase(DDI); + DeferredDecls.erase(MangledName); EmitGlobalDefinition(InlineDefinition); return; } diff --git a/lib/Lex/PreprocessingRecord.cpp b/lib/Lex/PreprocessingRecord.cpp index b8e6152466..440e4780ca 100644 --- a/lib/Lex/PreprocessingRecord.cpp +++ b/lib/Lex/PreprocessingRecord.cpp @@ -358,10 +358,7 @@ void PreprocessingRecord::MacroDefined(const Token &Id, void PreprocessingRecord::MacroUndefined(const Token &Id, const MacroInfo *MI) { - llvm::DenseMap<const MacroInfo *, PPEntityID>::iterator Pos - = MacroDefinitions.find(MI); - if (Pos != MacroDefinitions.end()) - MacroDefinitions.erase(Pos); + MacroDefinitions.erase(MI); } void PreprocessingRecord::InclusionDirective( |