LLVM API Documentation

LiveStackAnalysis.cpp

Go to the documentation of this file.
00001 //===-- LiveStackAnalysis.cpp - Live Stack Slot Analysis ------------------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements the live stack slot analysis pass. It is analogous to
00011 // live interval analysis except it's analyzing liveness of stack slots rather
00012 // than registers.
00013 //
00014 //===----------------------------------------------------------------------===//
00015 
00016 #define DEBUG_TYPE "livestacks"
00017 #include "llvm/CodeGen/LiveStackAnalysis.h"
00018 #include "llvm/CodeGen/Passes.h"
00019 #include "llvm/Target/TargetRegisterInfo.h"
00020 #include "llvm/Support/Debug.h"
00021 #include "llvm/ADT/Statistic.h"
00022 using namespace llvm;
00023 
00024 char LiveStacks::ID = 0;
00025 static RegisterPass<LiveStacks> X("livestacks", "Live Stack Slot Analysis");
00026 
00027 void LiveStacks::getAnalysisUsage(AnalysisUsage &AU) const {
00028   AU.setPreservesAll();
00029   MachineFunctionPass::getAnalysisUsage(AU);
00030 }
00031 
00032 void LiveStacks::releaseMemory() {
00033   // Release VNInfo memroy regions after all VNInfo objects are dtor'd.
00034   VNInfoAllocator.Reset();
00035   s2iMap.clear();
00036 }
00037 
00038 bool LiveStacks::runOnMachineFunction(MachineFunction &) {
00039   // FIXME: No analysis is being done right now. We are relying on the
00040   // register allocators to provide the information.
00041   return false;
00042 }
00043 
00044 /// print - Implement the dump method.
00045 void LiveStacks::print(std::ostream &O, const Module* ) const {
00046   O << "********** INTERVALS **********\n";
00047   for (const_iterator I = begin(), E = end(); I != E; ++I) {
00048     I->second.print(O);
00049     O << "\n";
00050   }
00051 }