First initialize DAG otherwise dwarf writer is used uninitialized.

Duncan spotted this. Thanks!

llvm-svn: 63641
This commit is contained in:
Devang Patel 2009-02-03 18:46:32 +00:00
parent 73eff2e6e8
commit 70da8e8425
2 changed files with 2 additions and 2 deletions

View File

@ -787,7 +787,7 @@ unsigned SelectionDAG::getMVTAlignment(MVT VT) const {
}
SelectionDAG::SelectionDAG(TargetLowering &tli, FunctionLoweringInfo &fli)
: TLI(tli), FLI(fli),
: TLI(tli), FLI(fli), DW(0),
EntryNode(ISD::EntryToken, getVTList(MVT::Other)),
Root(getEntryNode()) {
AllNodes.push_back(&EntryNode);

View File

@ -313,10 +313,10 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) {
RegInfo = &MF->getRegInfo();
DOUT << "\n\n\n=== " << Fn.getName() << "\n";
FuncInfo->set(Fn, *MF, *CurDAG, EnableFastISel);
MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();
DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
CurDAG->init(*MF, MMI, DW);
FuncInfo->set(Fn, *MF, *CurDAG, EnableFastISel);
SDL->init(GFI, *AA);
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)