summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCWin64EH.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-10-06 17:21:49 +0000
committerReid Kleckner <rnk@google.com>2017-10-06 17:21:49 +0000
commit4c4422f9a5813706410a99a9e756f8600be138eb (patch)
treed6b13d1e4f5ba089c0d2ae9b959154b4d995bc74 /llvm/lib/MC/MCWin64EH.cpp
parent80e31f1f84b3d28e0eb91607dea08b7c63f555c9 (diff)
downloadbcm5719-llvm-4c4422f9a5813706410a99a9e756f8600be138eb.tar.gz
bcm5719-llvm-4c4422f9a5813706410a99a9e756f8600be138eb.zip
[MC] Use unique_ptr to manage WinFrameInfos, NFC
The FrameInfo cannot be stored directly in the vector because chained frames may refer to parent frames, so we need pointers that are stable across a vector resize. llvm-svn: 315080
Diffstat (limited to 'llvm/lib/MC/MCWin64EH.cpp')
-rw-r--r--llvm/lib/MC/MCWin64EH.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCWin64EH.cpp b/llvm/lib/MC/MCWin64EH.cpp
index fdc4c10cd6c..44dd8f1385a 100644
--- a/llvm/lib/MC/MCWin64EH.cpp
+++ b/llvm/lib/MC/MCWin64EH.cpp
@@ -220,17 +220,17 @@ static void EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info) {
void llvm::Win64EH::UnwindEmitter::Emit(MCStreamer &Streamer) const {
// Emit the unwind info structs first.
- for (WinEH::FrameInfo *CFI : Streamer.getWinFrameInfos()) {
+ for (const auto &CFI : Streamer.getWinFrameInfos()) {
MCSection *XData = Streamer.getAssociatedXDataSection(CFI->TextSection);
Streamer.SwitchSection(XData);
- ::EmitUnwindInfo(Streamer, CFI);
+ ::EmitUnwindInfo(Streamer, CFI.get());
}
// Now emit RUNTIME_FUNCTION entries.
- for (WinEH::FrameInfo *CFI : Streamer.getWinFrameInfos()) {
+ for (const auto &CFI : Streamer.getWinFrameInfos()) {
MCSection *PData = Streamer.getAssociatedPDataSection(CFI->TextSection);
Streamer.SwitchSection(PData);
- EmitRuntimeFunction(Streamer, CFI);
+ EmitRuntimeFunction(Streamer, CFI.get());
}
}
OpenPOWER on IntegriCloud