diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-06-09 20:46:33 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-06-09 20:46:33 +0000 |
commit | c3f89973863fdbe2ae896fabd9ce29b593d0bc12 (patch) | |
tree | c76ca6ee304fc31a13b8b364a3161d0145079400 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | e8b8a347c7306e9213a793cf1a2ce027e60fdcf3 (diff) | |
download | llvm-c3f89973863fdbe2ae896fabd9ce29b593d0bc12.zip llvm-c3f89973863fdbe2ae896fabd9ce29b593d0bc12.tar.gz llvm-c3f89973863fdbe2ae896fabd9ce29b593d0bc12.tar.bz2 |
BitcodeReader: Use std:::piecewise_construct when upgrading type refs
r267296 used std::piecewise_construct without using
std::forward_as_tuple, and r267298 hacked it out (using an emplace_back
followed by a couple of reset() calls) because of a problem on a bot.
I'm finally circling back to call forward_as_tuple as I should have to
begin with (thanks to David Blaikie for pointing out the missing piece).
Note that this code uses emplace_back() instead of
push_back(make_pair()) because the move constructor for TrackingMDRef is
expensive (cheaper than a copy, but still expensive).
llvm-svn: 272306
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 0c28950..3bba025 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1238,9 +1238,9 @@ Metadata *BitcodeReaderMetadataList::upgradeTypeRefArray(Metadata *MaybeTuple) { // Create and return a placeholder to use for now. Eventually // resolveTypeRefArrays() will be resolve this forward reference. - OldTypeRefs.Arrays.emplace_back(); - OldTypeRefs.Arrays.back().first.reset(Tuple); - OldTypeRefs.Arrays.back().second = MDTuple::getTemporary(Context, None); + OldTypeRefs.Arrays.emplace_back( + std::piecewise_construct, std::forward_as_tuple(Tuple), + std::forward_as_tuple(MDTuple::getTemporary(Context, None))); return OldTypeRefs.Arrays.back().second.get(); } |