unique_ptrify FullDependenceAnalysis::DV

Making this type a little harder to abuse (see workaround relating to
use of the implicit copy ctor in the prior commit)

llvm-svn: 231104
This commit is contained in:
David Blaikie 2015-03-03 19:20:18 +00:00
parent c5771c214e
commit 5b240485b7
2 changed files with 6 additions and 13 deletions

View File

@ -221,9 +221,6 @@ namespace llvm {
Instruction *Dst,
bool LoopIndependent,
unsigned Levels);
~FullDependence() {
delete[] DV;
}
/// isLoopIndependent - Returns true if this is a loop-independent
/// dependence.
@ -270,7 +267,7 @@ namespace llvm {
unsigned short Levels;
bool LoopIndependent;
bool Consistent; // Init to true, then refine.
DVEntry *DV;
std::unique_ptr<DVEntry[]> DV;
friend class DependenceAnalysis;
};

View File

@ -226,16 +226,12 @@ bool Dependence::isScalar(unsigned level) const {
//===----------------------------------------------------------------------===//
// 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.