[MC] Create unique .pdata sections for every .text section
authorReid Kleckner <rnk@google.com>
Mon, 2 May 2016 23:22:18 +0000 (23:22 +0000)
committerReid Kleckner <rnk@google.com>
Mon, 2 May 2016 23:22:18 +0000 (23:22 +0000)
commit97837b7b091621537854a753942ce504560dee45
tree60abc8f455f43edab5d3d423b2439e01c5f33718
parent9102fc20f8e3d89b27d91a23a9a50ae32bf403c4
[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
14 files changed:
llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
llvm/include/llvm/MC/MCContext.h
llvm/include/llvm/MC/MCSectionCOFF.h
llvm/include/llvm/MC/MCStreamer.h
llvm/include/llvm/MC/MCWinEH.h
llvm/lib/CodeGen/AsmPrinter/WinException.cpp
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/lib/MC/MCAsmStreamer.cpp
llvm/lib/MC/MCContext.cpp
llvm/lib/MC/MCStreamer.cpp
llvm/lib/MC/MCWin64EH.cpp
llvm/lib/MC/MCWinEH.cpp
llvm/test/MC/COFF/seh-section-2.s [new file with mode: 0644]
llvm/test/MC/COFF/seh-section.s