aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-01-13 21:44:10 +0000
committerDevang Patel <dpatel@apple.com>2009-01-13 21:44:10 +0000
commitfe359e7dc51edffc6045beb6a8d4cefd2d4daae1 (patch)
treef692a276c984fc840d0168979733ab03472b1c2f /lib/CodeGen
parent70190877b7aff395f931cc568f376a07d0ba416e (diff)
downloadexternal_llvm-fe359e7dc51edffc6045beb6a8d4cefd2d4daae1.zip
external_llvm-fe359e7dc51edffc6045beb6a8d4cefd2d4daae1.tar.gz
external_llvm-fe359e7dc51edffc6045beb6a8d4cefd2d4daae1.tar.bz2
Use DwarfWriter to record dbg variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62185 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp9
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfWriter.cpp6
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 47a19dd..6627543 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/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/lib/CodeGen/AsmPrinter/DwarfWriter.cpp b/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
index d79e6aa..675ae98 100644
--- a/lib/CodeGen/AsmPrinter/DwarfWriter.cpp
+++ b/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() {