delete[] ColCounts;
}
+ ~MatrixMetadata() {
+ delete[] UnsafeRows;
+ delete[] UnsafeCols;
+ }
+
unsigned getWorstRow() const { return WorstRow; }
unsigned getWorstCol() const { return WorstCol; }
- const bool* getUnsafeRows() const { return UnsafeRows.get(); }
- const bool* getUnsafeCols() const { return UnsafeCols.get(); }
+ const bool* getUnsafeRows() const { return UnsafeRows; }
+ const bool* getUnsafeCols() const { return UnsafeCols; }
private:
unsigned WorstRow, WorstCol;
- std::unique_ptr<bool[]> UnsafeRows;
- std::unique_ptr<bool[]> UnsafeCols;
+ bool* UnsafeRows;
+ bool* UnsafeCols;
};
class NodeMetadata {
NotProvablyAllocatable } ReductionState;
NodeMetadata() : RS(Unprocessed), DeniedOpts(0), OptUnsafeEdges(nullptr){}
+ ~NodeMetadata() { delete[] OptUnsafeEdges; }
void setVReg(unsigned VReg) { this->VReg = VReg; }
unsigned getVReg() const { return VReg; }
void setup(const Vector& Costs) {
NumOpts = Costs.getLength() - 1;
- OptUnsafeEdges = std::unique_ptr<unsigned[]>(new unsigned[NumOpts]());
+ OptUnsafeEdges = new unsigned[NumOpts]();
}
ReductionState getReductionState() const { return RS; }
bool isConservativelyAllocatable() const {
return (DeniedOpts < NumOpts) ||
- (std::find(&OptUnsafeEdges[0], &OptUnsafeEdges[NumOpts], 0) !=
- &OptUnsafeEdges[NumOpts]);
+ (std::find(OptUnsafeEdges, OptUnsafeEdges + NumOpts, 0) !=
+ OptUnsafeEdges + NumOpts);
}
private:
ReductionState RS;
unsigned NumOpts;
unsigned DeniedOpts;
- std::unique_ptr<unsigned[]> OptUnsafeEdges;
+ unsigned* OptUnsafeEdges;
unsigned VReg;
OptionToRegMap OptionRegs;
};