<div dir="ltr">That's odd. It's just a unique_ptr to an array - that should be supported. I'm going to try #including memory directly and recommit.<div><br><div>- Lang.</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 26, 2014 at 12:50 PM, Hans Wennborg <span dir="ltr"><<a href="mailto:hans@hanshq.net" target="_blank">hans@hanshq.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: hans<br>
Date: Sun Oct 26 14:50:13 2014<br>
New Revision: 220645<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=220645&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=220645&view=rev</a><br>
Log:<br>
Revert "[PBQP] Unique-ptrify some PBQP Metadata structures. No functional change." (r220642)<br>
<br>
It broke the Windows build:<br>
<br>
[1/19] Building CXX object lib\CodeGen\CMakeFiles\LLVMCodeGen.dir\RegAllocPBQP.cpp.obj<br>
C:\bb-win7\ninja-clang-i686-msc17-R\llvm-project\llvm\include\llvm/CodeGen/RegAllocPBQP.h(132) : error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>'<br>
<br>
with<br>
[<br>
_Ty=unsigned int []<br>
]<br>
D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\memory(1600) : see declaration of 'std::unique_ptr<_Ty>::unique_ptr'<br>
with<br>
[<br>
_Ty=unsigned int []<br>
]<br>
This diagnostic occurred in the compiler generated function 'llvm::PBQP::RegAlloc::NodeMetadata::NodeMetadata(const llvm::PBQP::RegAlloc::NodeMetadata &)'<br>
<br>
Modified:<br>
llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h<br>
<br>
Modified: llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h?rev=220645&r1=220644&r2=220645&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h?rev=220645&r1=220644&r2=220645&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h (original)<br>
+++ llvm/trunk/include/llvm/CodeGen/RegAllocPBQP.h Sun Oct 26 14:50:13 2014<br>
@@ -62,15 +62,20 @@ public:<br>
delete[] ColCounts;<br>
}<br>
<br>
+ ~MatrixMetadata() {<br>
+ delete[] UnsafeRows;<br>
+ delete[] UnsafeCols;<br>
+ }<br>
+<br>
unsigned getWorstRow() const { return WorstRow; }<br>
unsigned getWorstCol() const { return WorstCol; }<br>
- const bool* getUnsafeRows() const { return UnsafeRows.get(); }<br>
- const bool* getUnsafeCols() const { return UnsafeCols.get(); }<br>
+ const bool* getUnsafeRows() const { return UnsafeRows; }<br>
+ const bool* getUnsafeCols() const { return UnsafeCols; }<br>
<br>
private:<br>
unsigned WorstRow, WorstCol;<br>
- std::unique_ptr<bool[]> UnsafeRows;<br>
- std::unique_ptr<bool[]> UnsafeCols;<br>
+ bool* UnsafeRows;<br>
+ bool* UnsafeCols;<br>
};<br>
<br>
class NodeMetadata {<br>
@@ -83,6 +88,7 @@ public:<br>
NotProvablyAllocatable } ReductionState;<br>
<br>
NodeMetadata() : RS(Unprocessed), DeniedOpts(0), OptUnsafeEdges(nullptr){}<br>
+ ~NodeMetadata() { delete[] OptUnsafeEdges; }<br>
<br>
void setVReg(unsigned VReg) { this->VReg = VReg; }<br>
unsigned getVReg() const { return VReg; }<br>
@@ -94,7 +100,7 @@ public:<br>
<br>
void setup(const Vector& Costs) {<br>
NumOpts = Costs.getLength() - 1;<br>
- OptUnsafeEdges = std::unique_ptr<unsigned[]>(new unsigned[NumOpts]());<br>
+ OptUnsafeEdges = new unsigned[NumOpts]();<br>
}<br>
<br>
ReductionState getReductionState() const { return RS; }<br>
@@ -118,15 +124,15 @@ public:<br>
<br>
bool isConservativelyAllocatable() const {<br>
return (DeniedOpts < NumOpts) ||<br>
- (std::find(&OptUnsafeEdges[0], &OptUnsafeEdges[NumOpts], 0) !=<br>
- &OptUnsafeEdges[NumOpts]);<br>
+ (std::find(OptUnsafeEdges, OptUnsafeEdges + NumOpts, 0) !=<br>
+ OptUnsafeEdges + NumOpts);<br>
}<br>
<br>
private:<br>
ReductionState RS;<br>
unsigned NumOpts;<br>
unsigned DeniedOpts;<br>
- std::unique_ptr<unsigned[]> OptUnsafeEdges;<br>
+ unsigned* OptUnsafeEdges;<br>
unsigned VReg;<br>
OptionToRegMap OptionRegs;<br>
};<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">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>