Stop the ValueMapper from calling getAllMetadata, which unpacks DebugLoc into

an MDNode.  This saves a bunch of time and memory in the IR linker, e.g. when 
doing LTO of files with debug info.

llvm-svn: 135172
This commit is contained in:
Chris Lattner 2011-07-14 18:53:50 +00:00
parent 6778597deb
commit 69eea72779

View File

@ -167,9 +167,10 @@ void llvm::RemapInstruction(Instruction *I, ValueToValueMapTy &VMap,
}
}
// Remap attached metadata.
// Remap attached metadata. Don't bother remapping DebugLoc, it can never
// have mappings to do.
SmallVector<std::pair<unsigned, MDNode *>, 4> MDs;
I->getAllMetadata(MDs);
I->getAllMetadataOtherThanDebugLoc(MDs);
for (SmallVectorImpl<std::pair<unsigned, MDNode *> >::iterator
MI = MDs.begin(), ME = MDs.end(); MI != ME; ++MI) {
MDNode *Old = MI->second;