pass machinemoduleinfo down into getSymbolForDwarfGlobalReference,
[llvm/avr.git] / lib / CodeGen / MachineFunctionAnalysis.cpp
blobae9d5a99c04df9af24801c3857b68a42f819af8f
1 //===-- MachineFunctionAnalysis.cpp ---------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the definitions of the MachineFunctionAnalysis members.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/CodeGen/MachineFunctionAnalysis.h"
15 #include "llvm/CodeGen/MachineFunction.h"
16 using namespace llvm;
18 // Register this pass with PassInfo directly to avoid having to define
19 // a default constructor.
20 static PassInfo
21 X("Machine Function Analysis", "machine-function-analysis",
22 intptr_t(&MachineFunctionAnalysis::ID), 0,
23 /*CFGOnly=*/false, /*is_analysis=*/true);
25 char MachineFunctionAnalysis::ID = 0;
27 MachineFunctionAnalysis::MachineFunctionAnalysis(TargetMachine &tm,
28 CodeGenOpt::Level OL) :
29 FunctionPass(&ID), TM(tm), OptLevel(OL), MF(0) {
32 MachineFunctionAnalysis::~MachineFunctionAnalysis() {
33 assert(!MF && "MachineFunctionAnalysis left initialized!");
36 bool MachineFunctionAnalysis::runOnFunction(Function &F) {
37 assert(!MF && "MachineFunctionAnalysis already initialized!");
38 MF = new MachineFunction(&F, TM);
39 return false;
42 void MachineFunctionAnalysis::releaseMemory() {
43 delete MF;
44 MF = 0;
47 void MachineFunctionAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
48 AU.setPreservesAll();