summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-05-10 18:39:09 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-05-10 18:39:09 +0000
commitfdc3e6fab631355d5c730ce8b0c1cb285a034907 (patch)
treee77e1eb76388de1471f0b69accfe55eb7d3a6f1c /llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
parente33464663f71d910b1131daf7aef7e79513c8de5 (diff)
downloadbcm5719-llvm-fdc3e6fab631355d5c730ce8b0c1cb285a034907.tar.gz
bcm5719-llvm-fdc3e6fab631355d5c730ce8b0c1cb285a034907.zip
Use .cfi_sections to put the unwind info in .debug_frame when possible. With
this clang will use .debug_frame in, for example, clang -g -c -m32 test.c This matches gcc's behaviour. It looks like .debug_frame is a bit bigger than .eh_frame, but has the big advantage of not being allocated. llvm-svn: 131140
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index d88f05b7ccd..7f39cef3f9e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -592,17 +592,17 @@ static bool EmitDebugValueComment(const MachineInstr *MI, AsmPrinter &AP) {
return true;
}
-bool AsmPrinter::needsCFIMoves() {
+AsmPrinter::CFIMoveType AsmPrinter::needsCFIMoves() {
if (UnwindTablesMandatory)
- return true;
+ return CFI_M_EH;
- if (MMI->hasDebugInfo())
- return true;
+ if (!MF->getFunction()->doesNotThrow())
+ return CFI_M_EH;
- if (MF->getFunction()->doesNotThrow())
- return false;
+ if (MMI->hasDebugInfo())
+ return CFI_M_Debug;
- return true;
+ return CFI_M_None;
}
void AsmPrinter::emitPrologLabel(const MachineInstr &MI) {
@@ -611,7 +611,7 @@ void AsmPrinter::emitPrologLabel(const MachineInstr &MI) {
if (MAI->getExceptionHandlingType() != ExceptionHandling::DwarfCFI)
return;
- if (!needsCFIMoves())
+ if (needsCFIMoves() == CFI_M_None)
return;
MachineModuleInfo &MMI = MF->getMMI();
OpenPOWER on IntegriCloud