namespace llvm {
class AliasAnalysis;
-class DwarfWriter;
class FunctionLoweringInfo;
class MachineConstantPoolValue;
class MachineFunction;
MachineFunction *MF;
FunctionLoweringInfo &FLI;
MachineModuleInfo *MMI;
- DwarfWriter *DW;
LLVMContext* Context;
/// EntryNode - The starting token.
/// init - Prepare this SelectionDAG to process code in the given
/// MachineFunction.
///
- void init(MachineFunction &mf, MachineModuleInfo *mmi, DwarfWriter *dw);
+ void init(MachineFunction &mf, MachineModuleInfo *mmi);
/// clear - Clear state and free memory necessary to make this
/// SelectionDAG ready to process a new block.
TargetLowering &getTargetLoweringInfo() const { return TLI; }
FunctionLoweringInfo &getFunctionLoweringInfo() const { return FLI; }
MachineModuleInfo *getMachineModuleInfo() const { return MMI; }
- DwarfWriter *getDwarfWriter() const { return DW; }
LLVMContext *getContext() const {return Context; }
/// viewGraph - Pop up a GraphViz/gv window with the DAG rendered using 'dot'.
// EntryNode could meaningfully have debug info if we can find it...
SelectionDAG::SelectionDAG(TargetLowering &tli, FunctionLoweringInfo &fli)
- : TLI(tli), FLI(fli), DW(0),
+ : TLI(tli), FLI(fli),
EntryNode(ISD::EntryToken, DebugLoc(), getVTList(MVT::Other)),
Root(getEntryNode()), Ordering(0) {
AllNodes.push_back(&EntryNode);
DbgInfo = new SDDbgInfo();
}
-void SelectionDAG::init(MachineFunction &mf, MachineModuleInfo *mmi,
- DwarfWriter *dw) {
+void SelectionDAG::init(MachineFunction &mf, MachineModuleInfo *mmi) {
MF = &mf;
MMI = mmi;
- DW = dw;
Context = &mf.getFunction()->getContext();
}
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/Analysis/DebugInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetData.h"
if (OptLevel != CodeGenOpt::None)
// FIXME: Variable debug info is not supported here.
return 0;
- DwarfWriter *DW = DAG.getDwarfWriter();
- if (!DW)
- return 0;
DbgDeclareInst &DI = cast<DbgDeclareInst>(I);
if (!DIDescriptor::ValidDebugInfo(DI.getVariable(), CodeGenOpt::None))
return 0;
int FI = SI->second;
if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo())
- if (!DI.getDebugLoc().isUnknown())
+ if (!DI.getDebugLoc().isUnknown() && MMI->hasDebugInfo())
MMI->setVariableDbgInfo(Variable, FI, DI.getDebugLoc());
return 0;
}
case Intrinsic::dbg_value: {
- DwarfWriter *DW = DAG.getDwarfWriter();
- if (!DW)
- return 0;
DbgValueInst &DI = cast<DbgValueInst>(I);
if (!DIDescriptor::ValidDebugInfo(DI.getVariable(), CodeGenOpt::None))
return 0;
int FI = SI->second;
if (MachineModuleInfo *MMI = DAG.getMachineModuleInfo())
- if (!DI.getDebugLoc().isUnknown())
+ if (!DI.getDebugLoc().isUnknown() && MMI->hasDebugInfo())
MMI->setVariableDbgInfo(Variable, FI, DI.getDebugLoc());
return 0;
}
DEBUG(dbgs() << "\n\n\n=== " << Fn.getName() << "\n");
MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();
- DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
- CurDAG->init(*MF, MMI, DW);
+ CurDAG->init(*MF, MMI);
FuncInfo->set(Fn, *MF, EnableFastISel);
SDB->init(GFI, *AA);