summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2015-05-29 17:00:57 +0000
committerReid Kleckner <reid@kleckner.net>2015-05-29 17:00:57 +0000
commit1d3d4adbb9b54cc921f21f97506197acf80a0778 (patch)
tree084fff7c92f1004ee8e30560bd191efe4c3ed514 /llvm/lib/MC
parent995dde27995e3f957966fd52d721d65d60bda43b (diff)
downloadbcm5719-llvm-1d3d4adbb9b54cc921f21f97506197acf80a0778.tar.gz
bcm5719-llvm-1d3d4adbb9b54cc921f21f97506197acf80a0778.zip
[WinEH] Emit EH tables for __CxxFrameHandler3 on 32-bit x86
Small (really small!) C++ exception handling examples work on 32-bit x86 now. This change disables the use of .seh_* directives in WinException when CFI is not in use. It also uses absolute symbol references in the tables instead of imagerel32 relocations. Also fixes a cache invalidation bug in MMI personality classification. llvm-svn: 238575
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCAsmStreamer.cpp6
-rw-r--r--llvm/lib/MC/MCStreamer.cpp6
2 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index cabe63b029f..be31bc976b1 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -1102,9 +1102,9 @@ void MCAsmStreamer::EmitWinEHHandlerData() {
// We only do this so the section switch that terminates the handler
// data block is visible.
WinEH::FrameInfo *CurFrame = getCurrentWinFrameInfo();
- if (MCSection *XData = WinEH::UnwindEmitter::getXDataSection(
- CurFrame->Function, getContext()))
- SwitchSectionNoChange(XData);
+ MCSection *XData =
+ WinEH::UnwindEmitter::getXDataSection(CurFrame->Function, getContext());
+ SwitchSectionNoChange(XData);
OS << "\t.seh_handlerdata";
EmitEOL();
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp
index 71d4b06b5d9..03ef7eda72c 100644
--- a/llvm/lib/MC/MCStreamer.cpp
+++ b/llvm/lib/MC/MCStreamer.cpp
@@ -391,11 +391,17 @@ void MCStreamer::EmitCFIWindowSave() {
}
void MCStreamer::EnsureValidWinFrameInfo() {
+ const MCAsmInfo *MAI = Context.getAsmInfo();
+ if (!MAI->usesWindowsCFI())
+ report_fatal_error(".seh_* directives are not supported on this target");
if (!CurrentWinFrameInfo || CurrentWinFrameInfo->End)
report_fatal_error("No open Win64 EH frame function!");
}
void MCStreamer::EmitWinCFIStartProc(const MCSymbol *Symbol) {
+ const MCAsmInfo *MAI = Context.getAsmInfo();
+ if (!MAI->usesWindowsCFI())
+ report_fatal_error(".seh_* directives are not supported on this target");
if (CurrentWinFrameInfo && !CurrentWinFrameInfo->End)
report_fatal_error("Starting a function before ending the previous one!");
OpenPOWER on IntegriCloud