aboutsummaryrefslogtreecommitdiffstats
path: root/include
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
commit2e28d627d086d38a7e62fc2e3b6f4b9ef24ecf07 (patch)
tree0536e06ef73d25184c28dd72de26a26cfda1a4d1 /include
parent6ef46ac1b22908285a565b3a6ab46061ab487311 (diff)
downloadexternal_llvm-2e28d627d086d38a7e62fc2e3b6f4b9ef24ecf07.zip
external_llvm-2e28d627d086d38a7e62fc2e3b6f4b9ef24ecf07.tar.gz
external_llvm-2e28d627d086d38a7e62fc2e3b6f4b9ef24ecf07.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46659 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/AsmPrinter.h4
-rw-r--r--include/llvm/CodeGen/MachineModuleInfo.h12
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h4
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h6
-rw-r--r--include/llvm/Target/TargetInstrInfo.h5
5 files changed, 27 insertions, 4 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h
index cda213c..bbe650b 100644
--- a/include/llvm/CodeGen/AsmPrinter.h
+++ b/include/llvm/CodeGen/AsmPrinter.h
@@ -281,6 +281,10 @@ namespace llvm {
void printLabel(const MachineInstr *MI) const;
void printLabel(unsigned Id) const;
+ /// printDeclare - This method prints a local variable declaration used by
+ /// debug tables.
+ void printDeclare(const MachineInstr *MI) const;
+
protected:
/// EmitZeros - Emit a block of zeros.
///
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h
index ee94e51..8d0a34b 100644
--- a/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/include/llvm/CodeGen/MachineModuleInfo.h
@@ -844,6 +844,10 @@ public:
/// serialization of a DebugInfoDesc.
bool Verify(Value *V);
bool Verify(GlobalVariable *GV);
+
+ /// isVerified - Return true if the specified GV has already been
+ /// verified as a debug information descriptor.
+ bool isVerified(GlobalVariable *GV);
};
//===----------------------------------------------------------------------===//
@@ -1073,7 +1077,11 @@ public:
/// Verify - Verify that a Value is debug information descriptor.
///
- bool Verify(Value *V);
+ bool Verify(Value *V) { return VR.Verify(V); }
+
+ /// isVerified - Return true if the specified GV has already been
+ /// verified as a debug information descriptor.
+ bool isVerified(GlobalVariable *GV) { return VR.isVerified(GV); }
/// AnalyzeModule - Scan the module for global debug information.
///
@@ -1197,7 +1205,7 @@ public:
/// RecordVariable - Indicate the declaration of a local variable.
///
- void RecordVariable(Value *V, unsigned FrameIndex);
+ void RecordVariable(GlobalValue *GV, unsigned FrameIndex);
/// getRootScope - Return current functions root scope.
///
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index a9ad9a4..c1a01ea 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -551,6 +551,10 @@ public:
/// implement the ComputeNumSignBitsForTarget method in the TargetLowering
/// class to allow target nodes to be understood.
unsigned ComputeNumSignBits(SDOperand Op, unsigned Depth = 0) const;
+
+ /// isVerifiedDebugInfoDesc - Returns true if the specified SDOperand has
+ /// been verified as a debug information descriptor.
+ bool isVerifiedDebugInfoDesc(SDOperand Op) const;
private:
void RemoveNodeFromCSEMaps(SDNode *N);
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index d0011c3..fb8db3e 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -498,6 +498,12 @@ namespace ISD {
// Operand #2 : 0 indicates a debug label (e.g. stoppoint), 1 indicates
// a EH label, 2 indicates unknown label type.
LABEL,
+
+ // DECLARE - Represents a llvm.dbg.declare intrinsic. It's used to track
+ // local variable declarations for debugging information. First operand is
+ // a chain, while the next two operands are first two arguments (address
+ // and variable) of a llvm.dbg.declare instruction.
+ DECLARE,
// STACKSAVE - STACKSAVE has one operand, an input chain. It produces a
// value, the same type as the pointer type for the system, and an output
diff --git a/include/llvm/Target/TargetInstrInfo.h b/include/llvm/Target/TargetInstrInfo.h
index e62104c..e18b366 100644
--- a/include/llvm/Target/TargetInstrInfo.h
+++ b/include/llvm/Target/TargetInstrInfo.h
@@ -47,8 +47,9 @@ public:
PHI = 0,
INLINEASM = 1,
LABEL = 2,
- EXTRACT_SUBREG = 3,
- INSERT_SUBREG = 4
+ DECLARE = 3,
+ EXTRACT_SUBREG = 4,
+ INSERT_SUBREG = 5
};
unsigned getNumOpcodes() const { return NumOpcodes; }