2009-07-31 18:16:33 +00:00
|
|
|
//===-- MachineFunctionAnalysis.h - Owner of MachineFunctions ----*-C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the MachineFunctionAnalysis class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-01-10 00:45:19 +00:00
|
|
|
#ifndef LLVM_CODEGEN_MACHINEFUNCTIONANALYSIS_H
|
|
|
|
#define LLVM_CODEGEN_MACHINEFUNCTIONANALYSIS_H
|
2009-07-31 18:16:33 +00:00
|
|
|
|
|
|
|
#include "llvm/Pass.h"
|
2009-11-16 20:45:50 +00:00
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2009-07-31 18:16:33 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class MachineFunction;
|
|
|
|
|
|
|
|
/// MachineFunctionAnalysis - This class is a Pass that manages a
|
|
|
|
/// MachineFunction object.
|
|
|
|
struct MachineFunctionAnalysis : public FunctionPass {
|
|
|
|
private:
|
|
|
|
const TargetMachine &TM;
|
|
|
|
MachineFunction *MF;
|
2010-01-26 04:35:26 +00:00
|
|
|
unsigned NextFnNum;
|
2009-07-31 18:16:33 +00:00
|
|
|
public:
|
|
|
|
static char ID;
|
2011-11-16 08:38:26 +00:00
|
|
|
explicit MachineFunctionAnalysis(const TargetMachine &tm);
|
2009-08-01 04:19:43 +00:00
|
|
|
~MachineFunctionAnalysis();
|
2009-07-31 18:16:33 +00:00
|
|
|
|
|
|
|
MachineFunction &getMF() const { return *MF; }
|
2011-01-04 18:21:18 +00:00
|
|
|
|
|
|
|
virtual const char* getPassName() const {
|
|
|
|
return "Machine Function Analysis";
|
|
|
|
}
|
2009-07-31 18:16:33 +00:00
|
|
|
|
|
|
|
private:
|
2010-04-06 00:51:52 +00:00
|
|
|
virtual bool doInitialization(Module &M);
|
2009-07-31 18:16:33 +00:00
|
|
|
virtual bool runOnFunction(Function &F);
|
|
|
|
virtual void releaseMemory();
|
|
|
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|