Simplify some users of DenseMap::erase.

llvm-svn: 153389
This commit is contained in:
Benjamin Kramer 2012-03-24 18:22:12 +00:00
parent 16366da437
commit e894e09e70
4 changed files with 4 additions and 16 deletions

View File

@ -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);
}
}

View File

@ -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

View File

@ -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;
}

View File

@ -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(