diff options
| author | Devang Patel <dpatel@apple.com> | 2009-01-13 21:44:10 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-01-13 21:44:10 +0000 |
| commit | dd25a9d0aac7df7db53a80efeb108032b724910c (patch) | |
| tree | f210c9bac45dc9d05d39ad04a8e46d5d5d829549 /llvm/lib/CodeGen | |
| parent | ca997988c3946808e0688354e055c898d2ea448f (diff) | |
| download | bcm5719-llvm-dd25a9d0aac7df7db53a80efeb108032b724910c.tar.gz bcm5719-llvm-dd25a9d0aac7df7db53a80efeb108032b724910c.zip | |
Use DwarfWriter to record dbg variables.
llvm-svn: 62185
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 9 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp | 6 |
2 files changed, 11 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 47a19dd8935..6627543a856 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -20,6 +20,7 @@ #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" @@ -162,9 +163,9 @@ bool AsmPrinter::doInitialization(Module &M) { SwitchToDataSection(""); // Reset back to no section. - MMI = getAnalysisToUpdate<MachineModuleInfo>(); + MachineModuleInfo *MMI = getAnalysisToUpdate<MachineModuleInfo>(); if (MMI) MMI->AnalyzeModule(M); - + DW = getAnalysisToUpdate<DwarfWriter>(); return false; } @@ -1419,9 +1420,9 @@ void AsmPrinter::printLabel(unsigned Id) const { /// 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 diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp index d79e6aa7783..675ae983f70 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfWriter.cpp @@ -4985,6 +4985,12 @@ unsigned DwarfWriter::getRecordSourceLineCount() { 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() { |

