IR: Use Optional instead of unique_ptr for Metadata map in ValueMap, NFC

llvm-svn: 266751
This commit is contained in:
Duncan P. N. Exon Smith 2016-04-19 16:17:48 +00:00
parent d8a373b882
commit a434679bb1

View File

@ -85,7 +85,7 @@ class ValueMap {
typedef DenseMap<const Metadata *, TrackingMDRef> MDMapT;
typedef typename Config::ExtraData ExtraData;
MapT Map;
std::unique_ptr<MDMapT> MDMap;
Optional<MDMapT> MDMap;
ExtraData Data;
bool MayMapMetadata = true;
@ -106,7 +106,7 @@ public:
bool hasMD() const { return bool(MDMap); }
MDMapT &MD() {
if (!MDMap)
MDMap.reset(new MDMapT);
MDMap.emplace();
return *MDMap;
}