class GlobalVariable;
class MachineConstantPoolEntry;
class MachineConstantPoolValue;
- class MachineModuleInfo;
+ class DwarfWriter;
class Mangler;
class Section;
class TargetAsmInfo;
///
unsigned FunctionNumber;
- /// MachineModuleInfo - This is needed because printDeclare() has to insert
- /// DebugVariable entries into the dwarf table. This is a short term hack
+ /// DW -This is needed because printDeclare() has to insert
+ /// DbgVariable entries into the dwarf table. This is a short term hack
/// that ought be fixed soon.
- MachineModuleInfo *MMI;
+ DwarfWriter *DW;
// GCMetadataPrinters - The garbage collection metadata printer table.
typedef DenseMap<GCStrategy*,GCMetadataPrinter*> gcp_map_type;
/// getRecordSourceLineCount - Count source lines.
unsigned getRecordSourceLineCount();
+ /// RecordVariable - Indicate the declaration of a local variable.
+ ///
+ void RecordVariable(GlobalVariable *GV, unsigned FrameIndex);
+
/// hasDebugInfo - Return true if debug info intrinsics are seen in
/// this module.
bool hasDebugInfo();
#include "llvm/CodeGen/MachineConstantPool.h"
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
+#include "llvm/CodeGen/DwarfWriter.h"
#include "llvm/Support/Mangler.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetAsmInfo.h"
SwitchToDataSection(""); // Reset back to no section.
- MMI = getAnalysisToUpdate<MachineModuleInfo>();
+ MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>();
if (MMI) MMI->AnalyzeModule(M);
-
+ DW = getAnalysisToUpdate<DwarfWriter>();
return false;
}
/// FIXME: It doesn't really print anything rather it inserts a DebugVariable
/// entry into dwarf table.
void AsmPrinter::printDeclare(const MachineInstr *MI) const {
- int FI = MI->getOperand(0).getIndex();
+ unsigned FI = MI->getOperand(0).getIndex();
GlobalValue *GV = MI->getOperand(1).getGlobal();
- MMI->RecordVariable(GV, FI);
+ DW->RecordVariable(cast<GlobalVariable>(GV), FI);
}
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
return DD->getRecordSourceLineCount();
}
+/// RecordVariable - Indicate the declaration of a local variable.
+///
+void DwarfWriter::RecordVariable(GlobalVariable *GV, unsigned FrameIndex) {
+ DD->RecordVariable(GV, FrameIndex);
+}
+
/// hasDebugInfo - Return true if debug info intrinsics are seen in
/// this module.
bool DwarfWriter::hasDebugInfo() {