summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2016-05-02 23:22:18 +0000
committerReid Kleckner <rnk@google.com>2016-05-02 23:22:18 +0000
commit97837b7b091621537854a753942ce504560dee45 (patch)
tree60abc8f455f43edab5d3d423b2439e01c5f33718 /llvm/lib/CodeGen/AsmPrinter/WinException.cpp
parent9102fc20f8e3d89b27d91a23a9a50ae32bf403c4 (diff)
downloadbcm5719-llvm-97837b7b091621537854a753942ce504560dee45.tar.gz
bcm5719-llvm-97837b7b091621537854a753942ce504560dee45.zip
[MC] Create unique .pdata sections for every .text section
Summary: This adds a unique ID to the COFF section uniquing map, similar to the one we have for ELF. The unique id is not currently exposed via the assembler because we don't have a use case for it yet. Users generally create .pdata with the .seh_* family of directives, and the assembler internally needs to produce .pdata and .xdata sections corresponding to the code section. The association between .text sections and the assembler-created .xdata and .pdata sections is maintained as an ID field of MCSectionCOFF. The CFI-related sections are created with the given unique ID, so if more code is added to the same text section, we can find and reuse the CFI sections that were already created. Reviewers: majnemer, rafael Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19376 llvm-svn: 268331
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/WinException.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/WinException.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
index 022c9a280bd..478396556d2 100644
--- a/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/WinException.cpp
@@ -124,10 +124,9 @@ void WinException::endFunction(const MachineFunction *MF) {
if (shouldEmitPersonality || shouldEmitLSDA) {
Asm->OutStreamer->PushSection();
- // Just switch sections to the right xdata section. This use of CurrentFnSym
- // assumes that we only emit the LSDA when ending the parent function.
- MCSection *XData = WinEH::UnwindEmitter::getXDataSection(Asm->CurrentFnSym,
- Asm->OutContext);
+ // Just switch sections to the right xdata section.
+ MCSection *XData = Asm->OutStreamer->getAssociatedXDataSection(
+ Asm->OutStreamer->getCurrentSectionOnly());
Asm->OutStreamer->SwitchSection(XData);
// Emit the tables appropriate to the personality function in use. If we
OpenPOWER on IntegriCloud