[llvm] r266751 - IR: Use Optional instead of unique_ptr for Metadata map in ValueMap, NFC
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 19 09:17:48 PDT 2016
Author: dexonsmith
Date: Tue Apr 19 11:17:48 2016
New Revision: 266751
URL: http://llvm.org/viewvc/llvm-project?rev=266751&view=rev
Log:
IR: Use Optional instead of unique_ptr for Metadata map in ValueMap, NFC
Modified:
llvm/trunk/include/llvm/IR/ValueMap.h
Modified: llvm/trunk/include/llvm/IR/ValueMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/ValueMap.h?rev=266751&r1=266750&r2=266751&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/ValueMap.h (original)
+++ llvm/trunk/include/llvm/IR/ValueMap.h Tue Apr 19 11:17:48 2016
@@ -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;
}
More information about the llvm-commits
mailing list