[PATCH] Sema: Eliminate recursion from checkForFunctionCall()
Vedant Kumar
vsk at apple.com
Wed Jul 22 14:55:06 PDT 2015
Part 2 of the Sema::checkForFunctionCall() patch attached.
> Probably a `SmallVector<..., 16>` or some such would make sense
> instead of a `std::vector<...>`.
Done.
> I haven't seen `reference_wrapper<>` at all in LLVM, so I'm not sure
> all the supported standard libraries have it available. Please use
> `CFGBlock*` instead.
Done.
>
>> + Stack.emplace_back(std::make_pair(std::ref(Block), State));
>
> With `emplace_back()`, you can call any constructor:
>
> Stack.emplace_back(&Block, State);
That makes things much cleaner.
> I see you've maintained the visitation order by reversing iteration.
> Makes sense for this commit, but it might be nice to clean this up
> in a follow-up (assuming visitation order doesn't matter here, which
> I don't think it does?):
I maintained the old iteration order just to be extra careful.
Switching to a normal forward iterator doesn’t seem to affect anything. Aesthetically, this seems preferable. Something for a follow-up?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checkForFunctionCall-2.patch
Type: application/octet-stream
Size: 1614 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150722/408eebe2/attachment.obj>
More information about the cfe-commits
mailing list