summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2014-01-28 00:49:26 +0000
committerEric Christopher <echristo@gmail.com>2014-01-28 00:49:26 +0000
commit2037caf8b9fe65d33624d5c583fa5d374852e40c (patch)
treefc3fa1dadb8565986875f763d544212e4d9f2457 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parent59baee8451795a45a95c2576c7ebbb8f2ae19392 (diff)
downloadbcm5719-llvm-2037caf8b9fe65d33624d5c583fa5d374852e40c.tar.gz
bcm5719-llvm-2037caf8b9fe65d33624d5c583fa5d374852e40c.zip
Revert r199871 and replace it with a simple check in the debug info
code to see if we're emitting a function into a non-default text section. This is still a less-than-ideal solution, but more contained than r199871 to determine whether or not we're emitting code into an array of comdat sections. llvm-svn: 200269
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 72ce337b203..1d059d9f3c7 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -176,6 +176,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M)
: Asm(A), MMI(Asm->MMI), FirstCU(0), SourceIdMap(DIEValueAllocator),
PrevLabel(NULL), GlobalRangeCount(0),
InfoHolder(A, "info_string", DIEValueAllocator), HasCURanges(false),
+ UsedNonDefaultText(false),
SkeletonHolder(A, "skel_string", DIEValueAllocator) {
DwarfInfoSectionSym = DwarfAbbrevSectionSym = DwarfStrSectionSym = 0;
@@ -1123,7 +1124,7 @@ void DwarfDebug::endSections() {
// 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() ||
+ HasCURanges = DwarfCURanges || UsedNonDefaultText ||
TargetMachine::getFunctionSections();
}
@@ -1580,6 +1581,12 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) {
else
Asm->OutStreamer.getContext().setDwarfCompileUnitID(TheCU->getUniqueID());
+ // Check the current section against the standard text section. If different
+ // keep track so that we will know when we're emitting functions into multiple
+ // sections.
+ if (Asm->getObjFileLowering().getTextSection() != Asm->getCurrentSection())
+ UsedNonDefaultText = true;
+
// Emit a label for the function so that we have a beginning address.
FunctionBeginSym = Asm->GetTempSymbol("func_begin", Asm->getFunctionNumber());
// Assumes in correct section after the entry point.
OpenPOWER on IntegriCloud