summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-01-23 22:55:47 +0000
committerEric Christopher <echristo@gmail.com>2014-01-23 22:55:47 +0000
commit1bca60d6529ce41bdd0f1a4f3794c48fa78f3560 (patch)
tree18ca0ee22fcddac163fcd5c7fa42724b8f05a529 /llvm/lib/CodeGen/AsmPrinter
parent1e3be5ba2c1768e535dee98bf4634e3e89b2caef (diff)
downloadbcm5719-llvm-1bca60d6529ce41bdd0f1a4f3794c48fa78f3560.tar.gz
bcm5719-llvm-1bca60d6529ce41bdd0f1a4f3794c48fa78f3560.zip
Make the use of DW_AT_ranges in the compile unit depend also upon
the existence of comdat/special sections. llvm-svn: 199954
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 8e612c3e6eb..7ba4fece43b 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -179,7 +179,7 @@ static unsigned getDwarfVersionFromModule(const Module *M) {
DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
: Asm(A), MMI(Asm->MMI), FirstCU(0), SourceIdMap(DIEValueAllocator),
PrevLabel(NULL), GlobalRangeCount(0),
- InfoHolder(A, "info_string", DIEValueAllocator),
+ InfoHolder(A, "info_string", DIEValueAllocator), HasCURanges(false),
SkeletonHolder(A, "skel_string", DIEValueAllocator) {
DwarfInfoSectionSym = DwarfAbbrevSectionSym = DwarfStrSectionSym = 0;
@@ -209,10 +209,6 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
else
HasDwarfPubSections = DwarfPubSections == Enable;
- // For now only turn on CU ranges if we've explicitly asked for it
- // or we have -ffunction-sections enabled.
- HasCURanges = DwarfCURanges || TargetMachine::getFunctionSections();
-
DwarfVersion = DwarfVersionNumber
? DwarfVersionNumber
: getDwarfVersionFromModule(MMI->getModule());
@@ -1126,6 +1122,13 @@ void DwarfDebug::endSections() {
// Insert a final terminator.
SectionMap[Section].push_back(SymbolCU(NULL, Sym));
}
+
+ // For now only turn on CU ranges if we've explicitly asked for it,
+ // we have -ffunction-sections enabled, or we've emitted a function
+ // into a unique section. At this point all sections should be finalized
+ // except for dwarf sections.
+ HasCURanges = DwarfCURanges || Asm->TM.debugUseUniqueSections() ||
+ TargetMachine::getFunctionSections();
}
// Emit all Dwarf sections that should come after the content.
OpenPOWER on IntegriCloud