aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/DwarfWriter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2008-04-08 00:10:24 +0000
committerDale Johannesen <dalej@apple.com>2008-04-08 00:10:24 +0000
commit4e1b79459fcf72216cdc42a59953e172c60e15ca (patch)
tree6d330b1c9b9699f92a180db1468821d536b70cc8 /lib/CodeGen/DwarfWriter.cpp
parent9b01cc0ede3bfef32ce46159670dedc3e9769a64 (diff)
Implement new llc flag -disable-required-unwind-tables.
Corresponds to -fno-unwind-tables (usually default in gcc). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49361 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/DwarfWriter.cpp')
-rw-r--r--lib/CodeGen/DwarfWriter.cpp9
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)