summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-19 16:57:24 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-19 16:57:24 +0000
commita4810fac198c496d8e16c99da0fe57b89be8598e (patch)
treeaa1f2f025f2d9403e8732dafc1845b529fb25134 /llvm/include
parenta1202bf5944ad4a28d1e391a0a2da175bd9b27d0 (diff)
downloadbcm5719-llvm-a4810fac198c496d8e16c99da0fe57b89be8598e.tar.gz
bcm5719-llvm-a4810fac198c496d8e16c99da0fe57b89be8598e.zip
Linker: Avoid constructing ValueMap::MDMapT
Calling ValueMap::MD lazily constructs a ValueMap, which mallocs the buckets. Instead of swapping constructed maps, move around the underlying Optional<MDMapT>. This gets rid of some unnecessary malloc traffic from r266579 (not that it showed up on a profile). llvm-svn: 266761
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/IR/ValueMap.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/include/llvm/IR/ValueMap.h b/llvm/include/llvm/IR/ValueMap.h
index 043e813b09b..85379ad468c 100644
--- a/llvm/include/llvm/IR/ValueMap.h
+++ b/llvm/include/llvm/IR/ValueMap.h
@@ -109,6 +109,7 @@ public:
MDMap.emplace();
return *MDMap;
}
+ Optional<MDMapT> &getMDMap() { return MDMap; }
bool mayMapMetadata() const { return MayMapMetadata; }
void enableMapMetadata() { MayMapMetadata = true; }
OpenPOWER on IntegriCloud