summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-01-14 18:50:10 +0000
committerReid Kleckner <reid@kleckner.net>2015-01-14 18:50:10 +0000
commit9b5eaf0d5a770e509d1170f6b3a2e86b2f8833d6 (patch)
treec68978d99fe401fae894f9a6b2b139d52fdb82e7 /llvm/lib/CodeGen/AsmPrinter
parentb57c1dc0f7f43d3930299f5bc42af465710e5f27 (diff)
downloadbcm5719-llvm-9b5eaf0d5a770e509d1170f6b3a2e86b2f8833d6.tar.gz
bcm5719-llvm-9b5eaf0d5a770e509d1170f6b3a2e86b2f8833d6.zip
Emit the Itanium LSDA for unknown EH personalities on Win64
This fixes lots of generic CodeGen tests that use __gcc_personality_v0. This suggests that using ExceptionHandling::MSVC was a mistake, and we should instead classify each function by personality function. This would, for example, allow us to LTO a binary containing uses of SEH and Itanium EH. llvm-svn: 226019
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp b/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
index 2138cb9514f..84549ae95ae 100644
--- a/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
@@ -103,18 +103,13 @@ void Win64Exception::endFunction(const MachineFunction *) {
// Emit an UNWIND_INFO struct describing the prologue.
Asm->OutStreamer.EmitWinEHHandlerData();
- // Emit either MSVC-compatible tables or the usual Itanium-style LSDA after
- // the UNWIND_INFO struct.
- if (Asm->MAI->getExceptionHandlingType() == ExceptionHandling::MSVC) {
- const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
- if (Per->getName() == "__C_specific_handler")
- emitCSpecificHandlerTable();
- else
- report_fatal_error(Twine("unexpected personality function: ") +
- Per->getName());
- } else {
+ // Emit the tables appropriate to the personality function in use. If we
+ // don't recognize the personality, assume it uses an Itanium-style LSDA.
+ const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
+ if (Per->getName() == "__C_specific_handler")
+ emitCSpecificHandlerTable();
+ else
emitExceptionTable();
- }
Asm->OutStreamer.PopSection();
}
OpenPOWER on IntegriCloud