@@ -19,16 +19,16 @@ using namespace llvm;
1919
2020#define DEBUG_TYPE " livestacks"
2121
22- char LiveStacks ::ID = 0 ;
23- INITIALIZE_PASS_BEGIN (LiveStacks , DEBUG_TYPE,
24- " Live Stack Slot Analysis" , false , false )
22+ char LiveStacksWrapperLegacy ::ID = 0 ;
23+ INITIALIZE_PASS_BEGIN (LiveStacksWrapperLegacy , DEBUG_TYPE,
24+ " Live Stack Slot Analysis" , false , false )
2525INITIALIZE_PASS_DEPENDENCY(SlotIndexesWrapperPass)
26- INITIALIZE_PASS_END(LiveStacks , DEBUG_TYPE,
27- " Live Stack Slot Analysis" , false , false )
26+ INITIALIZE_PASS_END(LiveStacksWrapperLegacy , DEBUG_TYPE,
27+ " Live Stack Slot Analysis" , false , false )
2828
29- char &llvm::LiveStacksID = LiveStacks ::ID;
29+ char &llvm::LiveStacksID = LiveStacksWrapperLegacy ::ID;
3030
31- void LiveStacks ::getAnalysisUsage (AnalysisUsage &AU) const {
31+ void LiveStacksWrapperLegacy ::getAnalysisUsage (AnalysisUsage &AU) const {
3232 AU.setPreservesAll ();
3333 AU.addPreserved <SlotIndexesWrapperPass>();
3434 AU.addRequiredTransitive <SlotIndexesWrapperPass>();
@@ -42,11 +42,10 @@ void LiveStacks::releaseMemory() {
4242 S2RCMap.clear ();
4343}
4444
45- bool LiveStacks::runOnMachineFunction (MachineFunction &MF) {
45+ void LiveStacks::init (MachineFunction &MF) {
4646 TRI = MF.getSubtarget ().getRegisterInfo ();
4747 // FIXME: No analysis is being done right now. We are relying on the
4848 // register allocators to provide the information.
49- return false ;
5049}
5150
5251LiveInterval &
@@ -68,6 +67,27 @@ LiveStacks::getOrCreateInterval(int Slot, const TargetRegisterClass *RC) {
6867 return I->second ;
6968}
7069
70+ AnalysisKey LiveStacksAnalysis::Key;
71+
72+ LiveStacks LiveStacksAnalysis::run (MachineFunction &MF,
73+ MachineFunctionAnalysisManager &) {
74+ LiveStacks Impl;
75+ Impl.init (MF);
76+ return Impl;
77+ }
78+
79+ bool LiveStacksWrapperLegacy::runOnMachineFunction (MachineFunction &MF) {
80+ Impl = LiveStacks ();
81+ Impl.init (MF);
82+ return false ;
83+ }
84+
85+ void LiveStacksWrapperLegacy::releaseMemory () { Impl = LiveStacks (); }
86+
87+ void LiveStacksWrapperLegacy::print (raw_ostream &OS, const Module *) const {
88+ Impl.print (OS);
89+ }
90+
7191// / print - Implement the dump method.
7292void LiveStacks::print (raw_ostream &OS, const Module*) const {
7393
0 commit comments