Request DwarfWriter. This will be used to handle dbg_* intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61999 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-01-09 19:11:50 +00:00
parent ed78f431ed
commit 6e7a1617ac
3 changed files with 10 additions and 3 deletions

View File

@ -32,6 +32,7 @@ class AliasAnalysis;
class TargetLowering; class TargetLowering;
class TargetMachine; class TargetMachine;
class MachineModuleInfo; class MachineModuleInfo;
class DwarfWriter;
class MachineFunction; class MachineFunction;
class MachineConstantPoolValue; class MachineConstantPoolValue;
class FunctionLoweringInfo; class FunctionLoweringInfo;
@ -76,6 +77,7 @@ class SelectionDAG {
MachineFunction *MF; MachineFunction *MF;
FunctionLoweringInfo &FLI; FunctionLoweringInfo &FLI;
MachineModuleInfo *MMI; MachineModuleInfo *MMI;
DwarfWriter *DW;
/// EntryNode - The starting token. /// EntryNode - The starting token.
SDNode EntryNode; SDNode EntryNode;
@ -122,7 +124,7 @@ public:
/// init - Prepare this SelectionDAG to process code in the given /// init - Prepare this SelectionDAG to process code in the given
/// MachineFunction. /// MachineFunction.
/// ///
void init(MachineFunction &mf, MachineModuleInfo *mmi); void init(MachineFunction &mf, MachineModuleInfo *mmi, DwarfWriter *dw);
/// clear - Clear state and free memory necessary to make this /// clear - Clear state and free memory necessary to make this
/// SelectionDAG ready to process a new block. /// SelectionDAG ready to process a new block.

View File

@ -772,9 +772,11 @@ SelectionDAG::SelectionDAG(TargetLowering &tli, FunctionLoweringInfo &fli)
AllNodes.push_back(&EntryNode); AllNodes.push_back(&EntryNode);
} }
void SelectionDAG::init(MachineFunction &mf, MachineModuleInfo *mmi) { void SelectionDAG::init(MachineFunction &mf, MachineModuleInfo *mmi,
DwarfWriter *dw) {
MF = &mf; MF = &mf;
MMI = mmi; MMI = mmi;
DW = dw;
} }
SelectionDAG::~SelectionDAG() { SelectionDAG::~SelectionDAG() {

View File

@ -36,6 +36,7 @@
#include "llvm/CodeGen/ScheduleDAGSDNodes.h" #include "llvm/CodeGen/ScheduleDAGSDNodes.h"
#include "llvm/CodeGen/SchedulerRegistry.h" #include "llvm/CodeGen/SchedulerRegistry.h"
#include "llvm/CodeGen/SelectionDAG.h" #include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/Target/TargetRegisterInfo.h" #include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetData.h" #include "llvm/Target/TargetData.h"
#include "llvm/Target/TargetFrameInfo.h" #include "llvm/Target/TargetFrameInfo.h"
@ -288,6 +289,7 @@ unsigned SelectionDAGISel::MakeReg(MVT VT) {
void SelectionDAGISel::getAnalysisUsage(AnalysisUsage &AU) const { void SelectionDAGISel::getAnalysisUsage(AnalysisUsage &AU) const {
AU.addRequired<AliasAnalysis>(); AU.addRequired<AliasAnalysis>();
AU.addRequired<GCModuleInfo>(); AU.addRequired<GCModuleInfo>();
AU.addRequired<DwarfWriter>();
AU.setPreservesAll(); AU.setPreservesAll();
} }
@ -316,7 +318,8 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) {
FuncInfo->set(Fn, MF, EnableFastISel); FuncInfo->set(Fn, MF, EnableFastISel);
MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>(); MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
CurDAG->init(MF, MMI); DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>();
CurDAG->init(MF, MMI, DW);
SDL->init(GFI, *AA); SDL->init(GFI, *AA);
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)