Instruction *Dst,
bool LoopIndependent,
unsigned Levels);
- ~FullDependence() {
- delete[] DV;
- }
/// isLoopIndependent - Returns true if this is a loop-independent
/// dependence.
unsigned short Levels;
bool LoopIndependent;
bool Consistent; // Init to true, then refine.
- DVEntry *DV;
+ std::unique_ptr<DVEntry[]> DV;
friend class DependenceAnalysis;
};
//===----------------------------------------------------------------------===//
// FullDependence methods
-FullDependence::FullDependence(Instruction *Source,
- Instruction *Destination,
+FullDependence::FullDependence(Instruction *Source, Instruction *Destination,
bool PossiblyLoopIndependent,
- unsigned CommonLevels) :
- Dependence(Source, Destination),
- Levels(CommonLevels),
- LoopIndependent(PossiblyLoopIndependent) {
- Consistent = true;
- DV = CommonLevels ? new DVEntry[CommonLevels] : nullptr;
-}
+ unsigned CommonLevels)
+ : Dependence(Source, Destination), Levels(CommonLevels),
+ LoopIndependent(PossiblyLoopIndependent), Consistent(true),
+ DV(CommonLevels ? new DVEntry[CommonLevels] : nullptr) {}
// The rest are simple getters that hide the implementation.