diff options
author | Eric Christopher <echristo@gmail.com> | 2014-01-29 22:06:27 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-01-29 22:06:27 +0000 |
commit | fb8dd0085ee1a157540b20539b5278e472740999 (patch) | |
tree | d9eb1dc4aadf001ad02be4d66495d582973f8e2f /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 179fba19faf538a7e368f88ba704026dcae956d2 (diff) | |
download | bcm5719-llvm-fb8dd0085ee1a157540b20539b5278e472740999.tar.gz bcm5719-llvm-fb8dd0085ee1a157540b20539b5278e472740999.zip |
Turn on CU ranges if we've got multiple compile units in the same
module since there's no range guarantee that we could make given
output order. This also fixes up the testcases that have multiple
CUs to have the correct range offset.
llvm-svn: 200422
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 66be6058fd2..d557f403480 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -1119,10 +1119,12 @@ void DwarfDebug::endSections() { } // 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 || UsedNonDefaultText || + // we have -ffunction-sections enabled, we've emitted a function + // into a unique section, or we're using LTO. If we're using LTO then + // we can't know that any particular function in the module is correlated + // to a particular CU and so we need to be conservative. At this point all + // sections should be finalized except for dwarf sections. + HasCURanges = DwarfCURanges || UsedNonDefaultText || (CUMap.size() > 1) || TargetMachine::getFunctionSections(); } |