<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 3, 2015 at 3:43 PM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yours? <div><a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/653/steps/build%20clang/logs/stdio" target="_blank">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fuzzer/builds/653/steps/build%20clang/logs/stdio</a><br></div><div><pre style="font-family:'Courier New',courier,monotype,monospace;color:rgb(0,0,0);font-size:medium"><span>/mnt/b/sanitizer-buildbot5/sanitizer-x86_64-linux-fuzzer/build/llvm/lib/CodeGen/LiveStackAnalysis.cpp:64:16: error: ‘llvm::LiveStacks::SS2IntervalMap’ has no member named ‘emplace’</span></pre></div></div></blockquote><div><br>Yep, GCC 4.7 is apparently the bane of my existence... or something.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><pre style="font-family:'Courier New',courier,monotype,monospace;color:rgb(0,0,0);font-size:medium"><span>
</span></pre></div><div><span><br></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 3, 2015 at 3:30 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: dblaikie<br>
Date: Tue Mar 3 17:30:40 2015<br>
New Revision: 231168<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=231168&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=231168&view=rev</a><br>
Log:<br>
unique_ptrify LiveRange::segmentSet<br>
<br>
This makes LiveRange non-copyable, and LiveInterval is already<br>
non-movable (due to the explicit dtor), so now it's non-copyable and<br>
non-movable.<br>
<br>
Fix the one case where we were relying on the (deprecated in C++11)<br>
implicit copy ctor of LiveInterval (which happened to work because the<br>
ctor created an object with a null segmentSet, so double-deleting the<br>
null pointer was fine).<br>
<br>
Modified:<br>
llvm/trunk/include/llvm/CodeGen/LiveInterval.h<br>
llvm/trunk/lib/CodeGen/LiveInterval.cpp<br>
llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveInterval.h?rev=231168&r1=231167&r2=231168&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveInterval.h?rev=231168&r1=231167&r2=231168&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/LiveInterval.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/LiveInterval.h Tue Mar 3 17:30:40 2015<br>
@@ -199,7 +199,7 @@ namespace llvm {<br>
// of live ranges of physical registers in computeRegUnitRange.<br>
// After that the set is flushed to the segment vector and deleted.<br>
typedef std::set<Segment> SegmentSet;<br>
- SegmentSet *segmentSet;<br>
+ std::unique_ptr<SegmentSet> segmentSet;<br>
<br>
typedef Segments::iterator iterator;<br>
iterator begin() { return segments.begin(); }<br>
@@ -218,15 +218,13 @@ namespace llvm {<br>
const_vni_iterator vni_end() const { return valnos.end(); }<br>
<br>
/// Constructs a new LiveRange object.<br>
- LiveRange(bool UseSegmentSet = false) : segmentSet(nullptr) {<br>
- if (UseSegmentSet)<br>
- segmentSet = new SegmentSet();<br>
- }<br>
+ LiveRange(bool UseSegmentSet = false)<br>
+ : segmentSet(UseSegmentSet ? llvm::make_unique<SegmentSet>()<br>
+ : nullptr) {}<br>
<br>
/// Constructs a new LiveRange object by copying segments and valnos from<br>
/// another LiveRange.<br>
- LiveRange(const LiveRange &Other, BumpPtrAllocator &Allocator)<br>
- : segmentSet(nullptr) {<br>
+ LiveRange(const LiveRange &Other, BumpPtrAllocator &Allocator) {<br>
assert(Other.segmentSet == nullptr &&<br>
"Copying of LiveRanges with active SegmentSets is not supported");<br>
<br>
@@ -240,8 +238,6 @@ namespace llvm {<br>
}<br>
}<br>
<br>
- ~LiveRange() { delete segmentSet; }<br>
-<br>
/// advanceTo - Advance the specified iterator to point to the Segment<br>
/// containing the specified position, or end() if the position is past the<br>
/// end of the range. If no Segment contains this position, but the<br>
@@ -745,8 +741,6 @@ namespace llvm {<br>
#endif<br>
<br>
private:<br>
- LiveInterval& operator=(const LiveInterval& rhs) = delete;<br>
-<br>
/// Appends @p Range to SubRanges list.<br>
void appendSubRange(SubRange *Range) {<br>
Range->Next = SubRanges;<br>
<br>
Modified: llvm/trunk/lib/CodeGen/LiveInterval.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveInterval.cpp?rev=231168&r1=231167&r2=231168&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveInterval.cpp?rev=231168&r1=231167&r2=231168&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/LiveInterval.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/LiveInterval.cpp Tue Mar 3 17:30:40 2015<br>
@@ -743,7 +743,6 @@ void LiveRange::flushSegmentSet() {<br>
segments.empty() &&<br>
"segment set can be used only initially before switching to the array");<br>
segments.append(segmentSet->begin(), segmentSet->end());<br>
- delete segmentSet;<br>
segmentSet = nullptr;<br>
verify();<br>
}<br>
<br>
Modified: llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp?rev=231168&r1=231167&r2=231168&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp?rev=231168&r1=231167&r2=231168&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/LiveStackAnalysis.cpp Tue Mar 3 17:30:40 2015<br>
@@ -61,8 +61,10 @@ LiveStacks::getOrCreateInterval(int Slot<br>
assert(Slot >= 0 && "Spill slot indice must be >= 0");<br>
SS2IntervalMap::iterator I = S2IMap.find(Slot);<br>
if (I == S2IMap.end()) {<br>
- I = S2IMap.insert(I, std::make_pair(Slot,<br>
- LiveInterval(TargetRegisterInfo::index2StackSlot(Slot), 0.0F)));<br>
+ I = S2IMap.emplace(std::piecewise_construct, std::forward_as_tuple(Slot),<br>
+ std::forward_as_tuple(<br>
+ TargetRegisterInfo::index2StackSlot(Slot), 0.0F))<br>
+ .first;<br>
S2RCMap.insert(std::make_pair(Slot, RC));<br>
} else {<br>
// Use the largest common subclass register class.<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>