[Lldb-commits] [lldb] r189365 - Remove need of <functional> for CommandObjectCommands.

Virgile Bello virgile.bello at gmail.com
Tue Aug 27 16:54:08 PDT 2013


Yes sorry I meant <initializer_list>.

Actually I thought this include was explicitely needed for MSVC12 port...
but I've just been testing again, it seems not necessary anymore, maybe it
was fixed in the latest version -- my bad.

However for this specific case with std::pair, it felt easier to just use
normal constructor instead of initializer_list since it doesn't make code
much different
(as opposed to cases such as std::vector<int> a = { 1, 1, 1 } where it
makes much more sense vs using many verbose push_back).

Also, even though it's not a big priority for me, it should also make it
easier to maintain a future MSVC11 branch (which doesn't support
initializer_list) by using this feature only where it actually matters, so
that it minimizes differences.

Of course I won't try to remove it from all the other useful situations
where it's used.

Hopes that make sense, and let me know if you prefer me to revert, no
problem for me.



On Wed, Aug 28, 2013 at 3:06 AM, Enrico Granata <egranata at apple.com> wrote:

> I think you meant <initializer_list> rather than <functional>
> With that said, why do we care to “remove the need” for this header?
> Is that just because we can easily do without in this case, or is there a
> more deep-rooted reason?
> If the latter, since it is a standard header, it worries me a little.
>
>  Enrico Granata
> 📩 egranata@.com
> ☎️ 27683
>
> On Aug 27, 2013, at 9:22 AM, Virgile Bello <virgile.bello at gmail.com>
> wrote:
>
> Author: xen2
> Date: Tue Aug 27 11:22:29 2013
> New Revision: 189365
>
> URL: http://llvm.org/viewvc/llvm-project?rev=189365&view=rev
> Log:
> Remove need of <functional> for CommandObjectCommands.
>
> Modified:
>    lldb/trunk/source/Commands/CommandObjectCommands.cpp
>
> Modified: lldb/trunk/source/Commands/CommandObjectCommands.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectCommands.cpp?rev=189365&r1=189364&r2=189365&view=diff
>
> ==============================================================================
> --- lldb/trunk/source/Commands/CommandObjectCommands.cpp (original)
> +++ lldb/trunk/source/Commands/CommandObjectCommands.cpp Tue Aug 27
> 11:22:29 2013
> @@ -156,9 +156,9 @@ protected:
>             }
>             else
>             {
> -                std::pair<bool,uint64_t> start_idx =
> {m_options.m_start_idx.OptionWasSet(),m_options.m_start_idx.GetCurrentValue()};
> -                std::pair<bool,uint64_t> stop_idx =
> {m_options.m_stop_idx.OptionWasSet(),m_options.m_stop_idx.GetCurrentValue()};
> -                std::pair<bool,uint64_t> count =
> {m_options.m_count.OptionWasSet(),m_options.m_count.GetCurrentValue()};
> +                std::pair<bool,uint64_t>
> start_idx(m_options.m_start_idx.OptionWasSet(),m_options.m_start_idx.GetCurrentValue());
> +                std::pair<bool,uint64_t>
> stop_idx(m_options.m_stop_idx.OptionWasSet(),m_options.m_stop_idx.GetCurrentValue());
> +                std::pair<bool,uint64_t>
> count(m_options.m_count.OptionWasSet(),m_options.m_count.GetCurrentValue());
>
>                 const CommandHistory&
> history(m_interpreter.GetCommandHistory());
>
>
>
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20130828/aa8516fb/attachment.html>


More information about the lldb-commits mailing list