[llvm-commits] [llvm] r63641 - in /llvm/trunk/lib/CodeGen/SelectionDAG: SelectionDAG.cpp SelectionDAGISel.cpp

Devang Patel dpatel at apple.com
Wed Feb 4 09:49:12 PST 2009


On Feb 3, 2009, at 11:11 PM, Duncan Sands wrote:

> Hi Devang,
>
>> First initialize DAG otherwise dwarf writer is used uninitialized.
>> Duncan spotted this. Thanks!
>
> is this fix correct?  Someplace was trying to output debug info,
> and was using an uninitialized DW.  Now that DW is zero, it won't
> crash but it also won't output the debug info.


>  But maybe it should
> be outputting debug info?  If so, then DW needs to be initialized
> to a non-null value earlier...

... it is.

Now, CurDAG->init() happens before FuncInfo->set(..., *CurDAG, ..).  
init() sets DW and set(...) wants to output debug info.
-
Devang
>
>
> Ciao,
>
> Duncan.
>
>>
>>
>> Modified:
>>    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
>>    llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
>>
>> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=63641&r1=63640&r2=63641&view=diff
>>
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Feb  3  
>> 12:46:32 2009
>> @@ -787,7 +787,7 @@
>> }
>>
>> 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);
>>
>> Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=63641&r1=63640&r2=63641&view=diff
>>
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp  
>> (original)
>> +++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue  
>> Feb  3 12:46:32 2009
>> @@ -313,10 +313,10 @@
>>   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)
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>

-
Devang






More information about the llvm-commits mailing list