summaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineModuleInfo.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-01 01:03:26 +0000
committerDevang Patel <dpatel@apple.com>2009-10-01 01:03:26 +0000
commit75549f4444cbb14e73c8f10ab90ec36c60413e8e (patch)
treecf41f5dc27b313b9bc0ad7ff9ca1bf0d0272bddf /include/llvm/CodeGen/MachineModuleInfo.h
parentb0fdedb3fd123a47e7deca75d1e6f7d64218b07a (diff)
downloadllvm-75549f4444cbb14e73c8f10ab90ec36c60413e8e.tar.gz
llvm-75549f4444cbb14e73c8f10ab90ec36c60413e8e.tar.bz2
llvm-75549f4444cbb14e73c8f10ab90ec36c60413e8e.tar.xz
If location info is attached with an instruction then keep track of alloca slots used by a variable. This info will be used by AsmPrinter to emit debug info for variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineModuleInfo.h')
-rw-r--r--include/llvm/CodeGen/MachineModuleInfo.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h
index 6707ab119c..b7b90198b1 100644
--- a/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/include/llvm/CodeGen/MachineModuleInfo.h
@@ -48,6 +48,7 @@ namespace llvm {
//===----------------------------------------------------------------------===//
// Forward declarations.
class Constant;
+class MDNode;
class GlobalVariable;
class MachineBasicBlock;
class MachineFunction;
@@ -142,9 +143,13 @@ class MachineModuleInfo : public ImmutablePass {
/// DbgInfoAvailable - True if debugging information is available
/// in this module.
bool DbgInfoAvailable;
+
public:
static char ID; // Pass identification, replacement for typeid
+ typedef DenseMap<MDNode *, std::pair<MDNode *, unsigned> > VariableDbgInfoMapTy;
+ VariableDbgInfoMapTy VariableDbgInfo;
+
MachineModuleInfo();
~MachineModuleInfo();
@@ -325,6 +330,15 @@ public:
/// of one is required to emit exception handling info.
Function *getPersonality() const;
+ /// setVariableDbgInfo - Collect information used to emit debugging information
+ /// of a variable.
+ void setVariableDbgInfo(MDNode *N, MDNode *L, unsigned S) {
+ if (N && L)
+ VariableDbgInfo[N] = std::make_pair(L, S);
+ }
+
+ VariableDbgInfoMapTy &getVariableDbgInfo() { return VariableDbgInfo; }
+
}; // End class MachineModuleInfo
} // End llvm namespace