diff options
| author | Reid Kleckner <rnk@google.com> | 2017-10-06 17:21:49 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2017-10-06 17:21:49 +0000 |
| commit | 4c4422f9a5813706410a99a9e756f8600be138eb (patch) | |
| tree | d6b13d1e4f5ba089c0d2ae9b959154b4d995bc74 /llvm/lib/MC/MCWin64EH.cpp | |
| parent | 80e31f1f84b3d28e0eb91607dea08b7c63f555c9 (diff) | |
| download | bcm5719-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.cpp | 8 |
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()); } } |

