summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
diff options
context:
space:
mode:
authorRichard Mitton <richard@codersnotes.com>2013-09-19 23:21:01 +0000
committerRichard Mitton <richard@codersnotes.com>2013-09-19 23:21:01 +0000
commit21101b32318647f600584d966c697d8773f59629 (patch)
tree1e34857ba6e750efaf5802334d0beafff5978280 /llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
parent665d3ec3d36ea75844c9cea4ac5fbd17daeeeebc (diff)
downloadbcm5719-llvm-21101b32318647f600584d966c697d8773f59629.tar.gz
bcm5719-llvm-21101b32318647f600584d966c697d8773f59629.zip
Added support for generate DWARF .debug_aranges sections automatically.
llvm-svn: 191052
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index 4893c25c098..2638b3150f0 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -181,6 +181,12 @@ void CompileUnit::addLabel(DIE *Die, uint16_t Attribute, uint16_t Form,
const MCSymbol *Label) {
DIEValue *Value = new (DIEValueAllocator) DIELabel(Label);
Die->addValue(Attribute, Form, Value);
+
+ SymbolCU Entry;
+ Entry.CU = this;
+ Entry.Sym = Label;
+
+ DD->addLabel(Entry);
}
/// addLabelAddress - Add a dwarf label attribute data and value using
@@ -188,6 +194,14 @@ void CompileUnit::addLabel(DIE *Die, uint16_t Attribute, uint16_t Form,
///
void CompileUnit::addLabelAddress(DIE *Die, uint16_t Attribute,
MCSymbol *Label) {
+ if (Label) {
+ SymbolCU Entry;
+ Entry.CU = this;
+ Entry.Sym = Label;
+
+ DD->addLabel(Entry);
+ }
+
if (!DD->useSplitDwarf()) {
if (Label != NULL) {
DIEValue *Value = new (DIEValueAllocator) DIELabel(Label);
OpenPOWER on IntegriCloud