[PATCH] D87448: [CodeGen] [WinException] Only produce handler data at the end of the function if needed

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 07:42:13 PST 2020

mstorsjo added inline comments.

Comment at: llvm/lib/MC/MCStreamer.cpp:695
+  CurrentProcWinFrameInfoStart = WinFrameInfos.size();
hans wrote:
> mstorsjo wrote:
> > hans wrote:
> > > When I first saw this variable name I thought it was some kind of offset. But now I see it's really an index into WinFrameInfos.
> > > 
> > > Maybe CurrentProcWinFrameInfoIndex would be a better name? And should it be initialized to -1 or some other invalid value rather than 0, since I assume it should always be set here before it's used?
> > Initializing to -1 should be fine, this is pretty tightly checked to be called in pairs only.
> > 
> > I can change the name, but it isn't necessarily the index of one single frame, but the start index to a range of frames, from startindex to the end of the vector.
> Maybe StartIndex, then? Or just leave as it is I suppose, it becomes clear when looking at how it's used.
Yeah, StartIndex sounds good to me, will change it to that form before pushing. Thanks!



More information about the llvm-commits mailing list