summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorKai Nacke <kai.nacke@redstar.de>2013-07-06 17:17:31 +0000
committerKai Nacke <kai.nacke@redstar.de>2013-07-06 17:17:31 +0000
commitc947ad2a2d68f91ead632d3da66ad33cf8d9cfcf (patch)
treea3974df210b6c30e6eba7118d71e7b98b873bbe3 /llvm/lib/CodeGen
parent4417cccba3c0b4fc281b4c05b7e4df1425a3ce0a (diff)
downloadbcm5719-llvm-c947ad2a2d68f91ead632d3da66ad33cf8d9cfcf.tar.gz
bcm5719-llvm-c947ad2a2d68f91ead632d3da66ad33cf8d9cfcf.zip
Emit personality function and Dwarf EH data for Win64 SEH.
Obviously the personality function should be emitted as language handler instead of the hard coded _GCC_specific_handler. The language specific data must be placed after the unwind information therefore it must not be emitted into a separate section. Reviewed by Charles Davis and Nico Rieck. llvm-svn: 185761
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp b/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
index 156101286b7..99d53b9cee8 100644
--- a/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp
@@ -78,9 +78,9 @@ void Win64Exception::BeginFunction(const MachineFunction *MF) {
if (!shouldEmitPersonality)
return;
- MCSymbol *GCCHandlerSym =
- Asm->GetExternalSymbolSymbol("_GCC_specific_handler");
- Asm->OutStreamer.EmitWin64EHHandler(GCCHandlerSym, true, true);
+ const MCSymbol *PersHandlerSym = TLOF.getCFIPersonalitySymbol(Per, Asm->Mang,
+ MMI);
+ Asm->OutStreamer.EmitWin64EHHandler(PersHandlerSym, true, true);
Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_begin",
Asm->getFunctionNumber()));
@@ -99,14 +99,8 @@ void Win64Exception::EndFunction() {
MMI->TidyLandingPads();
if (shouldEmitPersonality) {
- const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
- const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
- const MCSymbol *Sym = TLOF.getCFIPersonalitySymbol(Per, Asm->Mang, MMI);
-
Asm->OutStreamer.PushSection();
Asm->OutStreamer.EmitWin64EHHandlerData();
- Asm->OutStreamer.EmitValue(MCSymbolRefExpr::Create(Sym, Asm->OutContext),
- 4);
EmitExceptionTable();
Asm->OutStreamer.PopSection();
}
OpenPOWER on IntegriCloud