First initialize DAG otherwise dwarf writer is used uninitialized.
authorDevang Patel <dpatel@apple.com>
Tue, 3 Feb 2009 18:46:32 +0000 (18:46 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 3 Feb 2009 18:46:32 +0000 (18:46 +0000)
Duncan spotted this. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63641 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index c34211505ac2930b4c5fac77d699a11ac68cb0cd..82cc3263ed224d3ab092f13846092acecfed9633 100644 (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);
index 9c53fc9362c065715fef5380365bfd5d20ee19c0..9d480e68b5fe1d1cef8f162645ad6131fc28489d 100644 (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)