aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineModuleInfo.h
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-04-10 18:58:59 +0000
committerDevang Patel <dpatel@apple.com>2009-04-10 18:58:59 +0000
commit03f0a2fba0e0ad80db4cebb977ec331c493637b7 (patch)
tree4d8464e8665615d2185a30ecb0c61c1bdccbb79b /include/llvm/CodeGen/MachineModuleInfo.h
parentec15bbfd2f8a3667313dcfa0f9a11497ae6732b8 (diff)
DebugLabelFolder ruthlessly deletes redundant labels. However, sometimes the redundant labels is referenced by debug info somewhere else. This patch provies a way so that dwarf writer can mark labels as used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68813 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineModuleInfo.h')
-rw-r--r--include/llvm/CodeGen/MachineModuleInfo.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h
index 75956058c4..e5f7c6a9a2 100644
--- a/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/include/llvm/CodeGen/MachineModuleInfo.h
@@ -37,6 +37,7 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/UniqueVector.h"
#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/GlobalValue.h"
@@ -115,6 +116,9 @@ private:
// searchable format.
SmallPtrSet<const Function *, 32> UsedFunctions;
+ /// UsedDbgLabels - labels are used by debug info entries.
+ SmallSet<unsigned, 8> UsedDbgLabels;
+
bool CallsEHReturn;
bool CallsUnwindInit;
@@ -195,6 +199,19 @@ public:
return LabelID ? LabelIDList[LabelID - 1] : 0;
}
+ /// isDbgLabelUsed - Return true if label with LabelID is used by
+ /// DwarfWriter.
+ bool isDbgLabelUsed(unsigned LabelID) {
+ return UsedDbgLabels.count(LabelID);
+ }
+
+ /// RecordUsedDbgLabel - Mark label with LabelID as used. This is used
+ /// by DwarfWriter to inform DebugLabelFolder that certain labels are
+ /// not to be deleted.
+ void RecordUsedDbgLabel(unsigned LabelID) {
+ UsedDbgLabels.insert(LabelID);
+ }
+
/// getFrameMoves - Returns a reference to a list of moves done in the current
/// function's prologue. Used to construct frame maps for debug and exception
/// handling comsumers.