Use StringRef's in resolved path cache to avoid extra internString lookups. NFC.
authorPete Cooper <peter_cooper@apple.com>
Fri, 18 Mar 2016 03:48:09 +0000 (03:48 +0000)
committerPete Cooper <peter_cooper@apple.com>
Fri, 18 Mar 2016 03:48:09 +0000 (03:48 +0000)
commitef4e36ad998085770e9230182c3db5240f29dfcf
tree6f39d231cd5d9e7be70caed57d0ea95caa8e2fc8
parentc43b584c1c19e0604f1aa7dc6ca5c004490e7f1e
Use StringRef's in resolved path cache to avoid extra internString lookups.  NFC.

ResolvedPaths was storing std::string's as a cache. We would then take those strings and look them up in the internString pool to get a unique StringRef for each path.

This patch changes ResolvedPaths to store the StringRef pointing in to the internString pool itself. This way, when getResolvedPath returns a string, we know we have the StringRef we would find in the pool anyway. We can avoid the duplicate memory of the std::string's, and also the time from the lookup.

Unfortunately my profiles show no runtime change here, but it should still save memory allocations which is nice.

Reviewed by Frederic Riss.

Differential Revision: http://reviews.llvm.org/D18259

llvm-svn: 263774
llvm/tools/dsymutil/DwarfLinker.cpp