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 | c879504978f4bb2aebe9189ed7a3866e3003c961 (patch) | |
tree | 549e9b8f22c83e01858e1d33691e9668ed11a44e /lib | |
parent | 4ec1a52c5f1aa320ec696e500605e99319f46488 (diff) | |
download | llvm-c879504978f4bb2aebe9189ed7a3866e3003c961.tar.gz llvm-c879504978f4bb2aebe9189ed7a3866e3003c961.tar.bz2 llvm-c879504978f4bb2aebe9189ed7a3866e3003c961.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200422 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 66be6058fd..d557f40348 100644 --- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/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(); } |