Request DwarfWriter. This will be used to handle dbg_* intrinsics.
authorDevang Patel <dpatel@apple.com>
Fri, 9 Jan 2009 19:11:50 +0000 (19:11 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 9 Jan 2009 19:11:50 +0000 (19:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61999 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/SelectionDAG.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index ea35e69a4868b804a9dee8984ff5e7768116233c..45dacfffa9a714891adbce2e02298e5f3b878f1e 100644 (file)
@@ -32,6 +32,7 @@ class AliasAnalysis;
 class TargetLowering;
 class TargetMachine;
 class MachineModuleInfo;
+class DwarfWriter;
 class MachineFunction;
 class MachineConstantPoolValue;
 class FunctionLoweringInfo;
@@ -76,6 +77,7 @@ class SelectionDAG {
   MachineFunction *MF;
   FunctionLoweringInfo &FLI;
   MachineModuleInfo *MMI;
+  DwarfWriter *DW;
 
   /// EntryNode - The starting token.
   SDNode EntryNode;
@@ -122,7 +124,7 @@ public:
   /// init - Prepare this SelectionDAG to process code in the given
   /// 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
   /// SelectionDAG ready to process a new block.
index 5da693cae88d73b7313cffe5320eec89e694902f..c755eac951642cfcdfd187fcc8c4afe3f7a25a32 100644 (file)
@@ -772,9 +772,11 @@ SelectionDAG::SelectionDAG(TargetLowering &tli, FunctionLoweringInfo &fli)
   AllNodes.push_back(&EntryNode);
 }
 
-void SelectionDAG::init(MachineFunction &mf, MachineModuleInfo *mmi) {
+void SelectionDAG::init(MachineFunction &mf, MachineModuleInfo *mmi,
+                        DwarfWriter *dw) {
   MF = &mf;
   MMI = mmi;
+  DW = dw;
 }
 
 SelectionDAG::~SelectionDAG() {
index 3221de064e3f5583bf5690b55a0d0075fd7b14e3..4eb70198817e27d0d76e4be5b20e4d0ef3a9f9bb 100644 (file)
@@ -36,6 +36,7 @@
 #include "llvm/CodeGen/ScheduleDAGSDNodes.h"
 #include "llvm/CodeGen/SchedulerRegistry.h"
 #include "llvm/CodeGen/SelectionDAG.h"
+#include "llvm/CodeGen/DwarfWriter.h"
 #include "llvm/Target/TargetRegisterInfo.h"
 #include "llvm/Target/TargetData.h"
 #include "llvm/Target/TargetFrameInfo.h"
@@ -288,6 +289,7 @@ unsigned SelectionDAGISel::MakeReg(MVT VT) {
 void SelectionDAGISel::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.addRequired<AliasAnalysis>();
   AU.addRequired<GCModuleInfo>();
+  AU.addRequired<DwarfWriter>();
   AU.setPreservesAll();
 }
 
@@ -316,7 +318,8 @@ bool SelectionDAGISel::runOnFunction(Function &Fn) {
 
   FuncInfo->set(Fn, MF, EnableFastISel);
   MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
-  CurDAG->init(MF, MMI);
+  DwarfWriter *DW = getAnalysisToUpdate<DwarfWriter>();
+  CurDAG->init(MF, MMI, DW);
   SDL->init(GFI, *AA);
 
   for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)