summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2012-11-14 19:13:30 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2012-11-14 19:13:30 +0000
commitb619a4138d6d03a983a57f39783f6fa05fd4799c (patch)
treeb62ef49448abc38f67f6f332affb48cd3b3881e2 /llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
parent754e396c6506ce658a843cfb0b6d9e134a3fd57d (diff)
downloadbcm5719-llvm-b619a4138d6d03a983a57f39783f6fa05fd4799c.tar.gz
bcm5719-llvm-b619a4138d6d03a983a57f39783f6fa05fd4799c.zip
Fix really stupid ARM EHABI info generation bug: we should not emit
eh table and handler data if there are no landing pads in the function. Patch by Logan Chien with some cleanups from me. llvm-svn: 167945
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/ARMException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/ARMException.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp b/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
index b2ebf04e518..8eea802765c 100644
--- a/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp
@@ -69,22 +69,25 @@ void ARMException::EndFunction() {
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_end",
Asm->getFunctionNumber()));
- // Emit references to personality.
- if (const Function * Personality =
- MMI->getPersonalities()[MMI->getPersonalityIndex()]) {
- MCSymbol *PerSym = Asm->Mang->getSymbol(Personality);
- Asm->OutStreamer.EmitSymbolAttribute(PerSym, MCSA_Global);
- Asm->OutStreamer.EmitPersonality(PerSym);
- }
-
if (EnableARMEHABIDescriptors) {
// Map all labels and get rid of any dead landing pads.
MMI->TidyLandingPads();
- Asm->OutStreamer.EmitHandlerData();
+ if (!MMI->getLandingPads().empty()) {
+ // Emit references to personality.
+ if (const Function * Personality =
+ MMI->getPersonalities()[MMI->getPersonalityIndex()]) {
+ MCSymbol *PerSym = Asm->Mang->getSymbol(Personality);
+ Asm->OutStreamer.EmitSymbolAttribute(PerSym, MCSA_Global);
+ Asm->OutStreamer.EmitPersonality(PerSym);
+ }
+
+ // Emit .handlerdata directive.
+ Asm->OutStreamer.EmitHandlerData();
- // Emit actual exception table
- EmitExceptionTable();
+ // Emit actual exception table
+ EmitExceptionTable();
+ }
}
}
OpenPOWER on IntegriCloud