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.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_CODEGEN_MACHINE_FUNCTION_ANALYSIS_H
|
|
|
|
#define LLVM_CODEGEN_MACHINE_FUNCTION_ANALYSIS_H
|
|
|
|
|
|
|
|
#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;
|
|
|
|
CodeGenOpt::Level OptLevel;
|
|
|
|
MachineFunction *MF;
|
2010-01-26 04:35:26 +00:00
|
|
|
unsigned NextFnNum;
|
2009-07-31 18:16:33 +00:00
|
|
|
public:
|
|
|
|
static char ID;
|
2009-11-09 18:18:49 +00:00
|
|
|
explicit MachineFunctionAnalysis(const TargetMachine &tm,
|
2009-07-31 18:16:33 +00:00
|
|
|
CodeGenOpt::Level OL = CodeGenOpt::Default);
|
2009-08-01 04:19:43 +00:00
|
|
|
~MachineFunctionAnalysis();
|
2009-07-31 18:16:33 +00:00
|
|
|
|
|
|
|
MachineFunction &getMF() const { return *MF; }
|
|
|
|
CodeGenOpt::Level getOptLevel() const { return OptLevel; }
|
|
|
|
|
|
|
|
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
|