@@ -277,8 +277,6 @@ using BlockSkipInstsMap =
277277
278278namespace {
279279
280- class LDVImpl ;
281-
282280// / A user value is a part of a debug info user variable.
283281// /
284282// / A DBG_VALUE instruction notes that (a sub-register of) a virtual register
@@ -531,6 +529,10 @@ class UserLabel {
531529 void print (raw_ostream &, const TargetRegisterInfo *);
532530};
533531
532+ } // end anonymous namespace
533+
534+ namespace llvm {
535+
534536// / Implementation of the LiveDebugVariables pass.
535537class LDVImpl {
536538 LocMap::Allocator allocator;
@@ -673,7 +675,7 @@ class LDVImpl {
673675 void print (raw_ostream&);
674676};
675677
676- } // end anonymous namespace
678+ } // namespace llvm
677679
678680static void printDebugLoc (const DebugLoc &DL, raw_ostream &CommentOS,
679681 const LLVMContext &Ctx) {
@@ -1325,13 +1327,9 @@ LiveDebugVariablesPrinterPass::run(MachineFunction &MF,
13251327 return PreservedAnalyses::all ();
13261328}
13271329
1328- void LiveDebugVariables::Deleter::operator ()(void *Ptr) const {
1329- delete static_cast <LDVImpl *>(Ptr);
1330- }
1331-
13321330void LiveDebugVariables::releaseMemory () {
13331331 if (PImpl)
1334- static_cast <LDVImpl *>( PImpl. get ()) ->clear ();
1332+ PImpl->clear ();
13351333}
13361334
13371335bool LiveDebugVariables::invalidate (
@@ -1341,7 +1339,7 @@ bool LiveDebugVariables::invalidate(
13411339 // Some architectures split the register allocation into multiple phases based
13421340 // on register classes. This requires preserving analyses between the phases
13431341 // by default.
1344- return PAC.preservedWhenStateless ();
1342+ return ! PAC.preservedWhenStateless ();
13451343}
13461344
13471345void LiveDebugVariables::analyze (MachineFunction &MF, LiveIntervals *LIS) {
@@ -1357,7 +1355,7 @@ void LiveDebugVariables::analyze(MachineFunction &MF, LiveIntervals *LIS) {
13571355 // Have we been asked to track variable locations using instruction
13581356 // referencing?
13591357 bool InstrRef = MF.useDebugInstrRef ();
1360- static_cast <LDVImpl *>( PImpl. get ()) ->runOnMachineFunction (MF, InstrRef);
1358+ PImpl->runOnMachineFunction (MF, InstrRef);
13611359}
13621360
13631361// ===----------------------------------------------------------------------===//
@@ -1540,7 +1538,7 @@ void LDVImpl::splitRegister(Register OldReg, ArrayRef<Register> NewRegs) {
15401538void LiveDebugVariables::
15411539splitRegister (Register OldReg, ArrayRef<Register> NewRegs, LiveIntervals &LIS) {
15421540 if (PImpl)
1543- static_cast <LDVImpl *>( PImpl. get ()) ->splitRegister (OldReg, NewRegs);
1541+ PImpl->splitRegister (OldReg, NewRegs);
15441542}
15451543
15461544void UserValue::rewriteLocations (VirtRegMap &VRM, const MachineFunction &MF,
@@ -1992,7 +1990,7 @@ void LDVImpl::emitDebugValues(VirtRegMap *VRM) {
19921990
19931991void LiveDebugVariables::emitDebugValues (VirtRegMap *VRM) {
19941992 if (PImpl)
1995- static_cast <LDVImpl *>( PImpl. get ()) ->emitDebugValues (VRM);
1993+ PImpl->emitDebugValues (VRM);
19961994}
19971995
19981996#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
@@ -2001,5 +1999,5 @@ LLVM_DUMP_METHOD void LiveDebugVariables::dump() const { print(dbgs()); }
20011999
20022000void LiveDebugVariables::print (raw_ostream &OS) const {
20032001 if (PImpl)
2004- static_cast <LDVImpl *>( PImpl. get ()) ->print (OS);
2002+ PImpl->print (OS);
20052003}
0 commit comments