diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-14 18:53:50 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-14 18:53:50 +0000 |
commit | 69eea727793a000a941760449f87fed9cb67a2a9 (patch) | |
tree | 4ce91af1a03965f9132bf523496c1aff9d042c6a /llvm/lib/Transforms/Utils/ValueMapper.cpp | |
parent | 6778597deb6a491e28976087a8dfa9e8ab6fbfd0 (diff) | |
download | bcm5719-llvm-69eea727793a000a941760449f87fed9cb67a2a9.tar.gz bcm5719-llvm-69eea727793a000a941760449f87fed9cb67a2a9.zip |
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
Diffstat (limited to 'llvm/lib/Transforms/Utils/ValueMapper.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/ValueMapper.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/ValueMapper.cpp b/llvm/lib/Transforms/Utils/ValueMapper.cpp index 30fc60081d5..e728fd16a30 100644 --- a/llvm/lib/Transforms/Utils/ValueMapper.cpp +++ b/llvm/lib/Transforms/Utils/ValueMapper.cpp @@ -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; |