MC Win64: Put unwind info for COMDAT code into the same COMDAT group

Summary:
This fixes a long standing issue where we would emit many little .text
sections and only one .pdata and .xdata section. Now we generate one
.pdata / .xdata pair per .text section and associate them correctly.

Fixes PR19667.

Reviewers: majnemer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D5181

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217176 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner
2014-09-04 17:42:03 +00:00
parent 54dfc533fc
commit b9cb76d3f3
8 changed files with 162 additions and 49 deletions

View File

@@ -225,7 +225,7 @@ void UnwindEmitter::Emit(MCStreamer &Streamer) const {
// Emit the unwind info structs first.
for (const auto &CFI : Streamer.getWinFrameInfos()) {
const MCSection *XData =
GetXDataSection(GetSectionSuffix(CFI->Function), Context);
getXDataSection(CFI->Function, Context);
Streamer.SwitchSection(XData);
EmitUnwindInfo(Streamer, CFI);
}
@@ -233,7 +233,7 @@ void UnwindEmitter::Emit(MCStreamer &Streamer) const {
// Now emit RUNTIME_FUNCTION entries.
for (const auto &CFI : Streamer.getWinFrameInfos()) {
const MCSection *PData =
GetPDataSection(GetSectionSuffix(CFI->Function), Context);
getPDataSection(CFI->Function, Context);
Streamer.SwitchSection(PData);
EmitRuntimeFunction(Streamer, CFI);
}
@@ -245,7 +245,7 @@ void UnwindEmitter::EmitUnwindInfo(MCStreamer &Streamer,
// here and from Emit().
MCContext &context = Streamer.getContext();
const MCSection *xdataSect =
GetXDataSection(GetSectionSuffix(info->Function), context);
getXDataSection(info->Function, context);
Streamer.SwitchSection(xdataSect);
llvm::EmitUnwindInfo(Streamer, info);