diff options
Diffstat (limited to 'lib/CodeGen/DwarfWriter.cpp')
-rw-r--r-- | lib/CodeGen/DwarfWriter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index 947b420cd5..6cdc91e1f7 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -2905,8 +2905,11 @@ private: // If there are no calls then you can't unwind. This may mean we can // omit the EH Frame, but some environments do not handle weak absolute - // symbols. + // symbols. + // If UnwindTablesOptional is not set we cannot do this optimization; the + // unwind info is to be available for non-EH uses. if (!EHFrameInfo.hasCalls && + UnwindTablesOptional && ((linkage != Function::WeakLinkage && linkage != Function::LinkOnceLinkage) || !TAI->getWeakDefDirective() || @@ -3427,7 +3430,9 @@ public: shouldEmitTable = true; // See if we need frame move info. - if (MMI->hasDebugInfo() || !MF->getFunction()->doesNotThrow()) + if (MMI->hasDebugInfo() || + !MF->getFunction()->doesNotThrow() || + !UnwindTablesOptional) shouldEmitMoves = true; if (shouldEmitMoves || shouldEmitTable) |