summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineModuleInfo.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-02-02 04:07:54 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-02-02 04:07:54 +0000
commitefd142a92081d25766cccb493f0580d0d05ec19e (patch)
tree40e210f72b4ec27f5093bd8a1082ff590c996156 /llvm/lib/CodeGen/MachineModuleInfo.cpp
parent8df7cc1119f6613336b5281921341c6f83a90c6f (diff)
downloadbcm5719-llvm-efd142a92081d25766cccb493f0580d0d05ec19e.tar.gz
bcm5719-llvm-efd142a92081d25766cccb493f0580d0d05ec19e.zip
SDIsel processes llvm.dbg.declare by recording the variable debug information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc.
Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes. For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time. llvm-svn: 46659
Diffstat (limited to 'llvm/lib/CodeGen/MachineModuleInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineModuleInfo.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp
index 5edeefbfaec..6d285bde049 100644
--- a/llvm/lib/CodeGen/MachineModuleInfo.cpp
+++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp
@@ -1471,6 +1471,14 @@ bool DIVerifier::Verify(GlobalVariable *GV) {
return true;
}
+/// isVerified - Return true if the specified GV has already been
+/// verified as a debug information descriptor.
+bool DIVerifier::isVerified(GlobalVariable *GV) {
+ unsigned &ValiditySlot = Validity[GV];
+ if (ValiditySlot) return ValiditySlot == Valid;
+ return false;
+}
+
//===----------------------------------------------------------------------===//
DebugScope::~DebugScope() {
@@ -1554,12 +1562,6 @@ DebugInfoDesc *MachineModuleInfo::getDescFor(Value *V) {
return DR.Deserialize(V);
}
-/// Verify - Verify that a Value is debug information descriptor.
-///
-bool MachineModuleInfo::Verify(Value *V) {
- return VR.Verify(V);
-}
-
/// AnalyzeModule - Scan the module for global debug information.
///
void MachineModuleInfo::AnalyzeModule(Module &M) {
@@ -1657,8 +1659,8 @@ unsigned MachineModuleInfo::RecordRegionEnd(Value *V) {
/// RecordVariable - Indicate the declaration of a local variable.
///
-void MachineModuleInfo::RecordVariable(Value *V, unsigned FrameIndex) {
- VariableDesc *VD = cast<VariableDesc>(DR.Deserialize(V));
+void MachineModuleInfo::RecordVariable(GlobalValue *GV, unsigned FrameIndex) {
+ VariableDesc *VD = cast<VariableDesc>(DR.Deserialize(GV));
DebugScope *Scope = getOrCreateScope(VD->getContext());
DebugVariable *DV = new DebugVariable(VD, FrameIndex);
Scope->AddVariable(DV);
OpenPOWER on IntegriCloud